CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csGrid Class Reference
[Grid]

This is the grid object itself. More...

#include <csgrid.h>

Inheritance diagram for csGrid:

csComponent List of all members.

Public Methods

 csGrid (csComponent *pParent, int nRows, int nCols, int iStyle=CSGS_DEFAULTVALUE|CSGVS_DEFAULTVALUE)
 Create a grid with given number of rows & columns.

virtual ~csGrid ()
 Destroy the grid object.

virtual void SetCursorStyle (int iCursorStyle=CSGCS_NONE)
 Set a cursor style.

virtual int GetCursorStyle ()
 Get cursor style.

virtual void GetCursorPos (int &row, int &col)
 Get cursor position.

virtual void SetCursorPos (int row, int col)
 Set cursor position.

virtual void Draw ()
 Draw the grid.

virtual bool SetRect (int xmin, int ymin, int xmax, int ymax)
 Set grid size and position.

virtual void FixSize (int &newW, int &newH)
 Do not allow to resize us less than needed by scrollbars.

virtual void SuggestSize (int &w, int &h)
 Suggest the optimal size for the grid.

virtual bool HandleEvent (iEvent &Event)
 Handle events.

void CreateRegion (csRect &rc, csGridCell *cell)
 Create a grid region.

csGridViewGetRootView ()
 Get the first grid view object.

csGridViewGetActiveView ()
 Get the active grid view.

void SetActiveView (csGridView *view)
 Set the active grid view.

virtual void SetStringAt (int row, int col, const char *data)
 Set string to display in specified cell.


Protected Methods

void CalcMinimalSize (csRegionTree2D *node, int &w, int &h)
 Calculate minimal size needed for given region.

void PlaceGadgets ()
 Place the dividers when the grid size changes.


Protected Attributes

csSparseGridgrid
 The grid data.

csArray< csGridView * > vViews
 The array of grid views.

csGridViewactiveView
 The actiove grid view.

csArray< csGridCell * > vRegionStyles
 A vector containing the pattern csGridCell for every region;.

csSplittersplitterX
 The horizontal and vertical dividers.

csSplittersplitterY
 The horizontal and vertical dividers.

int cursorStyle
 cursor style

int xcur
 cursor position

int ycur
 cursor position


Detailed Description

This is the grid object itself.

The grid object can contain a number of vertically and horizontally split subviews (called "grid views"), each subview may be limited to certain area within the grid itself.

Definition at line 379 of file csgrid.h.


Constructor & Destructor Documentation

csGrid::csGrid csComponent   pParent,
int    nRows,
int    nCols,
int    iStyle = CSGS_DEFAULTVALUE|CSGVS_DEFAULTVALUE
 

Create a grid with given number of rows & columns.

virtual csGrid::~csGrid   [virtual]
 

Destroy the grid object.


Member Function Documentation

void csGrid::CalcMinimalSize csRegionTree2D *    node,
int &    w,
int &    h
[protected]
 

Calculate minimal size needed for given region.

void csGrid::CreateRegion csRect   rc,
csGridCell   cell
 

Create a grid region.

virtual void csGrid::Draw   [virtual]
 

Draw the grid.

Reimplemented from csComponent.

virtual void csGrid::FixSize int &    newW,
int &    newH
[virtual]
 

Do not allow to resize us less than needed by scrollbars.

Reimplemented from csComponent.

csGridView* csGrid::GetActiveView   [inline]
 

Get the active grid view.

Definition at line 445 of file csgrid.h.

virtual void csGrid::GetCursorPos int &    row,
int &    col
[virtual]
 

Get cursor position.

virtual int csGrid::GetCursorStyle   [virtual]
 

Get cursor style.

csGridView* csGrid::GetRootView   [inline]
 

Get the first grid view object.

Definition at line 442 of file csgrid.h.

References csArray< T, ElementHandler, MemoryAllocator >::Get().

virtual bool csGrid::HandleEvent iEvent   Event [virtual]
 

Handle events.

Reimplemented from csComponent.

void csGrid::PlaceGadgets   [protected]
 

Place the dividers when the grid size changes.

void csGrid::SetActiveView csGridView   view
 

Set the active grid view.

virtual void csGrid::SetCursorPos int    row,
int    col
[virtual]
 

Set cursor position.

virtual void csGrid::SetCursorStyle int    iCursorStyle = CSGCS_NONE [virtual]
 

Set a cursor style.

virtual bool csGrid::SetRect int    xmin,
int    ymin,
int    xmax,
int    ymax
[virtual]
 

Set grid size and position.

Reimplemented from csComponent.

virtual void csGrid::SetStringAt int    row,
int    col,
const char *    data
[virtual]
 

Set string to display in specified cell.

virtual void csGrid::SuggestSize int &    w,
int &    h
[virtual]
 

Suggest the optimal size for the grid.

Reimplemented from csComponent.


Member Data Documentation

csGridView* csGrid::activeView [protected]
 

The actiove grid view.

Definition at line 390 of file csgrid.h.

int csGrid::cursorStyle [protected]
 

cursor style

Definition at line 396 of file csgrid.h.

csSparseGrid* csGrid::grid [protected]
 

The grid data.

Definition at line 386 of file csgrid.h.

csSplitter* csGrid::splitterX [protected]
 

The horizontal and vertical dividers.

Definition at line 394 of file csgrid.h.

csSplitter * csGrid::splitterY [protected]
 

The horizontal and vertical dividers.

Definition at line 394 of file csgrid.h.

csArray<csGridCell*> csGrid::vRegionStyles [protected]
 

A vector containing the pattern csGridCell for every region;.

Definition at line 392 of file csgrid.h.

csArray<csGridView*> csGrid::vViews [protected]
 

The array of grid views.

Definition at line 388 of file csgrid.h.

int csGrid::xcur [protected]
 

cursor position

Definition at line 398 of file csgrid.h.

int csGrid::ycur [protected]
 

cursor position

Definition at line 398 of file csgrid.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18