#include <static_text.h>
Public Member Functions | |
StaticText (const EnrichedString &text, bool border, IGUIEnvironment *environment, IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle, bool background=false) | |
constructor | |
virtual | ~StaticText () |
destructor | |
virtual void | draw () |
draws the element and its children | |
virtual void | setOverrideFont (IGUIFont *font=0) |
Sets another skin independent font. | |
virtual IGUIFont * | getOverrideFont () const |
Gets the override font (if any) | |
virtual IGUIFont * | getActiveFont () const |
Get the font which is used right now for drawing. | |
virtual void | setOverrideColor (video::SColor color) |
Sets another color for the text. | |
virtual void | setBackgroundColor (video::SColor color) |
Sets another color for the background. | |
virtual void | setDrawBackground (bool draw) |
Sets whether to draw the background. | |
virtual video::SColor | getBackgroundColor () const |
Gets the background color. | |
virtual bool | isDrawBackgroundEnabled () const |
Checks if background drawing is enabled. | |
virtual void | setDrawBorder (bool draw) |
Sets whether to draw the border. | |
virtual bool | isDrawBorderEnabled () const |
Checks if border drawing is enabled. | |
virtual void | setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) |
Sets alignment mode for text. | |
virtual video::SColor | getOverrideColor () const |
Gets the override color. | |
virtual video::SColor | getActiveColor () const |
Gets the currently used text color. | |
virtual void | enableOverrideColor (bool enable) |
Sets if the static text should use the overide color or the color in the gui skin. | |
virtual bool | isOverrideColorEnabled () const |
Checks if an override color is enabled. | |
virtual void | setTextRestrainedInside (bool restrainedInside) |
Set whether the text in this label should be clipped if it goes outside bounds. | |
virtual bool | isTextRestrainedInside () const |
Checks if the text in this label should be clipped if it goes outside bounds. | |
virtual void | setWordWrap (bool enable) |
Enables or disables word wrap for using the static text as multiline text control. | |
virtual bool | isWordWrapEnabled () const |
Checks if word wrap is enabled. | |
virtual void | setText (const wchar_t *text) |
Sets the new caption of this element. | |
virtual s32 | getTextHeight () const |
Returns the height of the text in pixels when it is drawn. | |
virtual s32 | getTextWidth () const |
Returns the width of the current text, in the current font. | |
virtual void | updateAbsolutePosition () |
Updates the absolute position, splits text if word wrap is enabled. | |
virtual void | setRightToLeft (bool rtl) |
Set whether the string should be interpreted as right-to-left (RTL) text. | |
virtual bool | isRightToLeft () const |
Checks if the text should be interpreted as right-to-left text. | |
virtual bool | hasType (EGUI_ELEMENT_TYPE t) const |
virtual bool | hasType (EGUI_ELEMENT_TYPE t) |
void | setText (const EnrichedString &text) |
Static Public Member Functions | |
static irr::gui::IGUIStaticText * | add (irr::gui::IGUIEnvironment *guienv, const EnrichedString &text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, irr::gui::IGUIElement *parent=NULL, s32 id=-1, bool fillBackground=false) |
static irr::gui::IGUIStaticText * | add (irr::gui::IGUIEnvironment *guienv, std::wstring_view text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, irr::gui::IGUIElement *parent=NULL, s32 id=-1, bool fillBackground=false) |
Private Member Functions | |
void | updateText () |
Breaks the single text line. | |
Private Attributes | |
EGUI_ALIGNMENT | HAlign |
EGUI_ALIGNMENT | VAlign |
bool | Border |
bool | WordWrap |
bool | Background |
bool | RestrainTextInside |
bool | RightToLeft |
gui::IGUIFont * | OverrideFont |
gui::IGUIFont * | LastBreakFont |
EnrichedString | ColoredText |
std::vector< EnrichedString > | BrokenText |
irr::gui::StaticText::StaticText | ( | const EnrichedString & | text, |
bool | border, | ||
IGUIEnvironment * | environment, | ||
IGUIElement * | parent, | ||
s32 | id, | ||
const core::rect< s32 > & | rectangle, | ||
bool | background = false ) |
|
virtual |
destructor
References OverrideFont.
|
inlinestatic |
References guienv.
Referenced by GUIButton::GUIButton(), GUIEngine::GUIEngine(), add(), GUIFormSpecMenu::createTextField(), RenderingEngine::draw_load_screen(), GameUI::init(), GUIKeyChangeMenu::OnEvent(), GUIFormSpecMenu::parseLabel(), GUIFormSpecMenu::parsePwdField(), GUIFormSpecMenu::parseVertLabel(), GUIFormSpecMenu::regenerateGui(), GUIKeyChangeMenu::regenerateGui(), GUIOpenURLMenu::regenerateGui(), GUIPasswordChange::regenerateGui(), GUIVolumeChange::regenerateGui(), and GUIEngine::updateTopLeftTextSize().
|
inlinestatic |
|
virtual |
draws the element and its children
References Background, Border, BrokenText, irr::gui::CGUITTFont::draw(), getActiveFont(), getBackgroundColor(), getTextWidth(), HAlign, LastBreakFont, RestrainTextInside, updateText(), VAlign, and WordWrap.
Referenced by setDrawBackground(), and setDrawBorder().
|
virtual |
Sets if the static text should use the overide color or the color in the gui skin.
|
virtual |
Gets the currently used text color.
References getOverrideColor().
|
virtual |
Get the font which is used right now for drawing.
References OverrideFont.
Referenced by draw(), getTextHeight(), getTextWidth(), and updateText().
|
virtual |
Gets the background color.
References ColoredText, EnrichedString::getBackground(), and EnrichedString::hasBackground().
Referenced by draw().
|
virtual |
Gets the override color.
References ColoredText, and EnrichedString::getDefaultColor().
Referenced by getActiveColor(), and setText().
|
virtual |
Gets the override font (if any)
References OverrideFont.
|
virtual |
Returns the height of the text in pixels when it is drawn.
References BrokenText, getActiveFont(), and WordWrap.
|
virtual |
Returns the width of the current text, in the current font.
References BrokenText, and getActiveFont().
Referenced by draw().
|
inlinevirtual |
References irr::gui::EGUIET_ENRICHED_STATIC_TEXT.
|
inlinevirtual |
References irr::gui::EGUIET_ENRICHED_STATIC_TEXT.
|
virtual |
Checks if background drawing is enabled.
References Background.
|
virtual |
Checks if border drawing is enabled.
References Border.
|
virtual |
Checks if an override color is enabled.
|
virtual |
Checks if the text should be interpreted as right-to-left text.
References RightToLeft.
|
virtual |
Checks if the text in this label should be clipped if it goes outside bounds.
References RestrainTextInside.
|
virtual |
Checks if word wrap is enabled.
References WordWrap.
|
virtual |
Sets another color for the background.
Sets another color for the text.
References Background, ColoredText, and EnrichedString::setBackground().
Referenced by updateText().
|
virtual |
Sets whether to draw the background.
References Background, and draw().
Referenced by updateText().
|
virtual |
|
virtual |
Sets another color for the text.
References ColoredText, EnrichedString::setDefaultColor(), and updateText().
Referenced by GUIButton::setOverrideColor().
|
virtual |
Sets another skin independent font.
References OverrideFont, and updateText().
Referenced by GUIButton::setOverrideFont().
|
virtual |
Set whether the string should be interpreted as right-to-left (RTL) text.
References RightToLeft, and updateText().
void irr::gui::StaticText::setText | ( | const EnrichedString & | text | ) |
References EnrichedString::c_str(), ColoredText, and updateText().
|
virtual |
Sets the new caption of this element.
References getOverrideColor(), and setText().
Referenced by StaticText(), setStaticText(), GUIButton::setText(), and setText().
|
virtual |
Sets alignment mode for text.
References HAlign, and VAlign.
Referenced by GUIButton::GUIButton().
|
virtual |
Set whether the text in this label should be clipped if it goes outside bounds.
References RestrainTextInside.
|
virtual |
Enables or disables word wrap for using the static text as multiline text control.
References updateText(), and WordWrap.
|
virtual |
Updates the absolute position, splits text if word wrap is enabled.
References updateText().
|
private |
Breaks the single text line.
References EnrichedString::addChar(), EnrichedString::addCharNoColor(), Border, BrokenText, EnrichedString::c_str(), EnrichedString::clear(), ColoredText, getActiveFont(), EnrichedString::getBackground(), EnrichedString::getString(), EnrichedString::hasBackground(), LastBreakFont, RightToLeft, setBackgroundColor(), setDrawBackground(), EnrichedString::size(), EnrichedString::substr(), and WordWrap.
Referenced by draw(), setOverrideColor(), setOverrideFont(), setRightToLeft(), setText(), setWordWrap(), and updateAbsolutePosition().
|
private |
Referenced by draw(), isDrawBackgroundEnabled(), setBackgroundColor(), and setDrawBackground().
|
private |
Referenced by draw(), isDrawBorderEnabled(), setDrawBorder(), and updateText().
|
private |
Referenced by draw(), getTextHeight(), getTextWidth(), and updateText().
|
private |
Referenced by getBackgroundColor(), getOverrideColor(), setBackgroundColor(), setOverrideColor(), setText(), and updateText().
|
private |
Referenced by draw(), and setTextAlignment().
|
private |
Referenced by draw(), and updateText().
|
private |
Referenced by ~StaticText(), getActiveFont(), getOverrideFont(), and setOverrideFont().
|
private |
Referenced by draw(), isTextRestrainedInside(), and setTextRestrainedInside().
|
private |
Referenced by isRightToLeft(), setRightToLeft(), and updateText().
|
private |
Referenced by draw(), and setTextAlignment().
|
private |
Referenced by draw(), getTextHeight(), isWordWrapEnabled(), setWordWrap(), and updateText().