GClasses
GClasses::GWidgetDialog Class Reference

Detailed Description

A form or dialog.

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetDialog:
GClasses::GWidgetGroup GClasses::GWidget

Public Member Functions

 GWidgetDialog (int w, int h, unsigned int cBackground)
 
virtual ~GWidgetDialog ()
 
unsigned int backgroundColor ()
 Returns the background color. More...
 
void close ()
 Sets m_bRunning to false. It's the controller's job to watch this flag and do something about it. More...
 
virtual void draw (GImage *pCanvas, int x, int y)
 Draws this widget on pCanvas at (x,y) More...
 
GWidgetAtomicfocusWidget ()
 Returns the widget that currently has focus. More...
 
GWidgetAtomicgrabbedWidget ()
 Returns the widget that the mouse is currently grabbing. More...
 
virtual void handleChar (char c)
 You should call this method when the user presses a key. More...
 
virtual bool handleMousePos (int x, int y)
 You should call this method when the user moves the mouse. More...
 
virtual void handleSpecialKey (int key)
 You should call this method when the user presses a special key. More...
 
GImageimage ()
 Updates everything that needs to be updated, and makes an image of the dialog in its current state so you can blit it to the screen. More...
 
virtual void onDestroyWidget (GWidget *pWidget)
 
virtual void pressButton (int button, int x, int y)
 You should call this when the user presses a mouse button. More...
 
virtual void releaseButton (int button)
 You should call this method when the mouse releases (un-clicks) More...
 
bool * runningFlag ()
 This method is used when running the dialog as a popup modal dialog. The flag is initialized to true. It is the controller's job to check this flag and close the dialog when it is set to false. More...
 
void setBackgroundImage (GImage *pImage)
 Sets the background image. More...
 
void setFocusWidget (GWidgetAtomic *pWidget)
 Sets the widget with focus. More...
 
virtual WidgetType type ()
 
- Public Member Functions inherited from GClasses::GWidgetGroup
 GWidgetGroup (GWidgetGroup *pParent, int x, int y, int w, int h)
 
virtual ~GWidgetGroup ()
 
GWidgetchildWidget (int n)
 
int childWidgetCount ()
 
virtual GWidgetAtomicfindAtomicWidget (int x, int y)
 
virtual bool isAtomic ()
 
virtual void onCanvasMouseDown (GWidgetCanvas *pCanvas, int button, int x, int y)
 
virtual void onCanvasMouseMove (GWidgetCanvas *pCanvas, int x, int y, bool bPressed)
 
virtual void onCanvasMouseUp (GWidgetCanvas *pCanvas, int button, int x, int y)
 
virtual void onChangeCheckBox (GWidgetCheckBox *pCheckBox)
 
virtual void onChar (char c)
 
virtual void onCheckBulletHole (GWidgetBulletHole *pBullet)
 
virtual void onClickTab (GWidgetSliderTab *pTab)
 
virtual void onClickTextLabel (GWidgetTextLabel *pLabel)
 
virtual void onCustomEvent (GWidget *pWidget)
 
virtual void onHorizScroll (GWidgetHorizScrollBar *pScrollBar)
 
virtual void onHorizSliderMove (GWidgetHorizSlider *pSlider)
 
virtual void onPushTextButton (GWidgetTextButton *pButton)
 
virtual void onPushVCRButton (GWidgetVCRButton *pButton)
 
virtual void onReleaseImageButton (GWidgetImageButton *pButton)
 
virtual void onReleaseTextButton (GWidgetTextButton *pButton)
 
virtual void onSelectFilename (GWidgetFileSystemBrowser *pBrowser, const char *szFilename)
 
virtual void onSelectTextTab (GWidgetTextTab *pTab)
 
virtual void onSlideTab (GWidgetSliderTab *pTab, int dx, int dy)
 
virtual void onSpecialKey (int key)
 
virtual void onTextBoxPressEnter (GWidgetTextBox *pTextBox)
 
virtual void onTextBoxTextChanged (GWidgetTextBox *pTextBox)
 
virtual void onVertScroll (GWidgetVertScrollBar *pScrollBar)
 
