GClasses
GClasses::GWidgetCanvas Class Reference

Detailed Description

A painting canvas.

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetCanvas:
GClasses::GWidgetAtomic GClasses::GWidget

Public Member Functions

 GWidgetCanvas (GWidgetGroup *pParent, int x, int y, int w, int h, GImage *pImage)
 
virtual ~GWidgetCanvas ()
 
virtual void draw (GImage *pCanvas, int x, int y)
 Draws this widget on pCanvas at (x,y) More...
 
void setDirty ()
 
void setHorizScroll (int x)
 
void setImage (GImage *pImage)
 
void setSelectionMask (GImage *pMask)
 Only the alpha channel of the mask is used. The other values should be constant, or else the selection border will cut through the selection. If you change what is selected, you should call this method again, even though it may still be the same mask image. More...
 
void setVertScroll (int y)
 
void setZoom (float f)
 
virtual WidgetType type ()
 
float zoom ()
 
void zoomToFit ()
 
- 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

float m_fZoom
 
int m_nHScroll
 
int m_nMouseX
 
int m_nMouseY
 
int m_nVScroll
 
GImagem_pImageIn
 
bool m_pressed
 
GImagem_pSelectionMask
 
- 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::GWidgetCanvas::GWidgetCanvas ( GWidgetGroup pParent,
int  x,
int  y,
int  w,
int  h,
GImage pImage 
)
virtual GClasses::GWidgetCanvas::~GWidgetCanvas ( )
virtual

Member Function Documentation

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

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

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

Reimplemented from GClasses::GWidgetAtomic.

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

Reimplemented from GClasses::GWidgetAtomic.

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

Reimplemented from GClasses::GWidgetAtomic.

void GClasses::GWidgetCanvas::setDirty ( )
void GClasses::GWidgetCanvas::setHorizScroll ( int  x)
void GClasses::GWidgetCanvas::setImage ( GImage pImage)
void GClasses::GWidgetCanvas::setSelectionMask ( GImage pMask)

Only the alpha channel of the mask is used. The other values should be constant, or else the selection border will cut through the selection. If you change what is selected, you should call this method again, even though it may still be the same mask image.

void GClasses::GWidgetCanvas::setVertScroll ( int  y)
void GClasses::GWidgetCanvas::setZoom ( float  f)
virtual WidgetType GClasses::GWidgetCanvas::type ( )
inlinevirtual

Implements GClasses::GWidget.

float GClasses::GWidgetCanvas::zoom ( )
inline
void GClasses::GWidgetCanvas::zoomToFit ( )

Member Data Documentation

float GClasses::GWidgetCanvas::m_fZoom
protected
int GClasses::GWidgetCanvas::m_nHScroll
protected
int GClasses::GWidgetCanvas::m_nMouseX
protected
int GClasses::GWidgetCanvas::m_nMouseY
protected
int GClasses::GWidgetCanvas::m_nVScroll
protected
GImage* GClasses::GWidgetCanvas::m_pImageIn
protected
bool GClasses::GWidgetCanvas::m_pressed
protected
GImage* GClasses::GWidgetCanvas::m_pSelectionMask
protected