A Slider widget renderer. More...
#include <SliderRenderer.h>
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... | |
A Slider widget renderer.
This class allows you to manipulate the render properties of a Slider
Definition at line 43 of file SliderRenderer.h.
using ime::ui::SliderRenderer::Ptr = std::unique_ptr<SliderRenderer> |
Unique renderer pointer.
Definition at line 45 of file SliderRenderer.h.
|
override |
Destructor.
|
overridevirtual |
Colour ime::ui::SliderRenderer::getBorderColour | ( | ) | const |
Get the border colour.
Colour ime::ui::SliderRenderer::getBorderHoverColour | ( | ) | const |
Get the colour of the borders when the mouse enters the slider.
Borders ime::ui::SliderRenderer::getBorders | ( | ) | const |
Get the ize of the widgets borders.
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the widget.
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Get the opacity of the widget when it is disabled.
This function will return -1 if the widget uses the same opacity as the enabled state when it is disabled
Implements ime::ui::IWidgetRenderer.
Colour ime::ui::SliderRenderer::getThumbColour | ( | ) | const |
Get the thumb colour.
Colour ime::ui::SliderRenderer::getThumbHoverColour | ( | ) | const |
Get the colour of the thumb when the mouse enters it.
Colour ime::ui::SliderRenderer::getTrackColour | ( | ) | const |
Get the track colour.
Colour ime::ui::SliderRenderer::getTrackHoverColour | ( | ) | const |
Get the colour of the track when the mouse enters it.
|
overridevirtual |
Set whether mouse events should be ignored on transparent parts of the texture of the widget in normal state.
ignoreTransparentParts | True 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.
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.
|
overridevirtual |
Check if mouse events are ignored on transparent parts of the texture or not.
Implements ime::ui::IWidgetRenderer.
void ime::ui::SliderRenderer::setBorderColour | ( | Colour | colour | ) |
Set the border colour.
colour | The border colour to set |
void ime::ui::SliderRenderer::setBorderHoverColour | ( | Colour | colour | ) |
Set the colour of the borders when the mouse enters the slider.
colour | The slider colour to set |
void ime::ui::SliderRenderer::setBorders | ( | const Borders & | borders | ) |
Change the ize of the widget borders.
borders | The size of the borders |
|
overridevirtual |
Change the widgets font.
filename | Filename of the new font |
FileNotFoundException | If the font cannot be found on the disk |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Set the opacity of the widget.
opacity | The new opacity of the widget in between 0 and 1 |
0 means completely transparent, while 1 (default) means fully opaque
Implements ime::ui::IWidgetRenderer.
|
overridevirtual |
Set the opacity of the widget when it is disabled.
opacity | Opacity 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.
void ime::ui::SliderRenderer::setThumbColour | ( | Colour | colour | ) |
Set the thumb colour.
colour | The thumb colour to set |
void ime::ui::SliderRenderer::setThumbHoverColour | ( | Colour | colour | ) |
Set the colour of the thumb when the mouse enter it.
colour | The thumb colour to set |
void ime::ui::SliderRenderer::setThumbHoverTexture | ( | const std::string & | filename | ) |
Set the image of the thumb when the mouse enters it.
filename | Filename of the image to set |
FileNotFoundException | if the image cannot be found on the disk |
void ime::ui::SliderRenderer::setThumbTexture | ( | const std::string & | filename | ) |
Set the image of the thumb.
filename | Filename of the image to set |
FileNotFoundException | if the image cannot be found on the disk |
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.
keepThumbInside | True to keep thumb inside, otherwise false |
void ime::ui::SliderRenderer::setTrackColour | ( | Colour | colour | ) |
Set the colour of the track.
colour | The colour to set |
void ime::ui::SliderRenderer::setTrackHoverColour | ( | Colour | colour | ) |
Set the colour of the track when the mouse enters it.
colour | The track colour to set |
void ime::ui::SliderRenderer::setTrackHoverTexture | ( | const std::string & | filename | ) |
Set the image of the track when the mouse enters it.
filename | Filename of the image to set |
FileNotFoundException | if the image cannot be found on the disk |
void ime::ui::SliderRenderer::setTrackTexture | ( | const std::string & | filename | ) |
Set the image of the track.
filename | Filename of the image to set |
FileNotFoundException | if the image cannot be found on the disk |