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

3.3 Drawing Classes

Figure 5: Drawing class hierarchy

This class hierarchy diagram may be a little different from most that you've seen. That's because Objective Grid uses C++ multiple inheritance and MFC does not. Objective Grid uses multiple inheritance in order to support both a CWnd and a CView derivative via the CGXGridCore class. The sections below describe each class in detail and explain why Objective Grid uses this approach.

3.3.1 CGXGridCore

The CGXGridCore class encapsulates all of the drawing logic for the grid and its components. CGXGridCore responsibilities include:

The CGXGridView and CGXGridWnd classes inherit from both an MFC class and CGXGridCore. This use of multiple inheritance is necessary to avoid duplication of the drawing logic in both a CWnd and a CView derivative. By placing all of the drawing logic in CGXGridCore, Objective Grid centralizes the drawing logic in one class.

3.3.2 CGXView

The CGXView class serves as base class for a variety of views. It adds support for storing printer settings in a view or document and provides interfaces that make it easier to place the grid in a tabbed window.

3.3.3 CGXGridView

This class presents the grid component as a view. CGXGridView supports CView-like features for the grid including splitter window support, printing, and print-preview. CGXGridView is designed as a base class and is typically not instantiated.

3.3.4 CGXGridWnd

CGXGridWnd gives the grid a CWnd interface so that it can be used like a control. In other words, CGXGridWnd can be placed in a dialog and manipulated with the Visual C++ dialog editor. Like CWnd, CGXGridWnd is rarely instantiated. Instead, the developer derives from CGXGridWnd, overrides the virtual functions to obtain the desired behavior and then instantiates the derivative.

3.3.5 CGXGridHandleView

CGXGridHandleView lets you dynamically attach a CGXGridCore-derived class to a CView derivative. The advantage of this technique is that CGXGridHandleView can be bound with any CGXGridCore derivative at run time. It is not statically bound to CGXGridCore as CGXGridView is. CGXGridHandleView delegates all mouse actions and user input to the CGXGridCore object.

3.3.6 CGXGridHandleWnd

CGXGridHandleWnd lets you dynamically attach a CGXGridCore-derived class to a CWnd derivative so that it can be used like a control.

3.3.7 CGXGridHint

Objective Grid uses CGXGridHint internally to perform optimized updating of all views.



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.