wx.GridCtrl.Extended.BaseGridModel Class Reference

Inheritance diagram for wx.GridCtrl.Extended.BaseGridModel:

wx.GridCtrl.Extended.IGridModel wx.GridCtrl.Extended.SparseGridModel

List of all members.

Public Member Functions

CellAttr GetCellAttrs (Point cellCoord)
abstract string GetColumnLabel (int rowIndex)
CellAttr GetColumnLabelAttrs (int columnIndex)
abstract string GetRowLabel (int rowIndex)
CellAttr GetRowLabelAttrs (int rowIndex)
abstract object GetValue (Point cellCoord)
virtual bool SetCellAttrs (Point cellCoord, CellAttr attr)
abstract bool SetColumnLabel (int columnIndex, string newLabel)
abstract bool SetRowLabel (int rowIndex, string newLabel)
abstract bool SetValue (Point cellCoord, object value)
virtual void UpdateValues (int minRowIndex, int maxRowIndex, int minColumnIndex, int maxColumnIndex)

Public Attributes

event
GridCellAttrChangedEventHandler 
OnAttributesChanged
event
GridCellAttributesEventHandler 
OnGetGridCellAttributes
event
GridCellValueChangedEventHandler 
OnLabelChanged
event
GridCellValueChangedEventHandler 
OnValueChanged

Protected Types

enum  Style

Protected Member Functions

 BaseGridModel (Style style, int noOfColumns, int noOfRows)
void RaiseGridCellValueChangedEvent (Point cellCoord, object newValue, object oldValue)
void RaiseOnCallLabelChanged (Point cellCoord, string newLabel, string oldLabel)

Properties

virtual
GridCellLayoutSpecification 
CellLayout [get]
virtual
ColumnPropertiesCollection 
ColumnProperties [get]
CellAttr DefaultLabelAttr [get, set]
virtual
RowPropertiesCollection 
RowProperties [get]


Detailed Description

Class implementing reusable methods managing column properties and row properties. You only have to implement GetValue() in order to get a valid and fully functional grid model.

Member Enumeration Documentation

enum wx::GridCtrl::Extended::BaseGridModel::Style [protected]

Some style flags for the model.

Enumerator:
StaticNumberOfColumns  The number of columns os fixed and cannot be changed. This is the default.
DynamicNumberOfColumns  The number of columns can change. Models using this style shall add a handler of the ColumnPropertyCollection.OnChanging event.
StaticNumberOfRows  The number of rows os fixed and cannot be changed. This is the default.
DynamicNumberOfRows  The number of rows can change. Models using this style shall add a handler of the RowPropertyCollection.OnChanging event.
List 
Choice 
TOOLBAR 
CONTENTS 
INDEX 
SEARCH 
BOOKMARKS 
OPEN_FILES 
PRINT 
FLAT_TOOLBAR 
MERGE_BOOKS 
ICONS_BOOK 
ICONS_BOOK_CHAPTER 
ICONS_FOLDER  this is 0 since it is default
DEFAULT_STYLE 


Constructor & Destructor Documentation

wx.GridCtrl.Extended.BaseGridModel.BaseGridModel ( Style  style,
int  noOfColumns,
int  noOfRows 
) [protected]

Creates an instance.

Parameters:
style 
noOfColumns Number of initially valid columns. This should be the valid number
noOfRows 


Member Function Documentation

CellAttr wx.GridCtrl.Extended.BaseGridModel.GetCellAttrs ( Point  cellCoord  ) 

The display attribute directly associated to a grid cell. These attributes will overide the default attributes of the grid, the attributes associated with the column, and the attributes associated with the row.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

abstract string wx.GridCtrl.Extended.BaseGridModel.GetColumnLabel ( int  rowIndex  )  [pure virtual]

Returns an object hat is the column label. This may be null if unknown or undefined.

Parameters:
columnIndex the index of the labelled column.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

CellAttr wx.GridCtrl.Extended.BaseGridModel.GetColumnLabelAttrs ( int  columnIndex  ) 

These are the display properties to display the column label of the designated column.

Parameters:
columnIndex The labelled column.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

abstract string wx.GridCtrl.Extended.BaseGridModel.GetRowLabel ( int  rowIndex  )  [pure virtual]

Returns an object hat is the row label. This may be null if unknown or undefined.

Parameters:
rowIndex the index of the labelled row.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

CellAttr wx.GridCtrl.Extended.BaseGridModel.GetRowLabelAttrs ( int  rowIndex  ) 

These are the display properties to display the row label of the designated row.

Parameters:
rowIndex The labelled row.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

abstract object wx.GridCtrl.Extended.BaseGridModel.GetValue ( Point  cellCoord  )  [pure virtual]

The value of a grid cell.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index.
Exceptions:
System.IndexOutOfRangeException If rowIndex or columnIndex is negative or equal to or larger than the number of rows or columns repectively.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

void wx.GridCtrl.Extended.BaseGridModel.RaiseGridCellValueChangedEvent ( Point  cellCoord,
object  newValue,
object  oldValue 
) [protected]

This will raise the ValueChanged event with the provided arguments.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index.
newValue The new value of the changed cell.
oldValue The old value f the changed cell.

void wx.GridCtrl.Extended.BaseGridModel.RaiseOnCallLabelChanged ( Point  cellCoord,
string  newLabel,
string  oldLabel 
) [protected]

