TGUI  0.7.4
tgui::ListBoxRenderer Class Reference
Inheritance diagram for tgui::ListBoxRenderer:
tgui::WidgetRenderer tgui::WidgetBorders tgui::WidgetPadding

Public Member Functions

 ListBoxRenderer (ListBox *listBox)
 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 list box. More...
 
void setTextColor (const Color &textColor)
 Set the text color that will be used inside the list box. More...
 
void setTextColorNormal (const Color &color)
 Changes the color of the text in the normal state (mouse not on top of the item). More...
 
void setTextColorHover (const Color &color)
 Changes the color of the text in the hover state (mouse is standing on top of the item). More...
 
void setHoverBackgroundColor (const Color &hoverBackgroundColor)
 Set the background color of the unselected item on which the mouse is standing. More...
 
void setSelectedBackgroundColor (const Color &selectedBackgroundColor)
 Set the background color of the selected text that will be used inside the list box. More...
 
void setSelectedTextColor (const Color &selectedTextColor)
 Set the text color of the selected text that will be used inside the list box. More...
 
void setBorderColor (const Color &borderColor)
 Set the border color text that will be used inside the list box. More...
 
void setBackgroundTexture (const Texture &texture)
 Changes the background image. More...
 
virtual void setPadding (const Padding &padding) override
 Changes the padding of the list 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

◆ ListBoxRenderer()

tgui::ListBoxRenderer::ListBoxRenderer ( ListBox listBox)
inline

Constructor.

Parameters
listBoxThe list box that is connected to the renderer

Member Function Documentation

◆ getProperty()

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

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

Parameters
backgroundColorThe color of the background of the list box

◆ setBackgroundTexture()

void tgui::ListBoxRenderer::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::ListBoxRenderer::setBorderColor ( const Color borderColor)

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

Parameters
borderColorThe color of the borders

◆ setHoverBackgroundColor()

void tgui::ListBoxRenderer::setHoverBackgroundColor ( const Color hoverBackgroundColor)

Set the background color of the unselected item on which the mouse is standing.

Parameters
hoverBackgroundColorThe color of the background of unselected item below the mouse

◆ setPadding()

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

Changes the padding of the list 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::ListBoxRenderer::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::ListBoxRenderer::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.

◆ setSelectedBackgroundColor()

void tgui::ListBoxRenderer::setSelectedBackgroundColor ( const Color selectedBackgroundColor)

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

Parameters
selectedBackgroundColorThe color of the background of the selected item

◆ setSelectedTextColor()

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

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

Parameters
selectedTextColorThe color of the text when it is selected

◆ setTextColor()

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

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

Parameters
textColorThe color of the text

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

See also
setTextColorNormal
setTextColorHover

◆ setTextColorHover()

void tgui::ListBoxRenderer::setTextColorHover ( const Color color)

Changes the color of the text in the hover state (mouse is standing on top of the item).

Parameters
colorNew text color

◆ setTextColorNormal()

void tgui::ListBoxRenderer::setTextColorNormal ( const Color color)

Changes the color of the text in the normal state (mouse not on top of the item).

Parameters
colorNew text color

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