GuiClickableBtn Class Reference

A class for buttons that respond on clicks. More...

#include <guidynamicbutton.h>

Inheritance diagram for GuiClickableBtn:

Inheritance graph
[legend]
Collaboration diagram for GuiClickableBtn:

Collaboration graph
[legend]
List of all members.

Public Types

typedef void(*) CallBack (GuiClickableBtn *, void *)

Public Member Functions

DECLSPEC GuiClickableBtn (const SDL_Rect &r, GuiElement *p, const char *name, const char *t=0, SdlSurfaceContainer *b=0, SdlAudio *u=0, SdlAudio *d=0)
DECLSPEC GuiClickableBtn (TiXmlElement *el, GuiElement *p)
virtual const char * getClassName ()
void setClickCallback (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 onMouseOver ()
virtual DECLSPEC Uint32 onMouseOut ()
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 onEnabledChanged (bool enabled)

Protected Attributes

FunctionData cbClicked

Detailed Description

A class for buttons that respond on clicks.


Constructor & Destructor Documentation

GuiClickableBtn::GuiClickableBtn ( TiXmlElement el,
GuiElement p 
)

Constructor. Uses XML data.

Parameters:
el the XML data for initialisation, the attribute OnClick (event) can be specified
p parent element (or NULL, to take GuiManager::the as parent)
See also:
GuiElement(TiXmlElement*,GuiElement*)


Member Function Documentation

virtual const char* GuiClickableBtn::getClassName (  )  [inline, virtual]

This function should be overriden in every sub-class of BasicObject!

Returns:
the name of the class.

Reimplemented from GuiDynamicButton.

Uint32 GuiClickableBtn::onMouseOver (  )  [protected, virtual]

This event is called, when the mouse cursor just moved into the object's rect.

Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from GuiElement.

Uint32 GuiClickableBtn::onMouseOut (  )  [protected, virtual]

This event is called, when the mouse cursor just moved out of the object's rect.

Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from GuiElement.

Uint32 GuiClickableBtn::onMouseDown ( SDL_MouseButtonEvent *  ev  )  [protected, virtual]

This event is called, when the object has the mouse focus and a mouse button is pressed down.

Parameters:
ev the button-down event, that occured
Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from UiObject.

Uint32 GuiClickableBtn::onMouseUp ( SDL_MouseButtonEvent *  ev  )  [protected, virtual]

This event is called, when the object has the mouse focus and a mouse button is released.

Parameters:
ev the button-up event, that occured
Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from UiObject.

void GuiClickableBtn::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.

Uint32 GuiClickableBtn::onThemeChanged ( UiTheme t  )  [protected, virtual]

This event is called, when the theme changes. Perform here the changes of the object's look and feel.

Parameters:
t pointer to the new used theme
Returns:
currently the result is not used; may be zero, if no error...

Reimplemented from GuiDynamicButton.

void GuiClickableBtn::onEnabledChanged ( bool  enabled  )  [protected, virtual]

Todo:
if enabled then setBtnState(correct state), currently stays normal even if mouse is over element

Reimplemented from GuiElement.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:14 2007 for netrinjo by  doxygen 1.5.1