Slider class. More...
#include <primitiveGui.h>
Public Member Functions | |
pSlider (float x, float y, float width, float height) | |
void | setColors (sf::Color borderColor, sf::Color fillColor, sf::Color sliderColor) |
void | setValue (float value) |
float | getValue () |
virtual void | updateWidget () |
Public Member Functions inherited from pWidget | |
pWidget (float x, float y, float width, float height) | |
void | setGeometry (float x, float y, float width, float height) |
void | setVisiblity (bool visiblity) |
Public Attributes | |
float | value |
Current value of slider. | |
sf::Color | borderColor |
Border color of slider shape - default ( 117, 119, 114, 255 ) | |
sf::Color | fillColor |
Background color of sluder shape - default ( 85, 87, 82, 255 ) | |
sf::Color | sliderColor |
Background color of movable rect - default ( 81, 130, 66, 255 ) | |
Public Attributes inherited from pWidget | |
int | widgetId |
Widget unique index. | |
int | widgetOnWindowId |
If widget is on some window this is a unique index of this window ( it's widgetId of this window ) else it is -1. | |
bool | visiblity |
visibility of widget | |
widgetTypeEnum | widgetType |
Type of the widget. | |
widgetEventType | widgetEvent |
Type of the event. | |
sf::Vector2f | widgetPosition |
Position of widget. | |
sf::Vector2f | widgetSize |
Size of widget. | |
Additional Inherited Members | |
Public Types inherited from pWidget | |
enum | widgetTypeEnum { Button =0, TextEdit, CheckBox, Slider, ProgressBar, Window } |
Enumeration of the different types of widgets. More... | |
enum | widgetEventType { NoEvent =0, WidgetClicked } |
Enumeration of the different types of widgets. More... | |
Slider class.
This class inherits of pWidget class.
This is a basic slider widget, movable rect will have a height that you set and slider shabe is lower by 20 px from the movable rect.
pSlider::pSlider | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Default constructor.
x | |
y | |
width | |
height |
float pSlider::getValue | ( | ) |
Get current value of slider
void pSlider::setColors | ( | sf::Color | borderColor, |
sf::Color | fillColor, | ||
sf::Color | sliderColor | ||
) |
Set slider colors
borderColor | |
fillColor | |
sliderColor |
void pSlider::setValue | ( | float | value | ) |
Set value of slider
value |
|
virtual |
Update widget. Every widget have own impementation of this function, because some widgets have more elements to draw.
Implements pWidget.