CComponentsInfoBox: Add setTextBorderWidth() to paintText()

- Add delete textbox to paint()
- remove CTextBox::AUTO_HIGH


Origin commit data
------------------
Branch: ni/coolstream
Commit: 1ac03645cc
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2012-08-20 (Mon, 20 Aug 2012)

Origin message was:
------------------
* CComponentsInfoBox: Add setTextBorderWidth() to paintText()

- Add delete textbox to paint()
- remove CTextBox::AUTO_HIGH


------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2012-08-20 06:14:40 +02:00
committed by Thilo Graf
parent 69b54672a6
commit 1ddc65e25d
2 changed files with 11 additions and 6 deletions

View File

@@ -207,15 +207,15 @@ class CComponentsInfoBox : public CComponentsContainer
fb_pixel_t col_text; fb_pixel_t col_text;
public: public:
CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h, CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h,
const char* info_text = NULL, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL, const char* info_text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
bool has_shadow = CC_SHADOW_OFF, bool has_shadow = CC_SHADOW_OFF,
fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
~CComponentsInfoBox(); ~CComponentsInfoBox();
void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL){text = info_text; text_mode = mode, font = font_text;}; void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; text_mode = mode, font = font_text;};
void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, font = font_text;}; void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, font = font_text;};
void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL); void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL);
void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes
void setTextFont(Font* font_text){font = font_text;}; void setTextFont(Font* font_text){font = font_text;};
void setTextColor(fb_pixel_t color_text){ col_text = color_text;}; void setTextColor(fb_pixel_t color_text){ col_text = color_text;};

View File

@@ -368,18 +368,23 @@ void CComponentsInfoBox::paintText()
textbox = new CTextBox(text, font, text_mode, box, col_body); textbox = new CTextBox(text, font, text_mode, box, col_body);
//set properties //set properties
textbox->setTextBorderWidth(0);
textbox->movePosition(box->iX, box->iY); textbox->movePosition(box->iX, box->iY);
textbox->setTextColor(col_text); textbox->setTextColor(col_text);
textbox->enableBackgroundPaint(false); textbox->enableBackgroundPaint(false);
//set text //set text
string new_text = static_cast <string> (text); // string new_text = static_cast <string> (text);
if (textbox->setText(&new_text)) // if (textbox->setText(&text))
textbox->paint(); textbox->paint();
} }
void CComponentsInfoBox::paint(bool do_save_bg) void CComponentsInfoBox::paint(bool do_save_bg)
{ {
if (textbox) {
delete textbox;
textbox = NULL;
}
paintInit(do_save_bg); paintInit(do_save_bg);
paintPicture(); paintPicture();
if (text) if (text)