Public Types | Public Member Functions | List of all members
ime::ui::SliderRenderer Class Reference

A Slider widget renderer. More...

#include <SliderRenderer.h>

Inheritance diagram for ime::ui::SliderRenderer:
ime::ui::IWidgetRenderer

Public Types

using Ptr = std::unique_ptr< SliderRenderer >
 Unique renderer pointer. More...
 

Public Member Functions

void setBorders (const Borders &borders)
 Change the ize of the widget borders. More...
 
Borders getBorders () const
 Get the ize of the widgets borders. More...
 
void setTrackColour (Colour colour)
 Set the colour of the track. More...
 
Colour getTrackColour () const
 Get the track colour. More...
 
void setTrackHoverColour (Colour colour)
 Set the colour of the track when the mouse enters it. More...
 
Colour getTrackHoverColour () const
 Get the colour of the track when the mouse enters it. More...
 
void setThumbColour (Colour colour)
 Set the thumb colour. More...
 
Colour getThumbColour () const
 Get the thumb colour. More...
 
void setThumbHoverColour (Colour colour)
 Set the colour of the thumb when the mouse enter it. More...
 
Colour getThumbHoverColour () const
 Get the colour of the thumb when the mouse enters it. More...
 
void setBorderColour (Colour colour)
 Set the border colour. More...
 
Colour getBorderColour () const
 Get the border colour. More...
 
void setBorderHoverColour (Colour colour)
 Set the colour of the borders when the mouse enters the slider. More...
 
Colour getBorderHoverColour () const
 Get the colour of the borders when the mouse enters the slider. More...
 
void setTrackTexture (const std::string &filename)
 Set the image of the track. More...
 
void setTrackHoverTexture (const std::string &filename)
 Set the image of the track when the mouse enters it. More...
 
void setThumbTexture (const std::string &filename)
 Set the image of the thumb. More...
 
void setThumbHoverTexture (const std::string &filename)
 Set the image of the thumb when the mouse enters it. More...
 
void setThumbWithinTrack (bool keepThumbInside)
 Set whether the center of the thumb or the sides of the thumb must remain on top of the track. More...
 
bool isThumbWithinTrack () const
 Check whether the centre of the thumb or the sides of the thumb must remain on top of the track. More...
 
void setOpacity (float opacity) override
 Set the opacity of the widget. More...
 
float getOpacity () const override
 Get the opacity of the widget. More...
 
void setOpacityDisabled (float opacity) override
 Set the opacity of the widget when it is disabled. More...
 
float getOpacityDisabled () const override
 Get the opacity of the widget when it is disabled. More...
 
void setFont (const std::string &filename) override
 Change the widgets font. More...
 
void ignoreTransparentTexture (bool ignoreTransparentParts) override
 Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state. More...
 
bool isTransparentTextureIgnored () const override
 Check if mouse events are ignored on transparent parts of the texture or not. More...
 
IWidgetRenderer::Ptr clone () const override
 Create a copy of the render. More...
 
void setInternalPtr (tgui::WidgetRenderer *renderer) override
 
tgui::WidgetRenderer * getInternalPtr () override
 
 ~SliderRenderer () override
 Destructor. More...
 

Detailed Description

A Slider widget renderer.

This class allows you to manipulate the render properties of a Slider

Definition at line 43 of file SliderRenderer.h.

Member Typedef Documentation

◆ Ptr

using ime::ui::SliderRenderer::Ptr = std::unique_ptr<SliderRenderer>

Unique renderer pointer.

Definition at line 45 of file SliderRenderer.h.

Constructor & Destructor Documentation

◆ ~SliderRenderer()

ime::ui::SliderRenderer::~SliderRenderer ( )
override

Destructor.

Member Function Documentation

◆ clone()

IWidgetRenderer::Ptr ime::ui::SliderRenderer::clone ( ) const
overridevirtual

Create a copy of the render.

Returns
A copy of the render

Implements ime::ui::IWidgetRenderer.

◆ getBorderColour()

Colour ime::ui::SliderRenderer::getBorderColour ( ) const

Get the border colour.

Returns
The border colour

◆ getBorderHoverColour()

Colour ime::ui::SliderRenderer::getBorderHoverColour ( ) const

Get the colour of the borders when the mouse enters the slider.

Returns
the colour of the borders when the mouse enters the slider

◆ getBorders()

Borders ime::ui::SliderRenderer::getBorders ( ) const

Get the ize of the widgets borders.

Returns
The size of the widgets borders

◆ getInternalPtr()

tgui::WidgetRenderer * ime::ui::SliderRenderer::getInternalPtr ( )
overridevirtual

◆ getOpacity()

float ime::ui::SliderRenderer::getOpacity ( ) const
overridevirtual

Get the opacity of the widget.

Returns
The opacity of the widget

Implements ime::ui::IWidgetRenderer.

◆ getOpacityDisabled()

float ime::ui::SliderRenderer::getOpacityDisabled ( ) const
overridevirtual

Get the opacity of the widget when it is disabled.

Returns
The opacity of the widget in disabled state

This function will return -1 if the widget uses the same opacity as the enabled state when it is disabled

Implements ime::ui::IWidgetRenderer.

◆ getThumbColour()

Colour ime::ui::SliderRenderer::getThumbColour ( ) const

Get the thumb colour.

Returns
The thumb colour

◆ getThumbHoverColour()

Colour ime::ui::SliderRenderer::getThumbHoverColour ( ) const

