Public Member Functions | Public Attributes | List of all members
pCheckBox Class Reference

Check box class. More...

#include <primitiveGui.h>

Inheritance diagram for pCheckBox:
pWidget

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...
 

Detailed Description

Check box class.

This class inherits of pWidget class.

pCheckBox has two states, you can change it by modifying the variable isChecked.

Constructor & Destructor Documentation

pCheckBox::pCheckBox ( float  x,
float  y,
float  width,
float  height 
)

Default constructor.

Parameters
x
y
width
height

Member Function Documentation

sf::String pCheckBox::getText ( )

Get the text from checkBoxLabel

Returns
sf::String : fullString from checkBoxLabel
See Also
pText
void pCheckBox::setChecked ( bool  checked)

Change check box state

Parameters
checked
void pCheckBox::setColors ( sf::Color  borderColor,
sf::Color  uncheckedColor,
sf::Color  checkedColor 
)

Set check box colors.

Parameters
borderColor
uncheckedColor
checkedColor
void pCheckBox::setText ( sf::String &  text)

Set text on check box label

Parameters
text
void pCheckBox::updateWidget ( )
virtual

Update widget. Every widget have own impementation of this function, because some widgets have more elements to draw.

Implements pWidget.


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