Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

12.3 Objective Grid Core Architecture In Brief

A grid consists of cells that display information in the grid window. Each cell is identified through a unique row and column number pair. Cells have attributes associated with them such as text, font and borders. Attributes are stored in a cell data object. For Objective Grid, the cell data object is an instance of the CGXStyle class. The cell type itself is also an attribute of the cell. Some examples of cell types are edit box, static text, combo box, list box, radio button, push button and check box. In Objective Grid, each cell type is implemented through a class derived from CGXControl. CGXControl is an abstract base class that defines the interface between a grid object and a cell type object.

Objective Grid separates cell data from the cell type object. This means the programmer can change the attributes of a cell independent of the cell type. There is no need to get a pointer to the cell type object in order to change the content of a specific cell. This also implies that the cell type object does not store cell specific information. Objective Grid shares one cell type object among many cells. Responsibilities of the cell type object are drawing the cell and interpreting user input. If the user changes the cell text or value, all changes are stored in the cell data object for the cell.

Another interesting aspect in the interaction between cells and the grid object is that the cell attributes are determined at run time. The cell data objects are not persistent in memory. Whenever the grid object draws a specific cell, a cell data object is created for the cell and filled by calling virtual member functions. A programmer can override these virtual functions and specify the cell attributes at run time depending on the current context of the application. Because cell data objects are determined at run time, it is possible to implement a kind of cell attribute inheritance.

Suppose you want to change the font for a whole row of cells. Normally, you would have to loop through all cells in that row and change the font attribute, but with the cell attribute inheritance implemented in Objective Grid, you only have to change the font in the row style. All cells in the affected row will automatically inherit the font settings from the row style. Only cells that have already stored individual font settings in the cell data object will not be affected.

Cell attribute inheritance lets you group specific kinds of cells and make them have similar attributes. For example, all row headers can be changed through the "Row Header Style" and all column headers can be changed through the "Column Header Style". Default cell attributes can be changed through the "Standard Style". You can easily add your own base styles and let certain cells inherit their cell attributes from these base styles.

Objective Grid is composed of several groups of MFC extension classes which work together to provide the above features and design principles:



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.