Get the colour of the thumb when the mouse enters it.

Returns
The colour of the thumb when the mouse enter it

◆ getTrackColour()

Colour ime::ui::SliderRenderer::getTrackColour ( ) const

Get the track colour.

Returns
The track colour

◆ getTrackHoverColour()

Colour ime::ui::SliderRenderer::getTrackHoverColour ( ) const

Get the colour of the track when the mouse enters it.

Returns
The colour of the track whn the mouse enters it

◆ ignoreTransparentTexture()

void ime::ui::SliderRenderer::ignoreTransparentTexture ( bool  ignoreTransparentParts)
overridevirtual

Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state.

Parameters
ignoreTransparentPartsTrue to ignore mouse events on transparent parts of the texture, otherwise false

When mouse events are ignored, they are passed to a widget behind the widget. By default, mouse events are NOT ignored and the widget will receive mouse events even on transparent texture parts. This property does nothing if the widget doesn't use textures

Implements ime::ui::IWidgetRenderer.

◆ isThumbWithinTrack()

bool ime::ui::SliderRenderer::isThumbWithinTrack ( ) const

Check whether the centre of the thumb or the sides of the thumb must remain on top of the track.

Returns
True if the thumb is kept inside, otherwise false

◆ isTransparentTextureIgnored()

bool ime::ui::SliderRenderer::isTransparentTextureIgnored ( ) const
overridevirtual

Check if mouse events are ignored on transparent parts of the texture or not.

Returns
True if mouse events are ignored, otherwise false
See also
ignoreTransparentTexture

Implements ime::ui::IWidgetRenderer.

◆ setBorderColour()

void ime::ui::SliderRenderer::setBorderColour ( Colour  colour)

Set the border colour.

Parameters
colourThe border colour to set

◆ setBorderHoverColour()

void ime::ui::SliderRenderer::setBorderHoverColour ( Colour  colour)

Set the colour of the borders when the mouse enters the slider.

Parameters
colourThe slider colour to set

◆ setBorders()

void ime::ui::SliderRenderer::setBorders ( const Borders borders)

Change the ize of the widget borders.

Parameters
bordersThe size of the borders

◆ setFont()

void ime::ui::SliderRenderer::setFont ( const std::string &  filename)
overridevirtual

Change the widgets font.

Parameters
filenameFilename of the new font
Exceptions
FileNotFoundExceptionIf the font cannot be found on the disk

Implements ime::ui::IWidgetRenderer.

◆ setInternalPtr()

void ime::ui::SliderRenderer::setInternalPtr ( tgui::WidgetRenderer *  renderer)
overridevirtual

◆ setOpacity()

void ime::ui::SliderRenderer::setOpacity ( float  opacity)
overridevirtual

Set the opacity of the widget.

Parameters
opacityThe new opacity of the widget in between 0 and 1

0 means completely transparent, while 1 (default) means fully opaque

Implements ime::ui::IWidgetRenderer.

◆ setOpacityDisabled()

void ime::ui::SliderRenderer::setOpacityDisabled ( float  opacity)
overridevirtual

Set the opacity of the widget when it is disabled.

Parameters
opacityOpacity to set between 0 and 1

0 means completely transparent, while 1 (default) means fully opaque. Set to -1 (default) to use the normal opacity value even when the widget is disabled.

Implements ime::ui::IWidgetRenderer.

◆ setThumbColour()

void ime::ui::SliderRenderer::setThumbColour ( Colour  colour)

Set the thumb colour.

Parameters
colourThe thumb colour to set

◆ setThumbHoverColour()

void ime::ui::SliderRenderer::setThumbHoverColour ( Colour  colour)

Set the colour of the thumb when the mouse enter it.

Parameters
colourThe thumb colour to set

◆ setThumbHoverTexture()

void ime::ui::SliderRenderer::setThumbHoverTexture ( const std::string &  filename)

Set the image of the thumb when the mouse enters it.

Parameters
filenameFilename of the image to set
Exceptions
FileNotFoundExceptionif the image cannot be found on the disk

◆ setThumbTexture()

void ime::ui::SliderRenderer::setThumbTexture ( const std::string &  filename)

Set the image of the thumb.

Parameters
filenameFilename of the image to set
Exceptions
FileNotFoundExceptionif the image cannot be found on the disk

◆ setThumbWithinTrack()

void ime::ui::SliderRenderer::setThumbWithinTrack ( bool  keepThumbInside)

Set whether the center of the thumb or the sides of the thumb must remain on top of the track.

Parameters
keepThumbInsideTrue to keep thumb inside, otherwise false

◆ setTrackColour()

void ime::ui::SliderRenderer::setTrackColour ( Colour  colour)

Set the colour of the track.

Parameters
colourThe colour to set

◆ setTrackHoverColour()

void ime::ui::SliderRenderer::setTrackHoverColour ( Colour  colour)

Set the colour of the track when the mouse enters it.

Parameters
colourThe track colour to set

◆ setTrackHoverTexture()

void ime::ui::SliderRenderer::setTrackHoverTexture ( const std::string &  filename)

Set the image of the track when the mouse enters it.

Parameters
filenameFilename of the image to set
Exceptions
FileNotFoundExceptionif the image cannot be found on the disk

◆ setTrackTexture()

void ime::ui::SliderRenderer::setTrackTexture ( const std::string &  filename)

Set the image of the track.

Parameters
filenameFilename of the image to set
Exceptions
FileNotFoundExceptionif the image cannot be found on the disk

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