virtual void onVertSliderMove (GWidgetVertSlider *pSlider)
 
virtual void tattle (GWidget *pChild)
 
- 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

void grabWidget (GWidgetAtomic *pWidget, int button, int mouseX, int mouseY)
 This is called by pressAt when the user clicks on an atomic widget. More...
 
- Protected Member Functions inherited from GClasses::GWidgetGroup
void addWidget (GWidget *pWidget)
 
bool getDirtyBit (int nBit)
 
void setClean ()
 
void setDirtyBit (int nBit, bool bValue)
 

Protected Attributes

bool m_bRunning
 
unsigned int m_cBackground
 
GImage m_image
 
GWidgetAtomicm_pFocusWidget
 
GWidgetAtomicm_pGrabbedWidget
 
int m_prevMouseX
 
int m_prevMouseY
 
- Protected Attributes inherited from GClasses::GWidgetGroup
std::vector< unsigned int > m_dirtyBits
 
std::vector< GWidget * > m_dirtyChildren
 
std::vector< GWidget * > m_widgets
 
- 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::GWidgetDialog::GWidgetDialog ( int  w,
int  h,
unsigned int  cBackground 
)
virtual GClasses::GWidgetDialog::~GWidgetDialog ( )
virtual

Member Function Documentation

unsigned int GClasses::GWidgetDialog::backgroundColor ( )
inline

Returns the background color.

void GClasses::GWidgetDialog::close ( )
inline

Sets m_bRunning to false. It's the controller's job to watch this flag and do something about it.

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

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

GWidgetAtomic* GClasses::GWidgetDialog::focusWidget ( )
inline

Returns the widget that currently has focus.

GWidgetAtomic* GClasses::GWidgetDialog::grabbedWidget ( )
inline

Returns the widget that the mouse is currently grabbing.

void GClasses::GWidgetDialog::grabWidget ( GWidgetAtomic pWidget,
int  button,
int  mouseX,
int  mouseY 
)
protected

This is called by pressAt when the user clicks on an atomic widget.

virtual void GClasses::GWidgetDialog::handleChar ( char  c)
virtual

You should call this method when the user presses a key.

virtual bool GClasses::GWidgetDialog::handleMousePos ( int  x,
int  y 
)
virtual

You should call this method when the user moves the mouse.

virtual void GClasses::GWidgetDialog::handleSpecialKey ( int  key)
virtual

You should call this method when the user presses a special key.

GImage* GClasses::GWidgetDialog::image ( )

Updates everything that needs to be updated, and makes an image of the dialog in its current state so you can blit it to the screen.

virtual void GClasses::GWidgetDialog::onDestroyWidget ( GWidget pWidget)
virtual

Reimplemented from GClasses::GWidgetGroup.

virtual void GClasses::GWidgetDialog::pressButton ( int  button,
int  x,
int  y 
)
virtual

You should call this when the user presses a mouse button.

virtual void GClasses::GWidgetDialog::releaseButton ( int  button)
virtual

You should call this method when the mouse releases (un-clicks)

bool* GClasses::GWidgetDialog::runningFlag ( )
inline

This method is used when running the dialog as a popup modal dialog. The flag is initialized to true. It is the controller's job to check this flag and close the dialog when it is set to false.

void GClasses::GWidgetDialog::setBackgroundImage ( GImage pImage)

Sets the background image.

void GClasses::GWidgetDialog::setFocusWidget ( GWidgetAtomic pWidget)

Sets the widget with focus.

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

Implements GClasses::GWidget.

Member Data Documentation

bool GClasses::GWidgetDialog::m_bRunning
protected
unsigned int GClasses::GWidgetDialog::m_cBackground
protected
GImage GClasses::GWidgetDialog::m_image
protected
GWidgetAtomic* GClasses::GWidgetDialog::m_pFocusWidget
protected
GWidgetAtomic* GClasses::GWidgetDialog::m_pGrabbedWidget
protected
int GClasses::GWidgetDialog::m_prevMouseX
protected
int GClasses::GWidgetDialog::m_prevMouseY
protected