GClasses
GClasses::GWidgetGrid Class Reference

#include <GWidgets.h>

Inheritance diagram for GClasses::GWidgetGrid:
GClasses::GWidgetGroup GClasses::GWidget

Public Member Functions

 GWidgetGrid (GWidgetGroup *pParent, int nColumns, int x, int y, int w, int h, unsigned int cBackground=0xff000000)
 
virtual ~GWidgetGrid ()
 
void addBlankRow ()
 Adds an empty row to the grid. More...
 
int columnCount ()
 Returns the number of columns. More...
 
GWidgetcolumnHeader (int col)
 Sets the widget in a column header. More...
 
int columnWidth (int col)
 Gets the width of a column. More...
 
virtual void draw (GImage *pCanvas, int x, int y)
 Draws this widget on pCanvas at (x,y) More...
 
virtual GWidgetAtomicfindAtomicWidget (int x, int y)
 
void flushItems (bool deleteWidgets=true)
 Deletes all the rows and all the widgets in them. More...
 
int headerHeight ()
 
int hScrollPos ()
 
int rowCount ()
 Returns the number of rows. More...
 
int rowHeight ()
 
void setColumnCount (int n)
 Sets the number of columns (preserving any widgets that still fit in the new grid) More...
 
void setColumnHeader (int col, GWidget *pWidget)
 Gets the widget in a column header. More...
 
void setColumnWidth (int col, int nWidth)
 Sets the width of a column. More...
 
void setHeaderHeight (int n)
 
void setHScrollPos (int n)
 
void setRowHeight (int n)
 
void setVScrollPos (int n)
 
void setWidget (int col, int row, GWidget *pWidget)
 Sets the widget in the specified cell. More...
 
virtual void tattle (GWidget *pChild)
 
virtual WidgetType type ()
 
int vScrollPos ()
 
GWidgetwidget (int col, int row)
 Gets the widget in the specified cell. More...
 
- 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 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 onDestroyWidget (GWidget *pWidget)
 
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 onVertSliderMove (GWidgetVertSlider *pSlider)
 
- 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 onHorizScroll (GWidgetHorizScrollBar *pScrollBar)
 
virtual void onVertScroll (GWidgetVertScrollBar *pScrollBar)
 
- 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

unsigned int m_cBackground
 
int m_nColumns
 
int * m_nColumnWidths
 
int m_nHeaderHeight
 
int m_nRowHeight
 
GWidget ** m_pColumnHeaders
 
GWidgetHorizScrollBarm_pHorizScrollBar
 
GWidgetVertScrollBarm_pVertScrollBar
 
std::vector< GWidget ** > m_rows
 
- 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::GWidgetGrid::GWidgetGrid ( GWidgetGroup pParent,
int  nColumns,
int  x,
int  y,
int  w,
int  h,
unsigned int  cBackground = 0xff000000 
)
virtual GClasses::GWidgetGrid::~GWidgetGrid ( )
virtual

Member Function Documentation

void GClasses::GWidgetGrid::addBlankRow ( )

Adds an empty row to the grid.

int GClasses::GWidgetGrid::columnCount ( )
inline

Returns the number of columns.

GWidget* GClasses::GWidgetGrid::columnHeader ( int  col)

Sets the widget in a column header.

int GClasses::GWidgetGrid::columnWidth ( int  col)

Gets the width of a column.

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

Draws this widget on pCanvas at (x,y)

Implements GClasses::GWidget.

virtual GWidgetAtomic* GClasses::GWidgetGrid::findAtomicWidget ( int  x,
int  y 
)
virtual

Reimplemented from GClasses::GWidgetGroup.

void GClasses::GWidgetGrid::flushItems ( bool  deleteWidgets = true)

Deletes all the rows and all the widgets in them.

int GClasses::GWidgetGrid::headerHeight ( )
inline
int GClasses::GWidgetGrid::hScrollPos ( )
inline
virtual void GClasses::GWidgetGrid::onHorizScroll ( GWidgetHorizScrollBar pScrollBar)
protectedvirtual

Reimplemented from GClasses::GWidgetGroup.

virtual void GClasses::GWidgetGrid::onVertScroll ( GWidgetVertScrollBar pScrollBar)
protectedvirtual

Reimplemented from GClasses::GWidgetGroup.

int GClasses::GWidgetGrid::rowCount ( )

Returns the number of rows.

int GClasses::GWidgetGrid::rowHeight ( )
inline
void GClasses::GWidgetGrid::setColumnCount ( int  n)

Sets the number of columns (preserving any widgets that still fit in the new grid)

void GClasses::GWidgetGrid::setColumnHeader ( int  col,
GWidget pWidget 
)

Gets the widget in a column header.

void GClasses::GWidgetGrid::setColumnWidth ( int  col,
int  nWidth 
)

Sets the width of a column.

void GClasses::GWidgetGrid::setHeaderHeight ( int  n)
void GClasses::GWidgetGrid::setHScrollPos ( int  n)
void GClasses::GWidgetGrid::setRowHeight ( int  n)
void GClasses::GWidgetGrid::setVScrollPos ( int  n)
void GClasses::GWidgetGrid::setWidget ( int  col,
int  row,
GWidget pWidget 
)

Sets the widget in the specified cell.

virtual void GClasses::GWidgetGrid::tattle ( GWidget pChild)
virtual

Reimplemented from GClasses::GWidgetGroup.

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

Implements GClasses::GWidget.

int GClasses::GWidgetGrid::vScrollPos ( )
inline
GWidget* GClasses::GWidgetGrid::widget ( int  col,
int  row 
)

Gets the widget in the specified cell.

Member Data Documentation

unsigned int GClasses::GWidgetGrid::m_cBackground
protected
int GClasses::GWidgetGrid::m_nColumns
protected
int* GClasses::GWidgetGrid::m_nColumnWidths
protected
int GClasses::GWidgetGrid::m_nHeaderHeight
protected
int GClasses::GWidgetGrid::m_nRowHeight
protected
GWidget** GClasses::GWidgetGrid::m_pColumnHeaders
protected
GWidgetHorizScrollBar* GClasses::GWidgetGrid::m_pHorizScrollBar
protected
GWidgetVertScrollBar* GClasses::GWidgetGrid::m_pVertScrollBar
protected
std::vector<GWidget**> GClasses::GWidgetGrid::m_rows
protected