#include <guitext.h>
Inheritance diagram for GuiTextInput:
Public Member Functions | |
DECLSPEC | GuiTextInput (const SDL_Rect &r, GuiElement *p, const char *name, const char *t=NULL, bool singleline=true) |
DECLSPEC | GuiTextInput (TiXmlElement *el, GuiElement *p) |
virtual const char * | getClassName () |
void | setCallback (Callback c) |
void | setCbData (BasicObject *d) |
DECLSPEC void | setMaxlen (int l) |
Static Public Member Functions | |
static void | newguiobject (void *presult, BasicObject *o, void *xmldata) |
Public Attributes | |
int | bwActive |
int | bwInactive |
Sint32 | cActive |
Sint32 | cInactive |
Static Public Attributes | |
static Uint32 | nBlinkIv |
static char | alpha [] |
static char | ALPHA [] |
static char | altAlpha [] |
static const unsigned int | nKeys |
static const unsigned int | nModKeys |
static char | MOD_LETTER |
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 | onKeyUp (SDL_KeyboardEvent *ev) |
virtual DECLSPEC Uint32 | onFocus (FocusTypes gained) |
virtual DECLSPEC Uint32 | onRelease (FocusTypes lost) |
virtual DECLSPEC void | onInit () |
virtual DECLSPEC Uint32 | onThemeChanged (UiTheme *t) |
Friends | |
class | guiinfo |
GuiTextInput::GuiTextInput | ( | TiXmlElement * | el, | |
GuiElement * | p | |||
) |
Constructor. Uses XML data.
el | the XML data for initialisation, the following attributes are read: MaxLen (int), SingleLine (bool), OnReturn (event) | |
p | parent element (or NULL, to take GuiManager::the as parent) |
virtual const char* GuiTextInput::getClassName | ( | ) | [inline, virtual] |
This function should be overriden in every sub-class of BasicObject!
Reimplemented from GuiText.
void GuiTextInput::setMaxlen | ( | int | l | ) |
Sets the maximum number of letters, the box may contain.
l | the maximum length of the text, -1 for infinite |
Uint32 GuiTextInput::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 GuiTextInput::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 GuiTextInput::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.
Uint32 GuiTextInput::onKeyUp | ( | SDL_KeyboardEvent * | ev | ) | [protected, virtual] |
This event is called, when the object has the keyboard focus and a key is released.
ev | the key-up event, that occured |
Reimplemented from UiObject.
void GuiTextInput::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.
Uint32 GuiTextInput::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 GuiText.