<< Return to Main Index

< Return to Class Index

class CGXGridCore

The CGXGridCore class provides the base functionality of all grid-window classes in the Objective Grid/MFC library. It serves as the root for library classes such as CGXGridView and CGXGridWnd representing the grid-component as view or dialog-control. These classes are designed for further derivation. CGXGridCore provides basic services, including

Note that CGXGridCore is not derived from CWnd. The MFC Class Reference (see description of CObject) points out that derived classes can have only one CObject base class and that CObject must be leftmost in the hierarchy. It is permissible however to have structures and non-CObject-derived classes in the right-hand multiple-inheritance branches. This is the way the inheritance of CGXGridCore works. In the derived CGXGridView or CGXGridWnd class, the left-hand branch is a CView or CWnd class derived from CObject and the right-hand branch is CGXGridCore. CGXGridCore redirects all output to the window-object of the left-hand branch. See the User's Guide for detailed description.

Normally, CGXGridCore is associated with the data structure offered by the grid-component. Access to this data structure is done with virtual methods. You can easily override the virtual methods to bind the grid to a C Library for database handling. The grid-component is totally independent of the built-in data structure. The drawing of cells and notifications regarding specific events is done with virtual methods, too.

Taking into consideration that the grid can be used as stand-alone window and associated with a document where several views need access to the same data, it was necessary to distinguish between shared and unique attributes. Shared attributes such as row-heights and cell-contents have been moved to an extra class, the CGXGridParam class. Each grid object owns a pointer to a “parameter-object” which is an instance of the CGXGridParam class. The parameter-object itself can either be maintained by the document or by the grid. Unique attributes, such as the coordinates of the current cell or the scroll position, are attributes of the CGXGridCore class. The parameter-object maintains several other objects which can be shared by all associated views of one document as the properties-object with profile settings, the data-object with the cells-map, the print device-object with the printer settings, the rangelists with selected and covered cells, the undo/redo lists and the column-widths/row-heights-maps. See the description of the class CGXGridParam for further details.

For important information about commands, the current cell, comboboxes, undo and redo, properties, styles and initialization of all associated objects see the User's Guide.

#include <gxall.h>

See Also

CGXGridView CGXGridWnd CGXGridParam CGXControl

CGXGridCore

Class Members