#include <mmslabelwidget.h>
Public Member Functions | |
MMSLabelWidget (MMSWindow *root, string className, MMSTheme *theme=NULL) | |
~MMSLabelWidget () | |
MMSWidget * | copyWidget () |
int | getStringWidth (const char *text=NULL) |
string | getFontPath () |
string | getFontName (MMSLanguage lang=MMSLANG_NONE) |
unsigned int | getFontSize () |
MMSALIGNMENT | getAlignment () |
MMSFBColor | getColor () |
MMSFBColor | getSelColor () |
MMSFBColor | getColor_p () |
MMSFBColor | getSelColor_p () |
MMSFBColor | getColor_i () |
MMSFBColor | getSelColor_i () |
string | getText () |
void | getText (string &text) |
bool | getSlidable () |
unsigned char | getSlideSpeed () |
bool | getTranslate () |
MMSFBColor | getShadowColor (MMSPOSITION position) |
MMSFBColor | getSelShadowColor (MMSPOSITION position) |
void | setFontPath (string fontpath, bool load=true, bool refresh=true) |
void | setFontName (MMSLanguage lang, string fontname, bool load=true, bool refresh=true) |
void | setFontName (string fontname, bool load=true, bool refresh=true) |
void | setFontSize (unsigned int fontsize, bool load=true, bool refresh=true) |
void | setFont (MMSLanguage lang, string fontpath, string fontname, unsigned int fontsize, bool load=true, bool refresh=true) |
void | setFont (string fontpath, string fontname, unsigned int fontsize, bool load=true, bool refresh=true) |
void | setAlignment (MMSALIGNMENT alignment, bool refresh=true) |
void | setColor (MMSFBColor color, bool refresh=true) |
void | setSelColor (MMSFBColor selcolor, bool refresh=true) |
void | setColor_p (MMSFBColor color_p, bool refresh=true) |
void | setSelColor_p (MMSFBColor selcolor_p, bool refresh=true) |
void | setColor_i (MMSFBColor color_i, bool refresh=true) |
void | setSelColor_i (MMSFBColor selcolor_i, bool refresh=true) |
void | setText (string text, bool refresh=true) |
void | setSlidable (bool slidable) |
void | setSlideSpeed (unsigned char slidespeed) |
void | setTranslate (bool translate, bool refresh=true) |
void | setShadowColor (MMSPOSITION position, MMSFBColor color, bool refresh=true) |
void | setSelShadowColor (MMSPOSITION position, MMSFBColor selcolor, bool refresh=true) |
void | updateFromThemeClass (MMSLabelWidgetClass *themeClass) |
Private Member Functions | |
bool | create (MMSWindow *root, string className, MMSTheme *theme) |
void | initLanguage (MMSLabelWidget *widget=NULL) |
void | loadFont (MMSLabelWidget *widget=NULL) |
bool | init () |
bool | release () |
bool | prepareText (int *width, int *height, bool recalc=false) |
void | calcContentSize () |
Internal method: Should be overridden by widgets which have a dynamic size based on content. | |
void | getForeground (MMSFBColor *color) |
bool | enableRefresh (bool enable=true) |
Internal method: (re-)enable refresh status. | |
bool | checkRefreshStatus () |
Internal method: check drawn background against new background and (re-)enable refresh status if needed. | |
bool | draw (bool *backgroundFilled=NULL) |
void | targetLangChanged (MMSLanguage lang) |
Internal method: Inform the widget, that the language has changed. | |
Private Attributes | |
string | className |
MMSLabelWidgetClass * | labelWidgetClass |
MMSLabelWidgetClass | myLabelWidgetClass |
MMSLanguage | lang |
language in which the text is to be translated | |
MMSFBFont * | font |
loaded font | |
string | fontpath |
path to the loaded font file | |
string | fontname |
name of the loaded font file | |
unsigned int | fontsize |
requested size of the font | |
bool | load_font |
have to (re)load font? | |
int | slide_width |
int | slide_offset |
unsigned int | frame_delay |
unsigned int | frame_delay_set |
class MMSLabelWidgetThread * | labelThread |
string | translated_text |
the translated text will be stored here, this is used in the draw() method | |
bool | translated |
if true the translated_text is valid | |
bool | swap_left_right |
swap left-right alignment | |
bool | current_fgset |
current foreground values set? | |
MMSFBColor | current_fgcolor |
current foreground color | |
Friends | |
class | MMSWindow |
class | MMSLabelWidgetThread |
You can display one line of text. If you want to have more the one line, you should use the MMSTextBox widget. The label widget cannot be focused.
Definition at line 45 of file mmslabelwidget.h.
Definition at line 37 of file mmslabelwidget.cpp.
MMSLabelWidget::~MMSLabelWidget | ( | ) |
Definition at line 41 of file mmslabelwidget.cpp.
Definition at line 48 of file mmslabelwidget.cpp.
void MMSLabelWidget::initLanguage | ( | MMSLabelWidget * | widget = NULL |
) | [private] |
Definition at line 122 of file mmslabelwidget.cpp.
void MMSLabelWidget::loadFont | ( | MMSLabelWidget * | widget = NULL |
) | [private] |
Definition at line 128 of file mmslabelwidget.cpp.
bool MMSLabelWidget::init | ( | ) | [private, virtual] |
bool MMSLabelWidget::release | ( | ) | [private, virtual] |
bool MMSLabelWidget::prepareText | ( | int * | width, | |
int * | height, | |||
bool | recalc = false | |||
) | [private] |
Definition at line 182 of file mmslabelwidget.cpp.
void MMSLabelWidget::calcContentSize | ( | ) | [private, virtual] |
Internal method: Should be overridden by widgets which have a dynamic size based on content.
Reimplemented from MMSWidget.
Definition at line 284 of file mmslabelwidget.cpp.
void MMSLabelWidget::getForeground | ( | MMSFBColor * | color | ) | [private] |
Definition at line 294 of file mmslabelwidget.cpp.
bool MMSLabelWidget::enableRefresh | ( | bool | enable = true |
) | [private, virtual] |
Internal method: (re-)enable refresh status.
Reimplemented from MMSWidget.
Definition at line 326 of file mmslabelwidget.cpp.
bool MMSLabelWidget::checkRefreshStatus | ( | ) | [private, virtual] |
Internal method: check drawn background against new background and (re-)enable refresh status if needed.
Reimplemented from MMSWidget.
Definition at line 335 of file mmslabelwidget.cpp.
bool MMSLabelWidget::draw | ( | bool * | backgroundFilled = NULL |
) | [private, virtual] |
void MMSLabelWidget::targetLangChanged | ( | MMSLanguage | lang | ) | [private] |
Internal method: Inform the widget, that the language has changed.
Definition at line 462 of file mmslabelwidget.cpp.
MMSWidget * MMSLabelWidget::copyWidget | ( | ) | [virtual] |
int MMSLabelWidget::getStringWidth | ( | const char * | text = NULL |
) |
Definition at line 473 of file mmslabelwidget.cpp.
string MMSLabelWidget::getFontPath | ( | ) |
Definition at line 517 of file mmslabelwidget.cpp.
string MMSLabelWidget::getFontName | ( | MMSLanguage | lang = MMSLANG_NONE |
) |
Definition at line 521 of file mmslabelwidget.cpp.
unsigned int MMSLabelWidget::getFontSize | ( | ) |
Definition at line 525 of file mmslabelwidget.cpp.
MMSALIGNMENT MMSLabelWidget::getAlignment | ( | ) |
Definition at line 529 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getColor | ( | ) |
Definition at line 533 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getSelColor | ( | ) |
Definition at line 537 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getColor_p | ( | ) |
Definition at line 541 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getSelColor_p | ( | ) |
Definition at line 545 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getColor_i | ( | ) |
Definition at line 549 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getSelColor_i | ( | ) |
Definition at line 553 of file mmslabelwidget.cpp.
string MMSLabelWidget::getText | ( | ) |
Definition at line 557 of file mmslabelwidget.cpp.
void MMSLabelWidget::getText | ( | string & | text | ) |
Definition at line 561 of file mmslabelwidget.cpp.
bool MMSLabelWidget::getSlidable | ( | ) |
Definition at line 565 of file mmslabelwidget.cpp.
unsigned char MMSLabelWidget::getSlideSpeed | ( | ) |
Definition at line 569 of file mmslabelwidget.cpp.
bool MMSLabelWidget::getTranslate | ( | ) |
Definition at line 573 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getShadowColor | ( | MMSPOSITION | position | ) |
Definition at line 578 of file mmslabelwidget.cpp.
MMSFBColor MMSLabelWidget::getSelShadowColor | ( | MMSPOSITION | position | ) |
Definition at line 582 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFontPath | ( | string | fontpath, | |
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 591 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFontName | ( | MMSLanguage | lang, | |
string | fontname, | |||
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 604 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFontName | ( | string | fontname, | |
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 617 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFontSize | ( | unsigned int | fontsize, | |
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 621 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFont | ( | MMSLanguage | lang, | |
string | fontpath, | |||
string | fontname, | |||
unsigned int | fontsize, | |||
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 634 of file mmslabelwidget.cpp.
void MMSLabelWidget::setFont | ( | string | fontpath, | |
string | fontname, | |||
unsigned int | fontsize, | |||
bool | load = true , |
|||
bool | refresh = true | |||
) |
Definition at line 649 of file mmslabelwidget.cpp.
void MMSLabelWidget::setAlignment | ( | MMSALIGNMENT | alignment, | |
bool | refresh = true | |||
) |
Definition at line 653 of file mmslabelwidget.cpp.
void MMSLabelWidget::setColor | ( | MMSFBColor | color, | |
bool | refresh = true | |||
) |
Definition at line 662 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSelColor | ( | MMSFBColor | selcolor, | |
bool | refresh = true | |||
) |
Definition at line 671 of file mmslabelwidget.cpp.
void MMSLabelWidget::setColor_p | ( | MMSFBColor | color_p, | |
bool | refresh = true | |||
) |
Definition at line 680 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSelColor_p | ( | MMSFBColor | selcolor_p, | |
bool | refresh = true | |||
) |
Definition at line 689 of file mmslabelwidget.cpp.
void MMSLabelWidget::setColor_i | ( | MMSFBColor | color_i, | |
bool | refresh = true | |||
) |
Definition at line 698 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSelColor_i | ( | MMSFBColor | selcolor_i, | |
bool | refresh = true | |||
) |
Definition at line 707 of file mmslabelwidget.cpp.
void MMSLabelWidget::setText | ( | string | text, | |
bool | refresh = true | |||
) |
Definition at line 717 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSlidable | ( | bool | slidable | ) |
Definition at line 727 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSlideSpeed | ( | unsigned char | slidespeed | ) |
Definition at line 756 of file mmslabelwidget.cpp.
void MMSLabelWidget::setTranslate | ( | bool | translate, | |
bool | refresh = true | |||
) |
Definition at line 762 of file mmslabelwidget.cpp.
void MMSLabelWidget::setShadowColor | ( | MMSPOSITION | position, | |
MMSFBColor | color, | |||
bool | refresh = true | |||
) |
Definition at line 774 of file mmslabelwidget.cpp.
void MMSLabelWidget::setSelShadowColor | ( | MMSPOSITION | position, | |
MMSFBColor | selcolor, | |||
bool | refresh = true | |||
) |
Definition at line 783 of file mmslabelwidget.cpp.
void MMSLabelWidget::updateFromThemeClass | ( | MMSLabelWidgetClass * | themeClass | ) |
Definition at line 794 of file mmslabelwidget.cpp.
friend class MMSWindow [friend] |
friend class MMSLabelWidgetThread [friend] |
Definition at line 165 of file mmslabelwidget.h.
string MMSLabelWidget::className [private] |
Definition at line 48 of file mmslabelwidget.h.
Definition at line 49 of file mmslabelwidget.h.
Definition at line 50 of file mmslabelwidget.h.
MMSLanguage MMSLabelWidget::lang [private] |
MMSFBFont* MMSLabelWidget::font [private] |
string MMSLabelWidget::fontpath [private] |
string MMSLabelWidget::fontname [private] |
unsigned int MMSLabelWidget::fontsize [private] |
bool MMSLabelWidget::load_font [private] |
int MMSLabelWidget::slide_width [private] |
Definition at line 71 of file mmslabelwidget.h.
int MMSLabelWidget::slide_offset [private] |
Definition at line 72 of file mmslabelwidget.h.
unsigned int MMSLabelWidget::frame_delay [private] |
Definition at line 74 of file mmslabelwidget.h.
unsigned int MMSLabelWidget::frame_delay_set [private] |
Definition at line 75 of file mmslabelwidget.h.
class MMSLabelWidgetThread* MMSLabelWidget::labelThread [private] |
Definition at line 77 of file mmslabelwidget.h.
string MMSLabelWidget::translated_text [private] |
the translated text will be stored here, this is used in the draw() method
Definition at line 80 of file mmslabelwidget.h.
bool MMSLabelWidget::translated [private] |
bool MMSLabelWidget::swap_left_right [private] |
bool MMSLabelWidget::current_fgset [private] |
MMSFBColor MMSLabelWidget::current_fgcolor [private] |