GUI
|
TextField widget. It's like EditBox but no editing. More...
#include <TextField.h>
Inherits gui::Widget.
Public Member Functions | |
TextField (GUISystem *guiSystem, int x, int y, int w, int h, std::string text) | |
virtual | ~TextField () |
void | render (Renderer *renderer) |
void | setText (const std::string &text) |
std::string | getText () |
![]() | |
Widget () | |
Widget (int x, int y, int w, int h) | |
virtual | ~Widget () |
virtual void | keyChar (int uchar) |
virtual void | keyDown (int keyCode) |
virtual void | mouseMove (int x, int y) |
virtual void | stateChange (State state) |
virtual void | focusIn () |
virtual void | focusOut () |
void | addChild (Widget *widget) |
void | removeChild (Widget *widget) |
void | setParent (Widget *widget) |
void | resize (int x, int y, int w, int h) |
void | updateAbs () |
void | setVisibility (bool visible) |
bool | contain (int posX, int posY) |
bool | isFocused () |
State | getState () |
![]() | |
EventEmitter () | |
virtual | ~EventEmitter () |
void | setQueue (AddToQueue addFunction) |
Assigns addToQueue function so the events can be sent to the queue. More... | |
EventListener::Id | addEventListener (EventType eventType, EventListener::Function listenerFunc) |
Adds an event listener. More... | |
void | removeEventListener (EventListener::Id listenerId) |
Removes an event listener. More... | |
void | emitEvent (Event &event) |
Emits an event. More... | |
Protected Attributes | |
Color | textColor |
![]() | |
int | x |
int | y |
int | w |
int | h |
int | xAbs |
int | yAbs |
int | state |
bool | focused |
bool | visible |
![]() | |
GUISystem * | guiSystem |
Private Attributes | |
std::string | text |
Friends | |
class | GUISystem |
Additional Inherited Members | |
![]() | |
enum | states { STATE_HOVER, STATE_DOWN, STATE_UP } |
typedef char | State |
![]() | |
typedef std::multimap< EventType, EventListener > | Map |
TextField widget. It's like EditBox but no editing.
Definition at line 20 of file TextField.h.
TextField::TextField | ( | GUISystem * | guiSystem, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
std::string | text | ||
) |
Definition at line 9 of file TextField.cpp.
|
inlinevirtual |
Definition at line 24 of file TextField.h.
std::string TextField::getText | ( | ) |
Definition at line 28 of file TextField.cpp.
References text.
|
virtual |
Reimplemented from gui::Widget.
Definition at line 15 of file TextField.cpp.
References gui::Renderer::drawText(), gui::Widget::h, gui::Renderer::setTarget(), text, textColor, gui::Widget::w, gui::Widget::x, gui::Widget::xAbs, gui::Widget::y, and gui::Widget::yAbs.
void TextField::setText | ( | const std::string & | text | ) |
Definition at line 23 of file TextField.cpp.
References text.
|
friend |
Definition at line 36 of file TextField.h.
|
private |
Definition at line 34 of file TextField.h.
|
protected |
Definition at line 31 of file TextField.h.