Call this to raise a OnLabelChanged event.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index. X shall be -1 if this indicates the change of a row label. Y shall be -1 if this indicated the change of a column label.
newLabel The new label. This is null if the label has been removed.
oldLabel The old label. This is null if this label has been undefined in advance.
OnLabelChanged

virtual bool wx.GridCtrl.Extended.BaseGridModel.SetCellAttrs ( Point  cellCoord,
CellAttr  attr 
) [virtual]

Assigns display attributes to the cell. Please note, that the grid model also provides the opportunity to use the cell attribute event.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index.
attr The attribute that will be assigned. This can be null. In that case, any cell specific attributes will be removed. All attributes of this cell will be read from the grid, the column, or the row properties. Please note, that this instance will be made readonly.
Returns:
True if this has been successful. False if this is either not allowed or not implemented.

Implements wx.GridCtrl.Extended.IGridModel.

abstract bool wx.GridCtrl.Extended.BaseGridModel.SetColumnLabel ( int  columnIndex,
string  newLabel 
) [pure virtual]

Sets the column label.

Parameters:
columnIndex The index of the labelled column.
newLabel The new label.
Returns:

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

abstract bool wx.GridCtrl.Extended.BaseGridModel.SetRowLabel ( int  rowIndex,
string  newLabel 
) [pure virtual]

Sets the row label.

Parameters:
rowIndex The index of the labelled row.
newLabel The new row label.
Returns:
True if successful. False if either not allowed or not implemented.

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

abstract bool wx.GridCtrl.Extended.BaseGridModel.SetValue ( Point  cellCoord,
object  value 
) [pure virtual]

Assign a value to a cell. This will fire a ValueChanged event.

Parameters:
cellCoord The coordinates of the grid cell. The X coordinate provides the column index, the Y coordinate is the row index.
value The value that will be assigned to the cell.
Returns:
True if this has been successful. False if this is wither not allowed or not implemented.
Exceptions:
System.ArgumentException Throw an exception of this kind if the value does not fit into the cell. The message of this exception shall be a localized and informative text explaining the incompatibility.
System.IndexOutOfRangeException If rowIndex or columnIndex is negative or equal to or larger than the number of rows or columns repectively. However, this is not mandatory. Grid model may simply accept illegal indices.
See also:
ValueChanged

Implements wx.GridCtrl.Extended.IGridModel.

Implemented in wx.GridCtrl.Extended.SparseGridModel.

virtual void wx.GridCtrl.Extended.BaseGridModel.UpdateValues ( int  minRowIndex,
int  maxRowIndex,
int  minColumnIndex,
int  maxColumnIndex 
) [virtual]

This method does nothing since this model does not expect extensive efforts to be spend on getting values. However, inheritors are free to override this.

This will be called immediately before the grid reads values from the model for drawing. This method shall enable the model to create generated grid cell values en bloc immediately before the update of the display. The model can update grid cell values here and store them internally to be returned by method GetValue(). The grid model will indicate the range of indices of required rows and columns. However, the grid model must not rely on this method. GetValue() shall always return up to date values whether this has been called in advance or not.

Parameters:
maxColumnIndex The maximal index of an affected column.
maxRowIndex The maximal index of an affected row.
minColumnIndex The minimal index of an affected column.
minRowIndex The minimal index of an affected row.
GetValue

Implements wx.GridCtrl.Extended.IGridModel.


Member Data Documentation

event GridCellAttrChangedEventHandler wx.GridCtrl.Extended.BaseGridModel.OnAttributesChanged

This will be raised if the attributes of value cells or label cells change. Please note, that this does not necessarily fire if attribute specifications returned by GridCellAttributesEventHandler change.

Implements wx.GridCtrl.Extended.IGridModel.

event GridCellAttributesEventHandler wx.GridCtrl.Extended.BaseGridModel.OnGetGridCellAttributes

This event will be raised whenever this model will be asked for attributes to display a cell value. Handlers may change these attributes.

event GridCellValueChangedEventHandler wx.GridCtrl.Extended.BaseGridModel.OnLabelChanged

The model fires this event if one or more of the labels changed. The coordinates of the change elements of the event will indicate which labels changed. If the row is -1, a column label is affected. If the column index is -1, a row label is affected.

event GridCellValueChangedEventHandler wx.GridCtrl.Extended.BaseGridModel.OnValueChanged

This will be fired if one or more grid cell value changes.

Implements wx.GridCtrl.Extended.IGridModel.


Property Documentation

virtual GridCellLayoutSpecification wx.GridCtrl.Extended.BaseGridModel.CellLayout [get]

Opportunity to define that some grid cells span over others.

Implements wx.GridCtrl.Extended.IGridModel.

virtual ColumnPropertiesCollection wx.GridCtrl.Extended.BaseGridModel.ColumnProperties [get]

Collection of valid columns.

Implements wx.GridCtrl.Extended.IGridModel.

CellAttr wx.GridCtrl.Extended.BaseGridModel.DefaultLabelAttr [get, set]

Gets or sets the default label attributes. The labels returned by GetRowLabel() and GetColumnLabel() shall be the attributes set by SetRowLabel() or SetColumnLabel() completed by these default attribute.

Implements wx.GridCtrl.Extended.IGridModel.

virtual RowPropertiesCollection wx.GridCtrl.Extended.BaseGridModel.RowProperties [get]

Collection of valid rows. This collection does, in fact, rather hold the properties used to display rows but not the data.

Implements wx.GridCtrl.Extended.IGridModel.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads