TGUI  v0.7.5
tgui::TextBoxRenderer Class Reference
Inheritance diagram for tgui::TextBoxRenderer:
tgui::WidgetRenderer tgui::WidgetBorders tgui::WidgetPadding

Public Member Functions

 TextBoxRenderer (TextBox *textBox)
 Constructor. More...
 
virtual void setProperty (std::string property, const std::string &value) override
 Change a property of the renderer. More...
 
virtual void setProperty (std::string property, ObjectConverter &&value) override
 Change a property of the renderer. More...
 
virtual ObjectConverter getProperty (std::string property) const override
 Retrieve the value of a certain property. More...
 
virtual std::map< std::string, ObjectConvertergetPropertyValuePairs () const override
 Get a map with all properties and their values. More...
 
void setBackgroundColor (const Color &backgroundColor)
 Set the background color that will be used inside the text box. More...
 
void setTextColor (const Color &textColor)
 Set the text color that will be used inside the text box. More...
 
void setSelectedTextColor (const Color &selectedTextColor)
 Set the text color of the selected text that will be used inside the text box. More...
 
void setSelectedTextBackgroundColor (const Color &selectedTextBackgroundColor)
 Set the background color of the selected text that will be used inside the text box. More...
 
void setBorderColor (const Color &borderColor)
 Set the border color that will be used inside the text box. More...
 
void setCaretColor (const Color &caretColor)
 Set the color that will be used inside the text box for the blinking caret. More...
 
void setCaretWidth (float width)
 This will change the width of the blinking caret. More...
 
void setBackgroundTexture (const Texture &texture)
 Changes the background image. More...
 
virtual void setPadding (const Padding &padding) override
 Changes the padding of the text box. More...
 
void setScrollbar (const std::string &scrollbarThemeFileFilename="", const std::string &section="Scrollbar")
 Changes the scrollbar of the text box. More...
 
- Public Member Functions inherited from tgui::WidgetRenderer
virtual ~WidgetRenderer ()
 Virtual destructor.
 
- Public Member Functions inherited from tgui::WidgetBorders
virtual void setBorders (const Borders &borders)
 Changes the size of the borders. More...
 
void setBorders (float leftBorder, float topBorder, float rightBorder, float bottomBorder)
 Changes the size of the borders. More...
 
void setBorders (float width, float height)
 Changes the size of the borders. More...
 
virtual Borders getBorders () const
 Returns the size of the borders as a tgui::Borders. More...
 
- Public Member Functions inherited from tgui::WidgetPadding
void setPadding (float leftPadding, float topPadding, float rightPadding, float bottomPadding)
 Changes the size of the padding. More...
 
void setPadding (float width, float height)
 Changes the size of the padding. More...
 
virtual Padding getPadding () const
 Returns the size of the padding. More...
 

Constructor & Destructor Documentation

◆ TextBoxRenderer()

tgui::TextBoxRenderer::TextBoxRenderer ( TextBox textBox)
inline

Constructor.

Parameters
textBoxThe text box that is connected to the renderer

Member Function Documentation

◆ getProperty()

virtual ObjectConverter tgui::TextBoxRenderer::getProperty ( std::string  property) const
overridevirtual

Retrieve the value of a certain property.

Parameters
propertyThe property that you would like to retrieve
Returns
The value inside a ObjectConverter object which you can extract with the correct get function or an ObjectConverter object with type ObjectConverter::Type::None when the property did not exist.

Reimplemented from tgui::WidgetRenderer.

◆ getPropertyValuePairs()

virtual std::map<std::string, ObjectConverter> tgui::TextBoxRenderer::getPropertyValuePairs ( ) const
overridevirtual

Get a map with all properties and their values.

Returns
Property-value pairs of the renderer

Reimplemented from tgui::WidgetRenderer.

◆ setBackgroundColor()

void tgui::TextBoxRenderer::setBackgroundColor ( const Color backgroundColor)

Set the background color that will be used inside the text box.

Parameters
backgroundColorThe new background color.

◆ setBackgroundTexture()

void tgui::TextBoxRenderer::setBackgroundTexture ( const Texture texture)

Changes the background image.

Parameters
textureNew background texture

When this image is set, the background color property will be ignored. Pass an empty string to unset the image, in this case the background color property will be used again.

◆ setBorderColor()

void tgui::TextBoxRenderer::setBorderColor ( const Color borderColor)

Set the border color that will be used inside the text box.

Parameters
borderColorThe color of the borders

◆ setCaretColor()

void tgui::TextBoxRenderer::setCaretColor ( const Color caretColor)

Set the color that will be used inside the text box for the blinking caret.

Parameters
caretColorThe color of the blinking caret

◆ setCaretWidth()

void tgui::TextBoxRenderer::setCaretWidth ( float  width)

This will change the width of the blinking caret.

Parameters
widthNew width of the caret

◆ setPadding()

virtual void tgui::TextBoxRenderer::setPadding ( const Padding padding)
overridevirtual

Changes the padding of the text box.

This padding will be scaled together with the background image. If there is no background image, or when 9-slice scaling is used, the padding will be exactly what you pass here.

Parameters
paddingThe padding width and height

Reimplemented from tgui::WidgetPadding.

◆ setProperty() [1/2]

virtual void tgui::TextBoxRenderer::setProperty ( std::string  property,
const std::string &  value 
)
overridevirtual

Change a property of the renderer.

Parameters
propertyThe property that you would like to change
valueThe new serialized value that you like to assign to the property
Exceptions
Exceptionwhen deserialization fails or when the widget does not have this property.
Exceptionwhen loading scrollbar fails with the theme connected to the list box

Reimplemented from tgui::WidgetRenderer.

◆ setProperty() [2/2]

virtual void tgui::TextBoxRenderer::setProperty ( std::string  property,
ObjectConverter &&  value 
)
overridevirtual

Change a property of the renderer.

Parameters
propertyThe property that you would like to change
valueThe new value that you like to assign to the property. The ObjectConverter is implicitly constructed from the possible value types.
Exceptions
Exceptionfor unknown properties or when value was of a wrong type.
Exceptionwhen loading scrollbar fails with the theme connected to the list box

Reimplemented from tgui::WidgetRenderer.

◆ setScrollbar()

void tgui::TextBoxRenderer::setScrollbar ( const std::string &  scrollbarThemeFileFilename = "",
const std::string &  section = "Scrollbar" 
)

Changes the scrollbar of the text box.

Parameters
scrollbarThemeFileFilenameFilename of the theme file.
sectionThe section to look for inside the theme file.
Exceptions
Exceptionwhen the theme file could not be opened.
Exceptionwhen the theme file did not contain the requested section with the needed information.
Exceptionwhen one of the images, described in the theme file, could not be loaded.

When an empty string is passed as filename, the built-in white theme will be used.

◆ setSelectedTextBackgroundColor()

void tgui::TextBoxRenderer::setSelectedTextBackgroundColor ( const Color selectedTextBackgroundColor)

Set the background color of the selected text that will be used inside the text box.

Parameters
selectedTextBackgroundColorThe new background color.

◆ setSelectedTextColor()

void tgui::TextBoxRenderer::setSelectedTextColor ( const Color selectedTextColor)

Set the text color of the selected text that will be used inside the text box.

Parameters
selectedTextColorThe new text color.

◆ setTextColor()

void tgui::TextBoxRenderer::setTextColor ( const Color textColor)

Set the text color that will be used inside the text box.

Parameters
textColorThe new text color.

The documentation for this class was generated from the following file: