#include <guidynamicbutton.h>
Inheritance diagram for GuiDynamicButton:
Public Types | |
enum | DynamicState { ds_none, ds_fast } |
enum | StateType { normal = 0, pressed = 1, mouseover = 2 } |
Public Member Functions | |
DECLSPEC | GuiDynamicButton (const SDL_Rect &r, GuiElement *p, const char *name, const char *t, SdlSurfaceContainer *b=0, SdlAudio *u=0, SdlAudio *d=0) |
DECLSPEC | GuiDynamicButton (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
StateType | getState () const |
DECLSPEC void | setBorderVisible (bool show) |
DECLSPEC void | setSounds (SdlAudio *u, SdlAudio *d) |
DECLSPEC void | setButtonBmps (SdlSurfaceContainer *b=0) |
DECLSPEC void | setText (const char *t=0) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
Public Attributes | |
enum GuiDynamicButton::DynamicState | eDynamic |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onFrame (SdlSurface *dst) |
virtual DECLSPEC Uint32 | onButtonPress (Sint32 x, Sint32 y) |
virtual DECLSPEC Uint32 | onButtonRelease (bool bInClient) |
virtual DECLSPEC Uint32 | onThemeChanged (UiTheme *t) |
virtual DECLSPEC void | onInit () |
virtual DECLSPEC Uint32 | changeTheme (UiTheme *t, const char *classname) |
void | setBtnState (StateType t) |
StateType | getBtnState () |
|
GuiDynamicButton::GuiDynamicButton | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation, attributes: Caption (string), ButtonBmps (name of surface), ButtonSoundUp (name of sound), ButtonSoundDown (name of sound) | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiDynamicButton::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiBorder.
Reimplemented in GuiClickableBtn, GuiCheckableBtn, and GuiRadioBtn.
Uint32 GuiDynamicButton::onFrame | ( | SdlSurface * | dst | ) | [protected, virtual] |
This event is called, when a frame is drawn. If the object should be visible, is has to draw it's look to a valid surface. This method calls the children's function, if visible.
Reimplemented from GuiBorder.
Uint32 GuiDynamicButton::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 GuiBorder.
Reimplemented in GuiClickableBtn, GuiCheckableBtn, and GuiRadioBtn.
void GuiDynamicButton::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 GuiBorder.
Reimplemented in GuiClickableBtn, GuiCheckableBtn, and GuiRadioBtn.
void GuiDynamicButton::setBtnState | ( | StateType | t | ) | [inline, protected] |
Changes the button state and sets the redraw-state (only if t is not yet the state)
t | the state to assign |