TGUI  0.7.8
tgui::SpinButtonRenderer Class Reference
Inheritance diagram for tgui::SpinButtonRenderer:
tgui::WidgetRenderer tgui::WidgetBorders

Public Member Functions

 SpinButtonRenderer (SpinButton *spinButton)
 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 &color)
 Changes the background color of the arrows. More...
 
void setBackgroundColorNormal (const Color &color)
 Changes the background color of the arrows in the normal state (mouse not on spin button). More...
 
void setBackgroundColorHover (const Color &color)
 Changes the background color of the arrows in the hover state (mouse standing on top of the spin button). More...
 
void setArrowColor (const Color &color)
 Changes the color of the arrows. More...
 
void setArrowColorNormal (const Color &color)
 Changes the color of the arrows in the normal state (mouse not on spin button). More...
 
void setArrowColorHover (const Color &color)
 Changes the color of the arrows in the hover state (mouse standing on top of the spin button). More...
 
void setBorderColor (const Color &color)
 Changes the color of the borders that are optionally drawn around the arrows. More...
 
void setArrowUpTexture (const Texture &texture)
 Change the image that is used as the up arrow. More...
 
void setArrowDownTexture (const Texture &texture)
 Change the image that is used as the down arrow. More...
 
void setArrowUpHoverTexture (const Texture &texture)
 Change the image that is used as the up arrow when the mouse is on top of this arrow. More...
 
void setArrowDownHoverTexture (const Texture &texture)
 Change the image that is used as the up arrow when the mouse is on top of this arrow. More...
 
void setSpaceBetweenArrows (float space)
 Changes the space that is placed between the arrows. 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...
 

Constructor & Destructor Documentation

◆ SpinButtonRenderer()

tgui::SpinButtonRenderer::SpinButtonRenderer ( SpinButton spinButton)
inline

Constructor.

Parameters
spinButtonThe spin button that is connected to the renderer

Member Function Documentation

◆ getProperty()

virtual ObjectConverter tgui::SpinButtonRenderer::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::SpinButtonRenderer::getPropertyValuePairs ( ) const
overridevirtual

Get a map with all properties and their values.

Returns
Property-value pairs of the renderer

Reimplemented from tgui::WidgetRenderer.

◆ setArrowColor()

void tgui::SpinButtonRenderer::setArrowColor ( const Color color)

Changes the color of the arrows.

Parameters
colorNew arrow color

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

Note that this color is ignored when an up and down arrow image were set.

See also
setArrowColorNormal
setArrowColorHover

◆ setArrowColorHover()

void tgui::SpinButtonRenderer::setArrowColorHover ( const Color color)

Changes the color of the arrows in the hover state (mouse standing on top of the spin button).

Parameters
colorNew arrow color

Note that this color is ignored when an up and down arrow image were set.

◆ setArrowColorNormal()

void tgui::SpinButtonRenderer::setArrowColorNormal ( const Color color)

Changes the color of the arrows in the normal state (mouse not on spin button).

Parameters
colorNew arrow color

Note that this color is ignored when an up and down arrow image were set.

◆ setArrowDownHoverTexture()

void tgui::SpinButtonRenderer::setArrowDownHoverTexture ( const Texture texture)

Change the image that is used as the up arrow when the mouse is on top of this arrow.

Parameters
textureThe new hover arrow texture

The hover texture is ignored if no normal texture was set. Pass an empty texture to unset the image.

◆ setArrowDownTexture()

void tgui::SpinButtonRenderer::setArrowDownTexture ( const Texture texture)

Change the image that is used as the down arrow.

Parameters
textureThe new arrow texture

When this image and the up image are set, the color properties will be ignored. Pass an empty texture to unset the image, in this case the color properties will be used again.

◆ setArrowUpHoverTexture()

void tgui::SpinButtonRenderer::setArrowUpHoverTexture ( const Texture texture)

Change the image that is used as the up arrow when the mouse is on top of this arrow.

Parameters
textureThe new hover arrow texture

The hover texture is ignored if no normal texture was set. Pass an empty texture to unset the image.

◆ setArrowUpTexture()

void tgui::SpinButtonRenderer::setArrowUpTexture ( const Texture texture)

Change the image that is used as the up arrow.

Parameters
textureThe new arrow texture

When this image and the down image are set, the color properties will be ignored. Pass an empty texture to unset the image, in this case the color properties will be used again.

◆ setBackgroundColor()

void tgui::SpinButtonRenderer::setBackgroundColor ( const Color color)

Changes the background color of the arrows.

Parameters
colorNew background color

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

Note that this color is ignored when an up and down arrow image were set.

See also
setBackgroundColorNormal
setBackgroundColorHover

◆ setBackgroundColorHover()

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

Changes the background color of the arrows in the hover state (mouse standing on top of the spin button).

Parameters
colorNew background color

Note that this color is ignored when an up and down arrow image were set.

◆ setBackgroundColorNormal()

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

Changes the background color of the arrows in the normal state (mouse not on spin button).

Parameters
colorNew background color

Note that this color is ignored when an up and down arrow image were set.

◆ setBorderColor()

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

Changes the color of the borders that are optionally drawn around the arrows.

Parameters
colorNew border color

◆ setProperty() [1/2]

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

◆ setSpaceBetweenArrows()

void tgui::SpinButtonRenderer::setSpaceBetweenArrows ( float  space)

Changes the space that is placed between the arrows.

This space will use the BorderColor as color.

When images are used, this space is scaled together with the size of the images

Parameters
spaceNew space between the arrows

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