Progress bar class. More...
#include <primitiveGui.h>
Public Member Functions | |
pProgressBar (float x, float y, float width, float height) | |
void | setColors (sf::Color borderColor, sf::Color fillColor, sf::Color barColor) |
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 progress bar. | |
pText | progressBarLabel |
Text on progress bar. | |
sf::Color | borderColor |
Border color of progress bar - default ( 117, 119, 114, 255 ) | |
sf::Color | fillColor |
Background of widget shape - default ( 81, 78, 45, 255 ) | |
sf::Color | barColor |
Background of progress rect shape - 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... | |
Progress bar class.
This class inherits of pWidget class.
This is a basic progress bar. It contains only two rectangles and text :P
pProgressBar::pProgressBar | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
Default constructor.
x | |
y | |
width | |
height |
float pProgressBar::getValue | ( | ) |
Get current value of progress bar
void pProgressBar::setColors | ( | sf::Color | borderColor, |
sf::Color | fillColor, | ||
sf::Color | barColor | ||
) |
Set progress bar colors
borderColor | |
fillColor | |
barColor |
void pProgressBar::setValue | ( | float | value | ) |
Set value of progress bar
value |
|
virtual |
Update widget. Every widget have own impementation of this function, because some widgets have more elements to draw.
Implements pWidget.