GClasses
GClasses::GWidgetImageButton Class Reference

Detailed Description

A button with an image on it. The left half of the image is the unpressed image and the right half is the pressed image.

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetImageButton:
GClasses::GWidgetAtomic GClasses::GWidget

Public Member Functions

 GWidgetImageButton (GWidgetGroup *pParent, int x, int y, GImage *pImage)
 
virtual ~GWidgetImageButton ()
 
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...
 
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

bool m_holding
 
GImage m_image
 
bool m_pressed
 
int m_pressedX
 
int m_pressedY
 
- 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::GWidgetImageButton::GWidgetImageButton ( GWidgetGroup pParent,
int  x,
int  y,
GImage pImage 
)
virtual GClasses::GWidgetImageButton::~GWidgetImageButton ( )
virtual

Member Function Documentation

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

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

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

Reimplemented from GClasses::GWidgetAtomic.

bool GClasses::GWidgetImageButton::isPressed ( )
inline

Returns true if the button is currently pressed.

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

Reimplemented from GClasses::GWidgetAtomic.

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

Reimplemented from GClasses::GWidgetAtomic.

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

Implements GClasses::GWidget.

Member Data Documentation

bool GClasses::GWidgetImageButton::m_holding
protected
GImage GClasses::GWidgetImageButton::m_image
protected
bool GClasses::GWidgetImageButton::m_pressed
protected
int GClasses::GWidgetImageButton::m_pressedX
protected
int GClasses::GWidgetImageButton::m_pressedY
protected