GUI
|
EditBox widget. You can type into it. More...
#include <EditBox.h>
Inherits gui::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) |
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 |
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 > | vScrollbar |
Handle< Scrollbar > | hScrollbar |
std::string | text |
unsigned int | cursorPos |
unsigned int | cursorLine |
int | lines |
float | lineHeight |
bool | multiline |
bool | vScroll |
bool | hScroll |
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 14 of file EditBox.cpp.
References hScrollbar, and vScrollbar.
|
inlinevirtual |
|
private |
Definition at line 174 of file EditBox.cpp.
|
private |
Definition at line 163 of file EditBox.cpp.
References cursorLine, cursorPos, and text.
|
private |
Definition at line 143 of file EditBox.cpp.
References cursorLine, cursorPos, gui::Renderer::getTextWidth(), lineHeight, and text.
std::string EditBox::getText | ( | ) |
Definition at line 116 of file EditBox.cpp.
References text.
|
virtual |
Reimplemented from gui::Widget.
Definition at line 60 of file EditBox.cpp.
References countLines(), cursorPos, findCursorLine(), text, and updateScrollbars().
|
virtual |
Reimplemented from gui::Widget.
Definition at line 77 of file EditBox.cpp.
References countLines(), cursorPos, findCursorLine(), KEY_BACKSPACE, KEY_ENTER, KEY_LEFT, KEY_RIGHT, multiline, text, and updateScrollbars().
|
virtual |
Reimplemented from gui::Widget.
Definition at line 34 of file EditBox.cpp.
References backgroundColor, cursorColor, gui::Renderer::drawFilledRect(), gui::Renderer::drawLine(), gui::Renderer::drawMultilineText(), gui::Renderer::drawRect(), gui::Widget::focused, frameColor, getCursorXY(), gui::Renderer::getLineHeight(), gui::Widget::h, lineHeight, lines, gui::Renderer::setTarget(), text, textColor, vScrollbar, gui::Widget::w, gui::Widget::x, gui::Widget::xAbs, gui::Widget::y, and gui::Widget::yAbs.
void EditBox::setMultiline | ( | ) |
Definition at line 105 of file EditBox.cpp.
References multiline.
void EditBox::setText | ( | const std::string & | text | ) |
Definition at line 110 of file EditBox.cpp.
References countLines(), and text.
|
private |
Definition at line 121 of file EditBox.cpp.
References gui::Widget::h, lineHeight, lines, vScroll, and vScrollbar.