GClasses
GClasses::GWidgetTextButton Class Reference

Detailed Description

A button with text on it.

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetTextButton:
GClasses::GWidgetAtomic GClasses::GWidget

Public Member Functions

 GWidgetTextButton (GWidgetGroup *pParent, int x, int y, int w, int h, const char *szText)
 
virtual ~GWidgetTextButton ()
 
virtual void draw (GImage *pCanvas, int x, int y)
 Draws this widget on pCanvas at (x,y) More...
 
bool isPressed ()
 returns "true" if the button is currently pressed More...
 
void setColor (unsigned int c)
 sets the button color More...
 
void setText (const char *szText)
 sets the button text 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 ()
 
virtual void onChar (char c)
 
virtual void onGetFocus ()
 
virtual void onLoseFocus ()
 
virtual void onSpecialKey (int key)
 
- 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 onMouseMove (int dx, int dy)
 
virtual void release (int button)
 

Protected Attributes

unsigned int m_color
 
bool m_holding
 
bool m_pressed
 
int m_pressedX
 
int m_pressedY
 
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::GWidgetTextButton::GWidgetTextButton ( GWidgetGroup pParent,
int  x,
int  y,
int  w,
int  h,
const char *  szText 
)
virtual GClasses::GWidgetTextButton::~GWidgetTextButton ( )
virtual

Member Function Documentation

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

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

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

Reimplemented from GClasses::GWidgetAtomic.

bool GClasses::GWidgetTextButton::isPressed ( )
inline

returns "true" if the button is currently pressed

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

Reimplemented from GClasses::GWidgetAtomic.

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

Reimplemented from GClasses::GWidgetAtomic.

void GClasses::GWidgetTextButton::setColor ( unsigned int  c)

sets the button color

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

sets the button text

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

Implements GClasses::GWidget.

Member Data Documentation

unsigned int GClasses::GWidgetTextButton::m_color
protected
bool GClasses::GWidgetTextButton::m_holding
protected
bool GClasses::GWidgetTextButton::m_pressed
protected
int GClasses::GWidgetTextButton::m_pressedX
protected
int GClasses::GWidgetTextButton::m_pressedY
protected
std::string GClasses::GWidgetTextButton::m_text
protected