#include <CheckBox.h>
Public Member Functions | |
const char * | getTypeName () const |
bool | isChecked () |
void | setChecked (bool checked) |
virtual void | addListener (Control::Listener *listener, int eventFlags) |
Static Public Member Functions | |
static CheckBox * | create (const char *id, Theme::Style *style=NULL) |
Protected Member Functions | |
CheckBox () | |
~CheckBox () | |
void | initialize (const char *typeName, Theme::Style *style, Properties *properties) |
bool | keyEvent (Keyboard::KeyEvent evt, int key) |
void | controlEvent (Control::Listener::EventType evt) |
void | updateState (State state) |
void | updateBounds () |
void | updateAbsoluteBounds (const Vector2 &offset) |
unsigned int | drawImages (Form *form, const Rectangle &clip) |
Static Protected Member Functions | |
static Control * | create (Theme::Style *style, Properties *properties=NULL) |
Protected Attributes | |
bool | _checked |
Theme::ThemeImage * | _image |
Defines a checkbox control.
This is a button that can be enabled or disabled.
gameplay::CheckBox::CheckBox | ( | ) | [protected] |
Constructor.
gameplay::CheckBox::~CheckBox | ( | ) | [protected] |
Destructor.
virtual void gameplay::CheckBox::addListener | ( | Control::Listener * | listener, |
int | eventFlags | ||
) | [virtual] |
Add a listener to be notified of specific events affecting this control. Event types can be OR'ed together. E.g. To listen to touch-press and touch-release events, pass Control::Listener::TOUCH | Control::Listener::RELEASE
as the second parameter.
listener | The listener to add. |
eventFlags | The events to listen for. |
Reimplemented from gameplay::Label.
void gameplay::CheckBox::controlEvent | ( | Control::Listener::EventType | evt | ) | [protected, virtual] |
Reimplemented from gameplay::Control.
static CheckBox* gameplay::CheckBox::create | ( | const char * | id, |
Theme::Style * | style = NULL |
||
) | [static] |
Creates a new CheckBox.
id | The checkbox ID. |
style | The checkbox style (optional). |
Reimplemented from gameplay::Button.
static Control* gameplay::CheckBox::create | ( | Theme::Style * | style, |
Properties * | properties = NULL |
||
) | [static, protected] |
Create a checkbox with a given style and properties.
style | The style to apply to this checkbox. |
properties | A properties object containing a definition of the checkbox (optional). |
Reimplemented from gameplay::Button.
unsigned int gameplay::CheckBox::drawImages | ( | Form * | form, |
const Rectangle & | clip | ||
) | [protected, virtual] |
Reimplemented from gameplay::Control.
const char* gameplay::CheckBox::getTypeName | ( | ) | const [virtual] |
Extends ScriptTarget::getTypeName() to return the type name of this class.
Child controls should override this function to return the correct type name.
Reimplemented from gameplay::Button.
void gameplay::CheckBox::initialize | ( | const char * | typeName, |
Theme::Style * | style, | ||
Properties * | properties | ||
) | [protected, virtual] |
Reimplemented from gameplay::Button.
bool gameplay::CheckBox::isChecked | ( | ) |
Gets whether this checkbox is checked.
bool gameplay::CheckBox::keyEvent | ( | Keyboard::KeyEvent | evt, |
int | key | ||
) | [protected, virtual] |
Keyboard callback on key events.
Reimplemented from gameplay::Control.
void gameplay::CheckBox::setChecked | ( | bool | checked | ) |
Sets whether the checkbox is checked.
checked | TRUE if the checkbox is checked; FALSE if the checkbox is not checked. |
void gameplay::CheckBox::updateAbsoluteBounds | ( | const Vector2 & | offset | ) | [protected, virtual] |
Reimplemented from gameplay::Label.
void gameplay::CheckBox::updateBounds | ( | ) | [protected, virtual] |
Reimplemented from gameplay::Label.
void gameplay::CheckBox::updateState | ( | State | state | ) | [protected, virtual] |
Reimplemented from gameplay::Label.
bool gameplay::CheckBox::_checked [protected] |
Whether this checkbox is currently checked.
Theme::ThemeImage* gameplay::CheckBox::_image [protected] |
The Theme::ThemeImage to display for the checkbox.