GClasses

GClasses::GWidgetGrid Class Reference

#include <GWidgets.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

virtual void onVertScroll (GWidgetVertScrollBar *pScrollBar)
virtual void onHorizScroll (GWidgetHorizScrollBar *pScrollBar)

Protected Attributes

std::vector< GWidget ** > m_rows
int m_nColumns
int m_nRowHeight
int m_nHeaderHeight
GWidget ** m_pColumnHeaders
int * m_nColumnWidths
GWidgetVertScrollBarm_pVertScrollBar
GWidgetHorizScrollBarm_pHorizScrollBar
unsigned int m_cBackground

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) [protected, virtual]

Reimplemented from GClasses::GWidgetGroup.

virtual void GClasses::GWidgetGrid::onVertScroll ( GWidgetVertScrollBar pScrollBar) [protected, virtual]

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 ( ) [inline, virtual]

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]
std::vector<GWidget**> GClasses::GWidgetGrid::m_rows [protected]