GClasses
GClasses::GWidgetTextBox Class Reference

Detailed Description

This is a box in which the user can enter text.

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetTextBox:
GClasses::GWidgetAtomic GClasses::GWidget

Public Member Functions

 GWidgetTextBox (GWidgetGroup *pParent, int x, int y, int w, int h)
 
virtual ~GWidgetTextBox ()
 
virtual void draw (GImage *pCanvas, int x, int y)
 Draws this widget on pCanvas at (x,y) More...
 
virtual void onChar (char c)
 
virtual void onSpecialKey (int key)
 
void setColor (unsigned int c)
 
void setPassword ()
 Sets whether or not it should display a bunch of '#'s instead of the current text. More...
 
void SetSelection (int anchorPos, int cursorPos)
 Sets the cursor position and selection. More...
 
void setText (const char *szText)
 Sets the text in this text box. More...
 
void setText (int nValue)
 
void setText (double dValue)
 
const std::string & text ()
 Returns the current contents of this text box. More...
 
virtual WidgetType type ()
 
- Public Member Functions inherited from GClasses::GWidgetAtomic
 GWidgetAtomic (GWidgetGroup *pParent, int x, int y, int w, int h)
 
virtual ~GWidgetAtomic ()
 
virtual bool isAtomic ()
 
virtual bool isClickable ()
 
- Public Member Functions inherited from GClasses::GWidget
 GWidget (GWidgetGroup *m_pParent, int x, int y, int w, int h)
 
virtual ~GWidget ()
 
int id ()
 
GWidgetGroupparent ()
 
GRectrect ()
 
void setPos (int x, int y)
 

Protected Member Functions

virtual void grab (int button, int x, int y)
 
virtual void onGetFocus ()
 
virtual void onLoseFocus ()
 
virtual void onMouseMove (int dx, int dy)
 
virtual void release (int button)
 

Protected Attributes

bool m_bGotFocus
 
bool m_bPassword
 
unsigned int m_cBackground
 
int m_nAnchorPos
 
int m_nCursorPos
 
int m_nMouseDelta
 
std::string m_text
 
- Protected Attributes inherited from GClasses::GWidget
GWidgetCommonm_common
 
int m_nID
 
GWidgetGroupm_pParent
 
GRect m_rect
 

Additional Inherited Members

- Public Types inherited from GClasses::GWidget

Constructor & Destructor Documentation

GClasses::GWidgetTextBox::GWidgetTextBox ( GWidgetGroup pParent,
int  x,
int  y,
int  w,
int  h 
)
virtual GClasses::GWidgetTextBox::~GWidgetTextBox ( )
virtual

Member Function Documentation

virtual void GClasses::GWidgetTextBox::draw ( GImage pCanvas,
int  x,
int  y 
)
virtual

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

virtual void GClasses::GWidgetTextBox::grab ( int  button,
int  x,
int  y 
)
protectedvirtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::onChar ( char  c)
virtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::onGetFocus ( )
protectedvirtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::onLoseFocus ( )
protectedvirtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::onMouseMove ( int  dx,
int  dy 
)
protectedvirtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::onSpecialKey ( int  key)
virtual

Reimplemented from GClasses::GWidgetAtomic.

virtual void GClasses::GWidgetTextBox::release ( int  button)
protectedvirtual

Reimplemented from GClasses::GWidgetAtomic.

void GClasses::GWidgetTextBox::setColor ( unsigned int  c)
void GClasses::GWidgetTextBox::setPassword ( )
inline

Sets whether or not it should display a bunch of '#'s instead of the current text.

void GClasses::GWidgetTextBox::SetSelection ( int  anchorPos,
int  cursorPos 
)

Sets the cursor position and selection.

void GClasses::GWidgetTextBox::setText ( const char *  szText)

Sets the text in this text box.

void GClasses::GWidgetTextBox::setText ( int  nValue)
void GClasses::GWidgetTextBox::setText ( double  dValue)
const std::string& GClasses::GWidgetTextBox::text ( )
inline

Returns the current contents of this text box.

virtual WidgetType GClasses::GWidgetTextBox::type ( )
inlinevirtual

Implements GClasses::GWidget.

Member Data Documentation

bool GClasses::GWidgetTextBox::m_bGotFocus
protected
bool GClasses::GWidgetTextBox::m_bPassword
protected
unsigned int GClasses::GWidgetTextBox::m_cBackground
protected
int GClasses::GWidgetTextBox::m_nAnchorPos
protected
int GClasses::GWidgetTextBox::m_nCursorPos
protected
int GClasses::GWidgetTextBox::m_nMouseDelta
protected
std::string GClasses::GWidgetTextBox::m_text
protected