CrystalSpace

Public API Reference

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

csGridView Class Reference
[Grid]

The GridView displays a continuous rectangular region of the grid. More...

#include <csgrid.h>

Inheritance diagram for csGridView:

csComponent List of all members.

Public Methods

 csGridView (csGrid *pParent, const csRect &region, int iStyle=CSGVS_DEFAULTVALUE)
 Create a grid view covering given subregion of the grid. More...

 csGridView (const csGridView &view, int iStyle=-1)
 Create a copy of given grid view, and copy its style (or use a new style). More...

virtual void Draw ()
 Draw the grid view. More...

virtual bool HandleEvent (iEvent &Event)
 Handle a event. More...

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

const csRectGetArea ()
 return this views area. More...

virtual void FixSize (int &newW, int &newH)
 Snap size to nearest grid cell. More...

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

csGridView * SplitX (int x, int iStyle=-1)
 Create a new grid view by splitting this view along X axis. More...

csGridView * SplitY (int y, int iStyle=-1)
 Create a new grid view by splitting this view along Y axis. More...

void SetViewArea (const csRect &rc)
 Restrict the area that this view can display. More...


Public Attributes

float areafactor
 if view was split and this is the newly created view, then this value tells us what part of the old area this one covers - needed for resizing view hierachy. More...


Protected Methods

void CooAt (int theX, int theY, int &theRow, int &theCol)
 get the row and column at the pixel (theX, theY). More...

virtual csGridView * CreateCopy (int iStyle)
 Create a new copy of this view. More...

void PlaceItems ()
 Place all the items in their places. More...


Protected Attributes

csRect area
 The subcells this view is restricted to. More...

csGridpGrid
 The parent grid object. More...

int row
 Row and column of the first visible cell (upper left). More...

int col
 Row and column of the first visible cell (upper left). More...

bool fPlaceItems
 True if items should be re-positioned (due to a new item inserted etc). More...

int Style
 The style of this view. More...

csScrollBarhscroll
 The horizontal and vertical scrollbar objects. More...

csScrollBarvscroll
 The horizontal and vertical scrollbar objects. More...


Detailed Description

The GridView displays a continuous rectangular region of the grid.

It can be subdivided horizontally or vertically into two smaller views, and can contain a horizontal and a vertical scrollbar for scrolling the contents of the grid.

Definition at line 276 of file csgrid.h.


Constructor & Destructor Documentation

csGridView::csGridView csGrid   pParent,
const csRect   region,
int    iStyle = CSGVS_DEFAULTVALUE
 

Create a grid view covering given subregion of the grid.

csGridView::csGridView const csGridView &    view,
int    iStyle = -1
 

Create a copy of given grid view, and copy its style (or use a new style).


Member Function Documentation

void csGridView::CooAt int    theX,
int    theY,
int &    theRow,
int &    theCol
[protected]
 

get the row and column at the pixel (theX, theY).

virtual csGridView* csGridView::CreateCopy int    iStyle [protected, virtual]
 

Create a new copy of this view.

virtual void csGridView::Draw   [virtual]
 

Draw the grid view.

Reimplemented from csComponent.

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

Snap size to nearest grid cell.

Reimplemented from csComponent.

const csRect& csGridView::GetArea   [inline]
 

return this views area.

Definition at line 316 of file csgrid.h.

virtual bool csGridView::HandleEvent iEvent   Event [virtual]
 

Handle a event.

Reimplemented from csComponent.

void csGridView::PlaceItems   [protected]
 

Place all the items in their places.

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

Set grid view position and size.

Reimplemented from csComponent.

void csGridView::SetViewArea const csRect   rc [inline]
 

Restrict the area that this view can display.

Definition at line 336 of file csgrid.h.

References csRect::Set, csRect::xmax, csRect::xmin, csRect::ymax, and csRect::ymin.

csGridView* csGridView::SplitX int    x,
int    iStyle = -1
 

Create a new grid view by splitting this view along X axis.

If values are not positive the split in that direction does not happen.

csGridView* csGridView::SplitY int    y,
int    iStyle = -1
 

Create a new grid view by splitting this view along Y axis.

If values are not positive the split in that direction does not happen.

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

Suggest the optimal size for this grid view.

Reimplemented from csComponent.


Member Data Documentation

csRect csGridView::area [protected]
 

The subcells this view is restricted to.

Definition at line 280 of file csgrid.h.

float csGridView::areafactor
 

if view was split and this is the newly created view, then this value tells us what part of the old area this one covers - needed for resizing view hierachy.

Definition at line 301 of file csgrid.h.

int csGridView::col [protected]
 

Row and column of the first visible cell (upper left).

Definition at line 284 of file csgrid.h.

bool csGridView::fPlaceItems [protected]
 

True if items should be re-positioned (due to a new item inserted etc).

Definition at line 286 of file csgrid.h.

csScrollBar* csGridView::hscroll [protected]
 

The horizontal and vertical scrollbar objects.

Definition at line 290 of file csgrid.h.

csGrid* csGridView::pGrid [protected]
 

The parent grid object.

Definition at line 282 of file csgrid.h.

int csGridView::row [protected]
 

Row and column of the first visible cell (upper left).

Definition at line 284 of file csgrid.h.

int csGridView::Style [protected]
 

The style of this view.

Definition at line 288 of file csgrid.h.

csScrollBar * csGridView::vscroll [protected]
 

The horizontal and vertical scrollbar objects.

Definition at line 290 of file csgrid.h.


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