#include <guidynamicbutton.h>
Inheritance diagram for GuiCheckableBtn:
Public Member Functions | |
DECLSPEC | GuiCheckableBtn (const SDL_Rect &r, GuiElement *p, const char *name, const char *t=0, SdlSurfaceContainer *b=0, SdlAudio *u=0, SdlAudio *d=0) |
DECLSPEC | GuiCheckableBtn (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
DECLSPEC void | setCheck (bool b) |
bool | getCheck () const |
void | setCheckCallback (Callback c) |
void | setCallbackData (BasicObject *d) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onMouseDown (SDL_MouseButtonEvent *ev) |
virtual DECLSPEC Uint32 | onMouseUp (SDL_MouseButtonEvent *ev) |
virtual DECLSPEC void | onInit () |
virtual DECLSPEC Uint32 | onThemeChanged (UiTheme *t) |
virtual DECLSPEC void | onCheck (bool checked) |
GuiCheckableBtn::GuiCheckableBtn | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation, the attribute OnCheck (event) can be specified | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiCheckableBtn::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiDynamicButton.
Reimplemented in GuiRadioBtn.
Uint32 GuiCheckableBtn::onMouseDown | ( | SDL_MouseButtonEvent * | ev | ) | [protected, virtual] |
This event is called, when the object has the mouse focus and a mouse button is pressed down.
ev | the button-down event, that occured |
Reimplemented from UiObject.
Uint32 GuiCheckableBtn::onMouseUp | ( | SDL_MouseButtonEvent * | ev | ) | [protected, virtual] |
This event is called, when the object has the mouse focus and a mouse button is released.
ev | the button-up event, that occured |
Reimplemented from UiObject.
void GuiCheckableBtn::onInit | ( | ) | [protected, virtual] |
Initializes the object's variables by reading data from the XML element. If there were no XML data used for creation, nothing is done. This function calls onInit() of its children recursively (after it has inited itself). It is highly recommended to call BasicObject::onInit(), usually at the end of the onInit() method, when overwriting it in a derived class.
Reimplemented from GuiDynamicButton.
Reimplemented in GuiRadioBtn.
Uint32 GuiCheckableBtn::onThemeChanged | ( | UiTheme * | t | ) | [protected, virtual] |
This event is called, when the theme changes. Perform here the changes of the object's look and feel.
t | pointer to the new used theme |
Reimplemented from GuiDynamicButton.
Reimplemented in GuiRadioBtn.
void GuiCheckableBtn::onCheck | ( | bool | checked | ) | [protected, virtual] |
Called after the checked-state changed.
checked | the new state (true if checked, false if unchecked) |
Reimplemented in GuiRadioBtn.