GUI
|
EditBox widget. You can type into it. More...
#include <EditBox.h>
Inherits Widget.
Public Member Functions | |
EditBox (GUISystem *guiSystem, int x, int y, int w, int h) | |
virtual | ~EditBox () |
void | render (Renderer *renderer) |
void | keyChar (int unichar) |
void | keyDown (int keyCode) |
void | setMultiline () |
void | setText (const std::string &text) |
std::string | getText () |
![]() | |
Widget () | |
Widget (int x, int y, int w, int h) | |
virtual | ~Widget () |
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) |
Assings 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) |
Emitts an event. More... | |
Protected Attributes | |
Color | textColor |
Color | frameColor |
Color | backgroundColor |
Color | cursorColor |
int | backspaceCode |
![]() | |
int | x |
int | y |
int | w |
int | h |
int | xAbs |
int | yAbs |
int | state |
bool | focused |
bool | visible |
GUISystem * | guiSystem |
Private Member Functions | |
void | updateScrollbars () |
void | getCursorXY (Renderer *renderer, int &cursorX, int &cursorY) |
void | findCursorLine () |
void | countLines () |
Private Attributes | |
Handle< Scrollbar > | hScrollbar |
Handle< Scrollbar > | vScrollbar |
std::string | text |
unsigned int | cursorPos |
unsigned int | cursorLine |
int | lines |
float | lineHeight |
bool | multiline |
bool | hScroll |
bool | vScroll |
Friends | |
class | GUISystem |
Additional Inherited Members | |
![]() | |
enum | states { STATE_HOVER, STATE_DOWN, STATE_UP } |
typedef char | State |
![]() | |
typedef std::multimap< EventType, EventListener > | Map |
EditBox::EditBox | ( | GUISystem * | guiSystem, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 6 of file EditBox.cpp.
References hScrollbar, and vScrollbar.
|
virtual |
Definition at line 26 of file EditBox.cpp.
|
private |
Definition at line 173 of file EditBox.cpp.
|
private |
Definition at line 162 of file EditBox.cpp.
References cursorLine, cursorPos, and text.
|
private |
Definition at line 142 of file EditBox.cpp.
References cursorLine, cursorPos, Renderer::getTextWidth(), lineHeight, and text.
std::string EditBox::getText | ( | ) |
Definition at line 115 of file EditBox.cpp.
References text.
|
virtual |
Reimplemented from Widget.
Definition at line 57 of file EditBox.cpp.
References countLines(), cursorPos, findCursorLine(), text, and updateScrollbars().
|
virtual |
Reimplemented from Widget.
Definition at line 74 of file EditBox.cpp.
References countLines(), cursorPos, findCursorLine(), KEY_BACKSPACE, KEY_ENTER, KEY_LEFT, KEY_RIGHT, multiline, text, and updateScrollbars().
|
virtual |
Reimplemented from Widget.
Definition at line 31 of file EditBox.cpp.
References backgroundColor, cursorColor, Renderer::drawFilledRect(), Renderer::drawLine(), Renderer::drawMultilineText(), Renderer::drawRect(), Widget::focused, frameColor, getCursorXY(), Renderer::getLineHeight(), Widget::h, lineHeight, lines, Renderer::setTarget(), text, textColor, vScrollbar, Widget::w, Widget::x, Widget::xAbs, Widget::y, and Widget::yAbs.
void EditBox::setMultiline | ( | ) |
Definition at line 104 of file EditBox.cpp.
References multiline.
void EditBox::setText | ( | const std::string & | text | ) |
Definition at line 109 of file EditBox.cpp.
References countLines(), and text.
|
private |
Definition at line 120 of file EditBox.cpp.
References Widget::h, lineHeight, lines, vScroll, and vScrollbar.