diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 78cf42000..4d4c4c2c2 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -224,16 +224,15 @@ class CComponentsText : public CComponentsItem Font * ct_font; fb_pixel_t ct_col_text; + int ct_text_mode; //see textbox.h for possible modes void initVarText(); void clearCCText(); private: const char* ct_text; - int ct_text_mode; //see textbox.h for possible modes bool ct_text_sended; - void initCCText(); public: @@ -244,8 +243,9 @@ class CComponentsText : public CComponentsItem void hide(bool no_restore = false); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - inline void setTextFont(Font* font_text){ct_font = font_text;}; + virtual inline void setTextFont(Font* font_text){ct_font = font_text;}; virtual inline void setTextColor(fb_pixel_t color_text){ ct_col_text = color_text;}; + virtual inline void setTextMode(const int mode){ct_text_mode = mode;};//see textbox.h for possible modes }; #define INFO_BOX_Y_OFFSET 2 @@ -253,7 +253,6 @@ class CComponentsInfoBox : public CComponentsText { private: const char* text; - int text_mode; //see textbox.h for possible modes int x_text, x_offset; CComponentsPicture * pic; @@ -273,11 +272,11 @@ class CComponentsInfoBox : public CComponentsText ~CComponentsInfoBox(); - inline void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; text_mode = mode, ct_font = font_text;}; - inline 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, ct_font = font_text;}; + inline void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; ct_text_mode = mode, ct_font = font_text;}; + inline void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text.c_str(); ct_text_mode = mode, ct_font = font_text;}; void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL); - inline void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes - inline void setTextFont(Font* font_text){ct_font = font_text;}; +// inline void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes +// inline void setTextFont(Font* font_text){ct_font = font_text;}; // inline void setTextColor(fb_pixel_t color_text){ ibox_col_text = color_text;}; inline void setSpaceOffset(const int offset){x_offset = offset;}; inline void setPicture(const std::string& picture_name){pic_name = picture_name;}; diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index 3dd92255e..af001700e 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -367,7 +367,7 @@ CComponentsInfoBox::CComponentsInfoBox() //CComponentsInfoBox initVarInfobox(); text = NULL; - text_mode = CTextBox::AUTO_WIDTH; + ct_text_mode = CTextBox::AUTO_WIDTH; } CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const int w, const int h, @@ -390,7 +390,7 @@ CComponentsInfoBox::CComponentsInfoBox(const int x_pos, const int y_pos, const i //CComponentsInfoBox initVarInfobox(); text = info_text; - text_mode = mode; + ct_text_mode = mode; ct_font = font_text; ct_col_text = color_text; } @@ -420,7 +420,7 @@ void CComponentsInfoBox::initVarInfobox() void CComponentsInfoBox::setText(neutrino_locale_t locale_text, int mode, Font* font_text) { text = g_Locale->getText(locale_text); - text_mode = mode; + ct_text_mode = mode; ct_font = font_text; } @@ -456,7 +456,7 @@ void CComponentsInfoBox::paintText() //init textbox if (ct_textbox == NULL) { - ct_textbox = new CTextBox(text, ct_font, text_mode, ct_box, col_body); + ct_textbox = new CTextBox(text, ct_font, ct_text_mode, ct_box, col_body); ct_textbox->setTextBorderWidth(0); ct_textbox->enableBackgroundPaint(false); }