mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 02:11:11 +02:00
CComponentsText: add possibilty to set font style
Usable with methode setText() and parameter 'style' provided enums are: FONT_STYLE_REGULAR FONT_STYLE_BOLD FONT_STYLE_ITALIC
This commit is contained in:
@@ -45,6 +45,8 @@ class CComponentsText : public CComponentsItem, public CBox
|
||||
CTextBox * ct_textbox;
|
||||
///object: Fontrenderer object
|
||||
Font * ct_font;
|
||||
///property: font style
|
||||
int ct_text_style;
|
||||
|
||||
///property: text color
|
||||
fb_pixel_t ct_col_text;
|
||||
@@ -89,6 +91,12 @@ class CComponentsText : public CComponentsItem, public CBox
|
||||
///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object
|
||||
void paintText(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
public:
|
||||
enum {
|
||||
FONT_STYLE_REGULAR = 0,
|
||||
FONT_STYLE_BOLD = 1,
|
||||
FONT_STYLE_ITALIC = 2
|
||||
};
|
||||
|
||||
CComponentsText( const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50,
|
||||
std::string text = "",
|
||||
const int mode = CTextBox::AUTO_WIDTH,
|
||||
@@ -128,15 +136,15 @@ class CComponentsText : public CComponentsItem, public CBox
|
||||
virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;};
|
||||
|
||||
///set text as string also possible with overloades members for loacales, const char and text file
|
||||
virtual void setText(const std::string& stext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0);
|
||||
virtual void setText(const std::string& stext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR);
|
||||
///set text with const char*
|
||||
virtual void setText(const char* ctext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0);
|
||||
virtual void setText(const char* ctext, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR);
|
||||
///set text from locale
|
||||
virtual void setText(neutrino_locale_t locale_text, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0);
|
||||
virtual void setText(neutrino_locale_t locale_text, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR);
|
||||
///set text from digit, digit is integer
|
||||
virtual void setText(const int digit, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0);
|
||||
virtual void setText(const int digit, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR);
|
||||
///set text directly from a textfile, path as string is required
|
||||
virtual bool setTextFromFile(const std::string& path_to_textfile, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0);
|
||||
virtual bool setTextFromFile(const std::string& path_to_textfile, const int mode = ~CTextBox::AUTO_WIDTH, Font* font_text = NULL, const fb_pixel_t& color_text = 0, const int& style = FONT_STYLE_REGULAR);
|
||||
///get text directly from a textfile, path as string is required
|
||||
virtual std::string getTextFromFile(const std::string& path_to_textfile);
|
||||
///returns current text content of text/label object as std::string
|
||||
|
Reference in New Issue
Block a user