#include <mmstextboxwidget.h>

Public Member Functions | |
| MMSTextBoxWidget (MMSWindow *root, string className, MMSTheme *theme=NULL) | |
| ~MMSTextBoxWidget () | |
| MMSWidget * | copyWidget () |
| bool | reloadFile () |
| reload the file and display it in the textbox | |
| string | getFontPath () |
| string | getFontName (MMSLanguage lang=MMSLANG_NONE) |
| unsigned int | getFontSize () |
| MMSALIGNMENT | getAlignment () |
| bool | getWrap () |
| bool | getSplitWords () |
| MMSFBColor | getColor () |
| MMSFBColor | getSelColor () |
| MMSFBColor | getColor_p () |
| MMSFBColor | getSelColor_p () |
| MMSFBColor | getColor_i () |
| MMSFBColor | getSelColor_i () |
| string | getText () |
| void | getText (string &text) |
| bool | getTranslate () |
| string | getFilePath () |
| string | getFileName () |
| 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 | setWrap (bool wrap, bool refresh=true) |
| void | setSplitWords (bool splitwords, 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 | setText (string text, bool refresh=true) |
| void | setTranslate (bool translate, bool refresh=true) |
| void | setFilePath (string filepath, bool load=true, bool refresh=true) |
| void | setFileName (string filename, bool load=true, bool refresh=true) |
| void | setShadowColor (MMSPOSITION position, MMSFBColor color, bool refresh=true) |
| void | setSelShadowColor (MMSPOSITION position, MMSFBColor selcolor, bool refresh=true) |
| void | updateFromThemeClass (MMSTextBoxWidgetClass *themeClass) |
Private Member Functions | |
| bool | create (MMSWindow *root, string className, MMSTheme *theme) |
| void | initLanguage (MMSTextBoxWidget *widget=NULL) |
| void | loadFont (MMSTextBoxWidget *widget=NULL) |
| bool | setSurfaceGeometry (unsigned int width=0, unsigned int height=0) |
| bool | calcWordGeom (string &text, unsigned int startWidth, unsigned int startHeight, unsigned int *realWidth, unsigned int *realHeight, unsigned int *scrollDX, unsigned int *scrollDY, unsigned int *lines, unsigned int *paragraphs, bool wrap=true, bool splitwords=true, MMSALIGNMENT alignment=MMSALIGNMENT_CENTER, unsigned int *minWidth=NULL, unsigned int *minHeight=NULL, bool force_recalc=false) |
| 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. | |
| bool | loadFile (bool refresh) |
Private Attributes | |
| string | className |
| MMSTextBoxWidgetClass * | textBoxWidgetClass |
| MMSTextBoxWidgetClass | myTextBoxWidgetClass |
| 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? | |
| vector< TEXTBOX_WORDGEOM * > | wordgeom |
| string | lasttext |
| bool | surfaceChanged |
| 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 | |
| MMSFile * | file |
| used to load text from a file | |
| bool | current_fgset |
| current foreground values set? | |
| MMSFBColor | current_fgcolor |
| current foreground color | |
Friends | |
| class | MMSWindow |
Classes | |
| struct | TEXTBOX_WORDGEOM |
The textbox is focusable. So the user can scroll in it. Line breaks will be done with the normal line feed (
(0x0a)). Specify as line feed within XML. If you want to display only one line of static text, you should use the MMSLabel widget.
Definition at line 46 of file mmstextboxwidget.h.
Definition at line 37 of file mmstextboxwidget.cpp.
| MMSTextBoxWidget::~MMSTextBoxWidget | ( | ) |
Definition at line 41 of file mmstextboxwidget.cpp.
Definition at line 50 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::initLanguage | ( | MMSTextBoxWidget * | widget = NULL |
) | [private] |
Definition at line 120 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::loadFont | ( | MMSTextBoxWidget * | widget = NULL |
) | [private] |
Definition at line 126 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::setSurfaceGeometry | ( | unsigned int | width = 0, |
|
| unsigned int | height = 0 | |||
| ) | [private, virtual] |
| bool MMSTextBoxWidget::calcWordGeom | ( | string & | text, | |
| unsigned int | startWidth, | |||
| unsigned int | startHeight, | |||
| unsigned int * | realWidth, | |||
| unsigned int * | realHeight, | |||
| unsigned int * | scrollDX, | |||
| unsigned int * | scrollDY, | |||
| unsigned int * | lines, | |||
| unsigned int * | paragraphs, | |||
| bool | wrap = true, |
|||
| bool | splitwords = true, |
|||
| MMSALIGNMENT | alignment = MMSALIGNMENT_CENTER, |
|||
| unsigned int * | minWidth = NULL, |
|||
| unsigned int * | minHeight = NULL, |
|||
| bool | force_recalc = false | |||
| ) | [private] |
Definition at line 173 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::init | ( | ) | [private, virtual] |
| bool MMSTextBoxWidget::release | ( | ) | [private, virtual] |
| bool MMSTextBoxWidget::prepareText | ( | int * | width, | |
| int * | height, | |||
| bool | recalc = false | |||
| ) | [private] |
Definition at line 519 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::calcContentSize | ( | ) | [private, virtual] |
Internal method: Should be overridden by widgets which have a dynamic size based on content.
Reimplemented from MMSWidget.
Definition at line 653 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::getForeground | ( | MMSFBColor * | color | ) | [private] |
Definition at line 663 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::enableRefresh | ( | bool | enable = true |
) | [private, virtual] |
Internal method: (re-)enable refresh status.
Reimplemented from MMSWidget.
Definition at line 695 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::checkRefreshStatus | ( | ) | [private, virtual] |
Internal method: check drawn background against new background and (re-)enable refresh status if needed.
Reimplemented from MMSWidget.
Definition at line 704 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::draw | ( | bool * | backgroundFilled = NULL |
) | [private, virtual] |
| void MMSTextBoxWidget::targetLangChanged | ( | MMSLanguage | lang | ) | [private] |
Internal method: Inform the widget, that the language has changed.
Definition at line 802 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::loadFile | ( | bool | refresh | ) | [private] |
Definition at line 811 of file mmstextboxwidget.cpp.
| MMSWidget * MMSTextBoxWidget::copyWidget | ( | ) | [virtual] |
| bool MMSTextBoxWidget::reloadFile | ( | ) |
| string MMSTextBoxWidget::getFontPath | ( | ) |
Definition at line 884 of file mmstextboxwidget.cpp.
| string MMSTextBoxWidget::getFontName | ( | MMSLanguage | lang = MMSLANG_NONE |
) |
Definition at line 888 of file mmstextboxwidget.cpp.
| unsigned int MMSTextBoxWidget::getFontSize | ( | ) |
Definition at line 892 of file mmstextboxwidget.cpp.
| MMSALIGNMENT MMSTextBoxWidget::getAlignment | ( | ) |
Definition at line 896 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::getWrap | ( | ) |
Definition at line 900 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::getSplitWords | ( | ) |
Definition at line 904 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getColor | ( | ) |
Definition at line 908 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getSelColor | ( | ) |
Definition at line 912 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getColor_p | ( | ) |
Definition at line 916 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getSelColor_p | ( | ) |
Definition at line 920 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getColor_i | ( | ) |
Definition at line 924 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getSelColor_i | ( | ) |
Definition at line 928 of file mmstextboxwidget.cpp.
| string MMSTextBoxWidget::getText | ( | ) |
Definition at line 932 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::getText | ( | string & | text | ) |
Definition at line 936 of file mmstextboxwidget.cpp.
| bool MMSTextBoxWidget::getTranslate | ( | ) |
Definition at line 940 of file mmstextboxwidget.cpp.
| string MMSTextBoxWidget::getFilePath | ( | ) |
Definition at line 944 of file mmstextboxwidget.cpp.
| string MMSTextBoxWidget::getFileName | ( | ) |
Definition at line 948 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getShadowColor | ( | MMSPOSITION | position | ) |
Definition at line 952 of file mmstextboxwidget.cpp.
| MMSFBColor MMSTextBoxWidget::getSelShadowColor | ( | MMSPOSITION | position | ) |
Definition at line 956 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFontPath | ( | string | fontpath, | |
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 964 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFontName | ( | MMSLanguage | lang, | |
| string | fontname, | |||
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 977 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFontName | ( | string | fontname, | |
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 990 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFontSize | ( | unsigned int | fontsize, | |
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 994 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFont | ( | MMSLanguage | lang, | |
| string | fontpath, | |||
| string | fontname, | |||
| unsigned int | fontsize, | |||
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 1007 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFont | ( | string | fontpath, | |
| string | fontname, | |||
| unsigned int | fontsize, | |||
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 1022 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setAlignment | ( | MMSALIGNMENT | alignment, | |
| bool | refresh = true | |||
| ) |
Definition at line 1026 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setWrap | ( | bool | wrap, | |
| bool | refresh = true | |||
| ) |
Definition at line 1035 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setSplitWords | ( | bool | splitwords, | |
| bool | refresh = true | |||
| ) |
Definition at line 1044 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setColor | ( | MMSFBColor | color, | |
| bool | refresh = true | |||
| ) |
Definition at line 1053 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setSelColor | ( | MMSFBColor | selcolor, | |
| bool | refresh = true | |||
| ) |
Definition at line 1062 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setColor_p | ( | MMSFBColor | color_p, | |
| bool | refresh = true | |||
| ) |
Definition at line 1071 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setSelColor_p | ( | MMSFBColor | selcolor_p, | |
| bool | refresh = true | |||
| ) |
Definition at line 1080 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setColor_i | ( | MMSFBColor | color_i, | |
| bool | refresh = true | |||
| ) |
Definition at line 1089 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setSelColor_i | ( | MMSFBColor | selcolor_i, | |
| bool | refresh = true | |||
| ) |
Definition at line 1098 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setText | ( | string * | text, | |
| bool | refresh = true | |||
| ) |
Definition at line 1108 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setText | ( | string | text, | |
| bool | refresh = true | |||
| ) |
Definition at line 1120 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setTranslate | ( | bool | translate, | |
| bool | refresh = true | |||
| ) |
Definition at line 1124 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFilePath | ( | string | filepath, | |
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 1134 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setFileName | ( | string | filename, | |
| bool | load = true, |
|||
| bool | refresh = true | |||
| ) |
Definition at line 1145 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setShadowColor | ( | MMSPOSITION | position, | |
| MMSFBColor | color, | |||
| bool | refresh = true | |||
| ) |
Definition at line 1156 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::setSelShadowColor | ( | MMSPOSITION | position, | |
| MMSFBColor | selcolor, | |||
| bool | refresh = true | |||
| ) |
Definition at line 1165 of file mmstextboxwidget.cpp.
| void MMSTextBoxWidget::updateFromThemeClass | ( | MMSTextBoxWidgetClass * | themeClass | ) |
Definition at line 1175 of file mmstextboxwidget.cpp.
friend class MMSWindow [friend] |
string MMSTextBoxWidget::className [private] |
Definition at line 55 of file mmstextboxwidget.h.
Definition at line 56 of file mmstextboxwidget.h.
Definition at line 57 of file mmstextboxwidget.h.
MMSLanguage MMSTextBoxWidget::lang [private] |
MMSFBFont* MMSTextBoxWidget::font [private] |
string MMSTextBoxWidget::fontpath [private] |
string MMSTextBoxWidget::fontname [private] |
unsigned int MMSTextBoxWidget::fontsize [private] |
bool MMSTextBoxWidget::load_font [private] |
vector<TEXTBOX_WORDGEOM *> MMSTextBoxWidget::wordgeom [private] |
Definition at line 78 of file mmstextboxwidget.h.
string MMSTextBoxWidget::lasttext [private] |
Definition at line 80 of file mmstextboxwidget.h.
bool MMSTextBoxWidget::surfaceChanged [private] |
Definition at line 81 of file mmstextboxwidget.h.
string MMSTextBoxWidget::translated_text [private] |
the translated text will be stored here, this is used in the draw() method
Definition at line 84 of file mmstextboxwidget.h.
bool MMSTextBoxWidget::translated [private] |
bool MMSTextBoxWidget::swap_left_right [private] |
MMSFile* MMSTextBoxWidget::file [private] |
bool MMSTextBoxWidget::current_fgset [private] |
MMSFBColor MMSTextBoxWidget::current_fgcolor [private] |