#include <guitext.h>
Inheritance diagram for GuiKeyControl:
Public Member Functions | |
DECLSPEC | GuiKeyControl (const SDL_Rect &r, GuiElement *p, const char *name) |
DECLSPEC | GuiKeyControl (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
SDL_keysym | getKey () const |
DECLSPEC void | setKey (const SDL_keysym &k) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
Static Public Attributes | |
static DECLSPEC const char * | alpha [] |
static DECLSPEC const SDLKey | code [] |
static DECLSPEC const unsigned int | count |
Protected Member Functions | |
virtual DECLSPEC Uint32 | onFrame (SdlSurface *dst) |
virtual DECLSPEC Uint32 | onMouseDown (SDL_MouseButtonEvent *ev) |
virtual DECLSPEC Uint32 | onKeyDown (SDL_KeyboardEvent *ev) |
virtual DECLSPEC Uint32 | onFocus () |
virtual DECLSPEC Uint32 | onRelease () |
virtual DECLSPEC void | onInit () |
GuiKeyControl::GuiKeyControl | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiKeyControl::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiText.
Uint32 GuiKeyControl::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 GuiText.
Uint32 GuiKeyControl::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 GuiKeyControl::onKeyDown | ( | SDL_KeyboardEvent * | ev | ) | [protected, virtual] |
This event is called, when the object has the keyboard focus and a key is pressed down.
ev | the key-down event, that occured |
Reimplemented from UiObject.
void GuiKeyControl::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 GuiText.