overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
gameplay::CheckBox Class Reference

#include <CheckBox.h>

Inheritance diagram for gameplay::CheckBox:
gameplay::Button gameplay::Label gameplay::Control gameplay::Ref gameplay::AnimationTarget gameplay::ScriptTarget

List of all members.

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 CheckBoxcreate (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 Controlcreate (Theme::Style *style, Properties *properties=NULL)

Protected Attributes

bool _checked

Detailed Description

Defines a checkbox control.

This is a button that can be enabled or disabled.

See also:

Constructor & Destructor Documentation



Member Function Documentation

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.

listenerThe listener to add.
eventFlagsThe events to listen for.

Reimplemented from gameplay::Label.

See also:

Reimplemented from gameplay::Control.

static CheckBox* gameplay::CheckBox::create ( const char *  id,
Theme::Style style = NULL 
) [static]

Creates a new CheckBox.

idThe checkbox ID.
styleThe checkbox style (optional).
The new checkbox.

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.

styleThe style to apply to this checkbox.
propertiesA properties object containing a definition of the checkbox (optional).
The new checkbox.

Reimplemented from gameplay::Button.

unsigned int gameplay::CheckBox::drawImages ( Form form,
const Rectangle clip 
) [protected, virtual]
See also:

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.

The type name of this class: "CheckBox"
See also:

Reimplemented from gameplay::Button.

void gameplay::CheckBox::initialize ( const char *  typeName,
Theme::Style style,
Properties properties 
) [protected, virtual]
See also:

Reimplemented from gameplay::Button.

Gets whether this checkbox is checked.

Whether this checkbox is checked.
bool gameplay::CheckBox::keyEvent ( Keyboard::KeyEvent  evt,
int  key 
) [protected, virtual]

Keyboard callback on key events.

See also:

Reimplemented from gameplay::Control.

void gameplay::CheckBox::setChecked ( bool  checked)

Sets whether the checkbox is checked.

checkedTRUE if the checkbox is checked; FALSE if the checkbox is not checked.
void gameplay::CheckBox::updateAbsoluteBounds ( const Vector2 offset) [protected, virtual]
See also:

Reimplemented from gameplay::Label.

void gameplay::CheckBox::updateBounds ( ) [protected, virtual]
See also:

Reimplemented from gameplay::Label.

void gameplay::CheckBox::updateState ( State  state) [protected, virtual]
See also:

Reimplemented from gameplay::Label.

Member Data Documentation

bool gameplay::CheckBox::_checked [protected]

Whether this checkbox is currently checked.

The Theme::ThemeImage to display for the checkbox.

 All Classes Functions Variables Typedefs Enumerations Enumerator