GUI
Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
TextField Class Reference

TextField widget. It's like EditBox but no editing. More...

#include <TextField.h>

Inherits Widget.

Public Member Functions

 TextField ()
 
 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 ()
 
- Public Member Functions inherited from Widget
 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 ()
 
- Public Member Functions inherited from EventEmitter
 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
 
- Protected Attributes inherited from Widget
int x
 
int y
 
int w
 
int h
 
int xAbs
 
int yAbs
 
int state
 
bool focused
 
bool visible
 
GUISystemguiSystem
 

Private Attributes

std::string text
 

Friends

class GUISystem
 

Additional Inherited Members

- Public Types inherited from Widget
enum  states { STATE_HOVER, STATE_DOWN, STATE_UP }
 
typedef char State
 
- Public Types inherited from EventEmitter
typedef std::multimap< EventType, EventListener > Map
 

Detailed Description

TextField widget. It's like EditBox but no editing.

Definition at line 13 of file TextField.h.

Constructor & Destructor Documentation

◆ TextField() [1/2]

TextField::TextField ( )

Definition at line 3 of file TextField.cpp.

◆ TextField() [2/2]

TextField::TextField ( GUISystem guiSystem,
int  x,
int  y,
int  w,
int  h,
std::string  text 
)

Definition at line 8 of file TextField.cpp.

◆ ~TextField()

TextField::~TextField ( )
virtual

Definition at line 15 of file TextField.cpp.

Member Function Documentation

◆ getText()

std::string TextField::getText ( )

Definition at line 33 of file TextField.cpp.

References text.

◆ render()

void TextField::render ( Renderer renderer)
virtual

◆ setText()

void TextField::setText ( const std::string &  text)

Definition at line 28 of file TextField.cpp.

References text.

Friends And Related Function Documentation

◆ GUISystem

friend class GUISystem
friend

Definition at line 30 of file TextField.h.

Member Data Documentation

◆ text

std::string TextField::text
private

Definition at line 28 of file TextField.h.

◆ textColor

Color TextField::textColor
protected

Definition at line 25 of file TextField.h.


The documentation for this class was generated from the following files: