Check box class. More...
#include <primitiveGui.h>
Public Member Functions | |
| pCheckBox (float x, float y, float width, float height) | |
| void | setColors (sf::Color borderColor, sf::Color uncheckedColor, sf::Color checkedColor) |
| void | setChecked (bool checked) |
| void | setText (sf::String &text) |
| sf::String | getText () |
| 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 | |
| bool | isChecked |
| Check box state, default false. | |
| sf::Color | borderColor |
| Border color of checkable square - default ( 117, 119, 114, 255 ) | |
| sf::Color | uncheckedColor |
| Background color of checkable square - default ( 85, 87, 82, 255 ) | |
| sf::Color | checkedColor |
| Background color of checkable square when it's checked - default Red. | |
| pText | checkBoxLabel |
| Text on check box. | |
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... | |
Check box class.
This class inherits of pWidget class.
pCheckBox has two states, you can change it by modifying the variable isChecked.
| pCheckBox::pCheckBox | ( | float | x, |
| float | y, | ||
| float | width, | ||
| float | height | ||
| ) |
Default constructor.
| x | |
| y | |
| width | |
| height |
| sf::String pCheckBox::getText | ( | ) |
| void pCheckBox::setChecked | ( | bool | checked | ) |
Change check box state
| checked |
| void pCheckBox::setColors | ( | sf::Color | borderColor, |
| sf::Color | uncheckedColor, | ||
| sf::Color | checkedColor | ||
| ) |
Set check box colors.
| borderColor | |
| uncheckedColor | |
| checkedColor |
| void pCheckBox::setText | ( | sf::String & | text | ) |
Set text on check box label
| text |
|
virtual |
Update widget. Every widget have own impementation of this function, because some widgets have more elements to draw.
Implements pWidget.
1.8.3.1