TGUI  0.7.8
tgui::EditBoxRenderer Class Reference
Inheritance diagram for tgui::EditBoxRenderer:
tgui::WidgetRenderer tgui::WidgetBorders tgui::WidgetPadding

Public Member Functions

 EditBoxRenderer (EditBox *editBox)
 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...
 
virtual void setPadding (const Padding &padding) override
 Changes the padding of the edit box. More...
 
void setCaretWidth (float width)
 This will change the width of the caret. More...
 
void setTextColor (const Color &textColor)
 Set the text color that will be used inside the edit box. More...
 
void setSelectedTextColor (const Color &selectedTextColor)
 Set the text color of the selected text that will be used inside the edit box. More...
 
void setSelectedTextBackgroundColor (const Color &selectedTextBackgroundColor)
 Set the background color of the selected text that will be used inside the edit box. More...
 
void setDefaultTextColor (const Color &defaultTextColor)
 Set the color of the default text that can optionally be displayed when the edit box is empty. More...
 
void setBackgroundColor (const Color &color)
 Changes the color of the background. More...
 
void setBackgroundColorNormal (const Color &color)
 Changes the color of the background in the normal state (mouse not on edit box). More...
 
void setBackgroundColorHover (const Color &color)
 Changes the color of the background in the hover state (mouse on edit box, but not pressed). More...
 
void setCaretColor (const Color &caretColor)
 Set the color that will be used inside the edit box for the blinking caret. More...
 
void setBorderColor (const Color &color)
 Changes the color of the borders. More...
 
void setNormalTexture (const Texture &texture)
 Change the image that is displayed when the mouse is not on the edit box. More...
 
void setHoverTexture (const Texture &texture)
 Change the image that is displayed when the mouse is located on top of the edit box. More...
 
void setFocusTexture (const Texture &texture)
 Change the image that is drawn on top of the edit box image when the edit box is focused. More...
 
void setDefaultTextStyle (sf::Uint32 style)
 Changes the text style of the default text (the text drawn when the edit box is empty) More...
 
virtual void setPadding (const Padding &padding)
 Changes the size of the padding. More...
 
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...
 
- 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

◆ EditBoxRenderer()

tgui::EditBoxRenderer::EditBoxRenderer ( EditBox editBox)
inline

Constructor.

Parameters
editBoxThe edit box that is connected to the renderer

Member Function Documentation

◆ getProperty()

virtual ObjectConverter tgui::EditBoxRenderer::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::EditBoxRenderer::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::EditBoxRenderer::setBackgroundColor ( const Color color)

Changes the color of the background.

Parameters
colorNew background color

This color will overwrite the color for both the normal and hover state.

Note that this color is ignored when you set an image as background.

See also
setTextColorNormal
setTextColorHover

◆ setBackgroundColorHover()

void tgui::EditBoxRenderer::setBackgroundColorHover ( const Color color)

Changes the color of the background in the hover state (mouse on edit box, but not pressed).

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

◆ setBackgroundColorNormal()

void tgui::EditBoxRenderer::setBackgroundColorNormal ( const Color color)

Changes the color of the background in the normal state (mouse not on edit box).

Parameters
colorNew background color

Note that this color is ignored when you set an image as background.

◆ setBorderColor()

void tgui::EditBoxRenderer::setBorderColor ( const Color color)

Changes the color of the borders.

Parameters
colorNew border color

◆ setCaretColor()

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

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

Parameters
caretColorThe color of the blinking caret

◆ setCaretWidth()

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

This will change the width of the caret.

Parameters
widthNew width of the caret

◆ setDefaultTextColor()

void tgui::EditBoxRenderer::setDefaultTextColor ( const Color defaultTextColor)

Set the color of the default text that can optionally be displayed when the edit box is empty.

Parameters
defaultTextColorThe new default text color.

◆ setDefaultTextStyle()

void tgui::EditBoxRenderer::setDefaultTextStyle ( sf::Uint32  style)

Changes the text style of the default text (the text drawn when the edit box is empty)

Parameters
styleThe new default text style

By default text style is italic.

editBox->getRenderer()->setDefaultTextStyle(sf::Text::Italic | sf::Text::Bold);

◆ setFocusTexture()

void tgui::EditBoxRenderer::setFocusTexture ( const Texture texture)

Change the image that is drawn on top of the edit box image when the edit box is focused.

Parameters
textureThe new focus texture

Pass an empty texture to unset the image.

◆ setHoverTexture()

void tgui::EditBoxRenderer::setHoverTexture ( const Texture texture)

Change the image that is displayed when the mouse is located on top of the edit box.

Parameters
textureThe new hover texture

Pass an empty texture to unset the image.

◆ setNormalTexture()

void tgui::EditBoxRenderer::setNormalTexture ( const Texture texture)

Change the image that is displayed when the mouse is not on the edit box.

Parameters
textureThe new normal texture

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

◆ setPadding() [1/4]

virtual void tgui::WidgetPadding::setPadding ( const Padding padding)
inlinevirtual

Changes the size of the padding.

Parameters
paddingSize of the padding

Reimplemented from tgui::WidgetPadding.

◆ setPadding() [2/4]

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

Changes the padding of the edit box.

When the text is auto-scaled then it will be drawn within the area defined by the size minus the padding. The padding is also used to define the clipping area for when the text it too long.

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.

◆ setPadding() [3/4]

void tgui::WidgetPadding::setPadding ( float  leftPadding,
float  topPadding,
float  rightPadding,
float  bottomPadding 
)
inline

Changes the size of the padding.

Parameters
leftPaddingWidth of the left padding
topPaddingHeight of the top padding
rightPaddingWidth of the right padding
bottomPaddingHeight of the bottom padding

◆ setPadding() [4/4]

void tgui::WidgetPadding::setPadding ( float  width,
float  height 
)
inline

Changes the size of the padding.

Parameters
widthWidth of the left and right padding
heightHeight of the top and bottom padding

◆ setProperty() [1/2]

virtual void tgui::EditBoxRenderer::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.

Reimplemented from tgui::WidgetRenderer.

◆ setProperty() [2/2]

virtual void tgui::EditBoxRenderer::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.

Reimplemented from tgui::WidgetRenderer.

◆ setSelectedTextBackgroundColor()

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

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

Parameters
selectedTextBackgroundColorThe new background color.

◆ setSelectedTextColor()

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

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

Parameters
selectedTextColorThe new text color.

◆ setTextColor()

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

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

Parameters
textColorThe new text color.

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