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

6.4 Component Reference

This section provides detailed description of all cell types and features that can be chosen in the tree window of the Build Wizard.

In the Build Wizard, you can choose the grid features you want to use in your application(s). The wizard will create a makefile and/or control factory class based on your selection. You can adjust your selections and rebuild the libraries any time.

Some components depend on other components. For example, the CGXComboBox is derived from CGXEditControl and CGXStatic. When you mark Combobox as checked, the cell types Static and Edit will also be linked into the grid library or application.

Another example is clipboard support. If you choose StyleDataExchange, the CGXStyle::Serialize API will also be linked into the grid library or application.

If you wish to understand the details of the component dependencies, open the file buildwiz.ini and search for the m keys.

6.4.1 Control Factory Class

This section describes the components in the tree window that specify the output for the control factory class. Each of the components below add one or several lines of code in the Control Factory Class.

The list of file names will be written into the makefile for the grid library.

6.4.1.1 Basic Cell Types

Choose the cell types to be used in your application(s). Entries for all selected cell types will be inserted in the control factory's CreateControl method. You can toggle the state of all components at once by clicking the checkbox of the parent node.

Supply the listbox entries through the choice list separated with a newline character. The representation of the selected choice as cell value depends on the combobox variant you use. You can register custom variants for CGXComboBox and adjust some attributes for the cell type object (e.g for pushbutton to be always visible). See CGXComboBox in the Objective Grid Class Reference for more details.

Supply the checkbox description to be displayed in the cell through the choice list character. By default the cell value is 0, 1, or 2 (as defined by the user attributes below), but you can also adjust how checked, unchecked, and undetermined states shall be represented through the cell value. (In a tri-state checkbox an empty string in the corresponding style's value represents the indeterminate state.)

You can specify the checked/unchecked representation in the style object with the user attributes GX_IDS_UA_CHECKBOX_CHECKED and GX_IDS_UA_CHECKBOX_UNCHECKED. The default setting is "1" for checked and "0" for unchecked. Other values are treated as undetermined.

If you want "T" or "F" to be stored in the grid for a checkbox you can specify this with:


The state of the checkbox is passed through the style object's value-attribute (CGXStyle::SetValue).

See CGXCheckbox in the Objective Grid Class Reference for details.

Supply the list of selections through the choice list separated with a newline character. The cell value is a zero-based integer that represents the selected choice.

6.4.1.2 Advanced Cell Types

Supply the listbox entries through the choice list separated with a newline character. By default the cell value will be the text of the selected choice. You can register custom variants for CGXComboBoxWnd and adjust some attributes for the cell type object (e.g zero-based index as value). See CGXComboBoxWnd in the Objective Grid Class Reference for more details.

Supply the listbox entries through the choice list separated with a newline character. Separate the value for each column with a tab character (\t). The cell value will be the text of the key column for the selected choice. See CGXTabbedComboBoxWnd for user attributes that specify the appearance and behavior of the dropdown list.

By default, the cell value contains the date string. If you need to write international applications check the m_bDateValueAsNumber member attribute of the CGXDateTimeCtrl class. This will force the date to be represented as number in the cell value.

Use user attributes to customize the behavior of individual date time cells.

Changing the Spinner Speed on the CGXDateTimeCtrl—Two public members of CGXDateTimeCtrl manage how often a value is incremented as you click and hold down the spinner. m_nInitialTimer is the time (in milliseconds) that the button needs to be depressed before the first increment. Thereafter, m_nNormalTimer is the time (in milliseconds) between increments. The default value of m_nInitialTimer is 500 msecs and the default value of m_nNormalTimer is 100 msecs. For example, to change the incrementing speed once the increment begins, use code such as:

after the baseclass call to OnInitialUpdate() or Initialize().

6.4.1.3 Edit Extensions

6.4.1.4 Basic Features

Sorting ImplementGridSort: Provides implementation for sorting rows or columns.
Call CGXGridParam::SetSortRowsOnDblClk or CGXGridParam::SetSortColsOnDblClk to enable sorting the grid when the user double-clicks on a row or column header. You can also call the SortRows or SortCols API to manually sort the grid with multiple key columns.
HideCells ImplementHideCells: Provides implementation for hiding rows and columns.
The user can hide rows and columns with the mouse if resizing rows and column is supported. See "UserResizeCells" under "Mouse Actions".
Use the HideRows or HideCols API to manually hide or unhide rows and columns.
FindReplace ImplementFindReplace: Provides implementation for Find and Replace.
Add Edit|Find and Edit|Replace menu entries to your application with the ids ID_EDIT_FIND and ID_EDIT_REPLACE to add Find and Replace support to a gridview.
You can also call the FindText API to manually find text in the grid.
MarkEditHeader ImplementMarkEditHeader: Outline row and column header of current cell.
This behavior is controlled through CGXProperties::SetMarkColHeader and CGXProperties::SetMarkRowHeader.
FreezeMenu ImplementFreezeMenuHelper: Provides implementation for FreezeRows, UnfreezeRows, FreezeCols and UnfreezeCols menu handlers.
Serialization CGXGridParam::ImplementSerialize: Provides implementation for serializing CGXGridParam, CGXProperties, CGXData and CGXStylesMap objects. Forces also that the implementation for serializing style objects gets linked into the application or DLL.
Profile CGXStyle::ImplementProfile: Provides support for reading and writing CGXProperties, CGXStyle, CGXFont and CGXStylesMap objects to the registry.
UndoRedo ImplementUndoRedo: Implements Undo and Redo support for undoing and redoing operations.
Undo and Redo is controlled by the CGXGridParam::EnableUndo and CGXGridParam::SetUndoLimit parameter.
Add Edit|Undo and Edit|Redo handlers to your Edit menu or use the Undo(), Redo() and Rollback() API to manually perform Undo and Redo.
UpdateHint ImplementUpdateHint: Provides implementation of the update hint mechanism that synchronizes changes between several views of one document.
The Update Hint behavior is controlled by the EnableHints() API for each grid. You have to call EnableHints() from your OnInitialUpdate() routine in order to enable the update hint mechanism for individual grids.
ResizeToFit ImplementResizeToFit: Provides implementations for the ResizeRowHeightsToFit() and ResizeColWidthsToFit() methods.
ImplementResizeToFit is also needed if you want to support automatic growing of cells while the user enters text (CGXStyle::SetAutoSize(TRUE)).
NumberFormatting CGXDrawingAndFormatting::ImplementNumberFormatting(): Provides concrete implementation for format numeric cells with CGXStyle::SetFormat.
LongOperation CGXLongOperation::ImplementLongOperation(): Provides implementation for the CGXLongOperation class. This class allows you to give feedback to the user about the status of time-consuming operations. The user can cancel time-consuming operations with the ESC-key.
The behavior of the CGXLongOperation class is also controlled by the SetTicksFirstTime parameter. If you call CGXLongOperation::SetTicksFirstTime(LONG_MAX) the user can't cancel long operations with the ESC key.

6.4.1.5 Mouse Actions

ToolTips ImplementToolTips: Support for Tooltips in cells.
You can turn on and off tooltips for each grid individually with EnableTooltips().
AutoScroll ImplementAutoScroll: Provides implementation for Autoscrolling that will scroll the grid when the user presses a mouse button and drags the mouse out of the grid window. Also, will accelerate the scrolling when the user navigates through the grid by holding down an arrow key or pressing a scrollbar arrow button.
Scrolling when the user drags the pressed mouse out of the grid is controlled with SetAutoScroll().
Acceleration of the scrolling when the user holds down an arrow key is controlled with SetAccelArrowKey().
Acceleration of the scrolling when the user presses a scrollbar button is controlled with SetAccelScrollbars().
UserSelectRange ImplementUserSelectRange: Provides implementation for selecting cell ranges with mouse or keyboard or SelectRange API.
The "Select Range" behavior is controlled by CGXGridParam::EnableSelection.
You can manually select ranges with the SelectRange and SetSelection API.
ExcelLikeFrame ImplementExcelLikeFrame: Provides implementation for Excel-like Selection Frame.
In order to turn on Excel-like Selection Frame for individual grids callGetParam()->SetExcelLikeCurrentCell(TRUE);GetParam()->SetSyncCurrentCell(TRUE);GetParam()->SetExcelLikeSelectionFrame(TRUE);
UserDragSelectRange ImplementUserDragSelectRange: Provides implementation for dragging selected rows or columns with mouse.
Dragging selected rows or columns with mouse allows the user to rearrange the row or column order in the grid.
You can turn on and off dragging rows and column with CGXGridParam::EnableMoveRows() and CGXGridParam::EnableMoveCols(). You can manually rearrange rows and columns by calling MoveRows() or MoveCols().
UserResizeCells ImplementUserResizeCells: Provides implementation for resizing rows or columns with the mouse.
Call CGXGridPram::EnableTrackRowHeights() and CGXGridPram::EnableTrackColWidths() in order to enable or customize the resize behavior for individual grids.

6.4.1.6 Spanned Cells

This section discusses various approaches for joining neighboring cells.

CoveredCells ImplementCoveredCells: Allow usage of covered cells in the grid.
You can specify covered cells with the SetCoveredCellsRowCol() method.
MergeCells ImplementMergeCells: Implementation for Merge Cells.
You can enable and customize merge cells behavior with the SetMergeCellsMode() method in your grid. For individual cells use CGXStyle::SetMergeCell().
FloatCells ImplementFloatCells: Implementation for Floating Cells.
You can enable and customize floating cells behavior with the SetFloatCellsMode() method in your grid. For individual cells use CGXStyle::SetFloatCell() and CGXStyle::SetFloodCell().

6.4.1.7 Printing

Grid Printing ImplementPrinting: Provides implementation of printing routines that allow you to print and print preview grid.
Printing and Print Preview is implemented in the MFC framework. The MFC framework calls various virtual methods when printing a view. ImplementPrinting provides concrete implementations for the OnBeginPrinting(), OnPrint() and OnEndPrinting() methods.
Printer Setup CGXPrintDevice::ImplementPrintDevice(): Store printer settings into grid parameter object and serialize printer settings. Also needed for WYSIWYG mode. See CGXPrintDevice for more details.

6.4.1.8 Data Exchange

Data Exchange functionality is necessary for doing clipboard operations, OLE drag and drop and reading and writing text files.

DirectCopyMoveCells ImplementDirectCopyMoveCells: Implements support for direct copying, moving of cells within one grid (MoveCells and CopyCells API).
You can enable DirectCopyMoveCells for clipboard and OLE Drag and Drop operations if you set m_bDirectCopyPaste, m_bDirectCutPaste and m_bDirectDragDrop equal to TRUE. For regular grids, these parameters are set to FALSE as default. For formula grids, these parameters are set to TRUE as default.
Use the MoveCells and CopyCells API to programmatically perform a direct copy or move operation.
TextDataExchange ImplementTextDataExchange: Implements support for
reading and writing cells with text (CSV) format.Clipboard and OLE Drag and Drop operations use TextDataExchange when you specify the GX_DNDTEXT flag.
Call CopyTextToFile() or PasteTextFromBuffer() to programmatically read and write cells with text format.
StyleDataExchange ImplementStyleDataExchange: Implements support for reading and writing cells in internal format.
Clipboard and OLE Drag and Drop operations use StyleDataExchange when you specify the GX_DNDSTYLES flag.
Call CopyCellsToArchive() or PasteCellsFromArchive() to programmatically read and write cells in binary format.
CutPaste ImplementCutPaste: Implements support for clipboard operations: Cut, Copy and Paste.
This component provides concrete implementations for the Cut(), CanCut(), Copy(), CanCopy(), Paste() and CanPaste() methods. CGXGridView provides handlers for ID_EDIT_COPY, ID_EDIT_PASTE and ID_EDIT_CUT menu commands that call Cut, Copy and Paste methods.
You can customize Cut, Copy and Paste behavior through the m_nClipboardFlags attribute.
ClearCells ImplementClearCells: Clear out cells when user pressed DELETE key.
This component provides a concrete implementation for the ClearCells() method.

6.4.1.9 Drawing

Drawing related features that are implemented through abstract base classes. Concrete classes will be instantiated for chosen features.

OldDrawing ImplementOldDrawing: Old Drawing, backward compatible with version 1.2.
Use old drawing if you want to support transparent background (CGXGridParam::SetTransparentBackground(TRUE)) or if you depend on a OG 1.2-compatible behavior for drawing grid lines in case you have override the DrawGridLine() method.
OldDrawing can be forced by setting m_bForceOldDrawing attribute equal to TRUE.
DrawRotatedText CGXDrawingAndFormatting::ImplementDrawRotatedText: Support for rotated text in cells.
This component provides a concrete implementation for the GXDrawRotatedText() method which is called for drawing the text in a cell if you specified CGXStyle::SetOrientation(nValue) with nValue not equal to 0.
OptimizedUpdate ImplementOptimizedUpdate: Provides implementation for optimized updating of grid when inserting, moving, removing or resizing rows or columns. If optimized updating is not available the grid will simple redraw the window after these operations (which is already fast enough for typical grids).

6.4.1.10 Date Time Formatting

Choose the date and time implementation. COleDateTime is recommended for Win32 applications. Uncheck both if you don't need date and time parsing and formatting at all.

OleDateTime Use COleDateTime for formatting and parsing in GXParseDateTime() and GXFormatTimeStamp() methods. Recommended for Win32. (GXImplementOleDateTime() in control factory)
NoOleDateTime Use alternative to COleDateTime for formatting and parsing in GXParseDateTime() and GXFormatTimeStamp() methods. Not recommended for Win32. (GXImplementOleDateTime() in control factory)

6.4.1.11 Advanced Settings

Check those APIs you are using in your project. Check also if you need to read back serialized documents written with OG 5.0 or earlier.

Copy Parameter Object CGXGridParam::ImplementCopyOperator(): Implements copy operator for CGXGridParam, CGXProperties, and CGXStylesMap.
(CGXData and CGXStyle have a fully functionally copy-operator, no matter if you enable "Copy Parameter Object" or not.)
MoveRows MoveCols API ImplementMoveRowsCols: Check this if you have disabled "UserDragSelectRange" and you want to move columns and rows programmatically by calling MoveRows() or MoveCols().
CGXStyle::Serialize API CGXStyle::ImplementSerialize: Check this if you have disabled "Serialization" and "StyleDataExchange" and you want to programmatically call CGXStyle::Serialize().
CGXStyle::IsSubset API CGXStyle::ImplementCompareSubset(): Check this if you want to call CGXStyle::IsSubset() in your project.
CGXStyle::Serialize backward compatibility CGXStyle::ImplementSerializeOG5Compatible(): Check this if you want to read serialized documents created with OG 5.0 or earlier.

6.4.1.12 Window Class Registration

Choose classes that you want to use as custom windows in dialog templates. If you use SubclassDlgItem, you don't need to register the window classes and you can turn off the following components.

Register CGXTabWnd Use CGXTabWnd as custom window in dialog templates. If you use SubclassDlgItem there is no need to register the window classes.
Register CGXTabBeam Use CGXTabBeam as custom window in dialog templates. If you use SubclassDlgItem there is no need to register the window classes.
Register CGXGridWnd Use CGXGridWnd as custom window in dialog templates. If you use SubclassDlgItem there is no need to register the window classes.

6.4.2 Library Linking

This branch is only available for the Build Wizard.

Choose components to be linked into the libraries.

Excluding features from being linked into the library and using them in your projects will cause unresolved externals.

6.4.2.1 WndView

Use grid as CWnd or CView.

CGXGridView Force CGXGridView to be linked into the library.
CGXGridHandleView Force CGXGridHandleView to be linked into the library.
CGXGridWnd Force CGXGridWnd to be linked into the library.
CGXGridHandleWnd Force CGXGridHandleWnd to be linked into the library.

6.4.2.2 Ole Drag and Drop

Use grid as OLE Drop Target or data source.

OleDropTarget Force the OleDropTarget module to be linked into the library if you want to register grids as OLE drop target. Call EnableOleDropTarget() from OnInitialUpdate() to use this feature in your grid(s).
OleDataSource Force the OleDataSource module to be linked into the library if you want to use grids as OLE data source. Call EnableOleDataSource() from OnInitialUpdate() to use this feature in your grid(s).

6.4.2.3 Nonstandard Cell types

Cell types that need to be manually registered in your grid. The control factory can't instantiate these cell types because additional information (resource id for bitmap or pointer to a CWnd object) is necessary when constructing the cell type object.

CWnd Wrapper Force CGXWndWrapper class to be linked into the library.
No default cell type ID.The gridapp sample (gridsvw5.cpp and gridsvw6.cpp) demonstrates how to use this cell type.
Bitmap Button Force CGXBitmapButton class to be linked into the library.
No default cell type ID.The gridapp sample (gridsvw3.cpp, Welcome page) demonstrates how to use this class.

The code for gridapp sample is located at <stingray-installdir>\Samples\Grid\General\GridApp.

6.4.2.4 Visual Components

IntelliMouse and scrolltips support.

MouseWheel Force CGXMouseWheelPlugin class to be linked into the library.
IntelliMouse support: wheel scrolling, zooming. No support for panning. Call EnableMouseWheel() in your OnInitialUpdate() routine to use this feature in grids.
IntelliMouse Force CGXIntelliMousePlugin class to be linked into the library.
IntelliMouse support: wheel scrolling, zooming and panning. Call EnableIntelliMouse() in your OnInitialUpdate() routine to use this feature in grids.
ScrollTips Force the CGXScrollTip class and CGXScrollTipPlugin class to be linked into the library.
Scrolltips give feedback about row and column position when user is dragging the scroll thumb. Call EnableScrollTips() in your OnInitialUpdate() routine to use this feature in grids. Another alternative for using scroll tips in your windows is to override OnHScroll() and OnVScroll() and forward this messages to an embedded CGXScrollTip variable. See the CGXScrollTip class for more details.

6.4.2.5 Formula Support

Formula Engine and worksheet functions.

Formula Engine Force formula engine code to be linked into the library.
Call EnableFormulaEngine() in your OnInitialUpdate() routine to enable formula support for a grid.
All Worksheet Functions Force all worksheet functions to be linked into the library.
Call GXSetDefaultWorksheetFunctions() in your InitInstance() method to load all worksheet functions into your application.

6.4.2.6 Dialogs

Pre-built dialogs for customizing the grid appearance or changing cell formatting.

Property Settings Force Property settings, Page setup, Header and Footer dialog to be linked into the library.
See mygridvw.cpp in gridapp for an example of displaying property dialogs.
Style Sheet Force Base Styles dialog and CGXStyleSheet to be linked into the library
See mygridvw.cpp in gridapp for an example of using CGXStyleSheet and CGXStylesDialog.

6.4.2.7 Frame Window Classes

Check the frame window classes you want to use in your projects.

CGXTabWnd Force CGXTabWnd and CGXTabBeam class to be linked into the library.
CGXRecordInfoWindow Force CGXRecordInfoWindow class to be linked into the library.
CGXRecordInfoSplitterWindow Force CGXRecordInfoSplitterWindow class to be linked into the library.
CGXSplitterWnd Force CGXSplitterWnd class to be linked into the library.

6.4.2.8 Collection Classes

Check those collection classes you want to use in your projects.

CGXCollMapDWordToPtr Force CGXCollMapDWordToPtr class to be linked into the library.
CGXCollMapDWordToString Force CGXCollMapDWordToString class to be linked into the library.
CGXCollMapStringToHandle Force CGXCollMapStringToHandle class to be linked into the library.
CGXCollMapStringToWord Force CGXCollMapStringToWord class to be linked into the library.

6.4.2.9 Basic Classes

Check those classes that you want to use in your projects. Only advanced user should exclude any of these classes.

CGXGridHint Force CGXGridHint class to be linked into the library.
CCGXUserAttribute Force CCGXUserAttribute class to be linked into the library.

6.4.2.10 BrowserGrid

Use the browser grid as CWnd or CView.

CGXBrowserWnd Force CGXBrowserWnd (and CGXBrowserGrid) class to be linked into the library.
CGXBrowserView Force CGXBrowserView (and CGXBrowserGrid) class to be linked into the library.

6.4.2.11 ADO Grid

Link ADO classes into the library.

CGXAdoRecordView Force CGXAdoRecordView (and CGXAdoGrid) class to be linked into the library.
CGXAdoRecordWnd Force CGXAdoRecordWnd (and CGXAdoGrid) class to be linked into the library.
Attach Foreign ADO Table Allow attaching foreign table to a column.

6.4.2.12 ODBC Grid

Link ODBC classes into the library.

CGXRecordView Force CGXRecordView (and CGXODBCGrid) class to be linked into the library.
CGXRecordWnd Force CGXRecordWnd (and CGXODBCGrid) class to be linked into the library.
CGXDynamicRecordset Force CGXDynamicRecordset class to be linked into the library.
Attach Foreign ODBC Table Allow attaching foreign table to a column.

6.4.3 Resources

The Build Wizard lets you choose resources to be included from gxres.rc.

Splitter, TabWnd (Cursors) Check this component if you are using CGXTabWnd in your project.
Style Sheet (Dialog Templates) Check this component if you are using CGXStyleSheet in your project.
Property Dialogs (Dialog Templates) Check this component if you are using any of the property settings dialogs in your project (Header/Footer, Page Setup or Display Settings dialog).
BrowserGrid Row Header Bitmaps Check this component if you are using CGXBrowserGrid (or any of its derivatives ODBC and ADO grid) in your project.
IntelliMouse cursors and bitmap Check this component if you are using IntelliMouse panning (EnableIntelliMouse). You may leave this component unchecked if you are using just plain mousewheel scrolling (EnableMouseWheel).

6.4.4 A Note On the Implementation

To create the smallest possible grid applications, we leveraged the C++ concept of abstract base classes. Nearly all of the previously described features are implemented through a concrete C++ class that is derived from an abstract base class. Using this concept eliminated any dependencies on the concrete implementation of a specific feature. If you look at the Objective Grid header files (especially gxabstr.h) you see many abstract base classes. All these abstract base classes have been given the name of the feature plus the suffix "Imp".

You might be worrying that this new concept and the many changes in Objective Grid source code might break your existing applications. We are glad to say this is not the case at all. Objective Grid is fully source-code compatible with earlier versions. All your virtual overrides will still be called the same way they have been called in earlier versions of Objective Grid. Even more, we strongly recommend that you continue to use Objective Grid the same way as before. That means, if you want to customize the behavior of a specific feature override only those virtual methods provided by CGXGridCore (or other related classes). Do not subclass the concrete or abstract base class for that feature. We consider all the abstract base classes and their concrete implementations implementation-specific code. They access protected members in CGXGridCore and the classes themselves are subject to be changed in future grid versions. Don't rely on source code-compatibility if you subclass any of the abstract base classes with the "Imp" suffix. We therefore did also not consider providing many of the concrete class implementation in header files.

Take the "resize cells" feature as example. The abstract base class is CGXAbstractGridUserResizeCellsImp. Its declaration can be found in Stingray Studio <version>\include\grid\gxabstr.h. The concrete implementation CGXGridUserResizeCellsImp can be found in Stingray Studio <version>\src\grid\gxsizeu.cpp. CGXGridUserResizeCellsImp is not declared in any Objective Grid header file and therefore not accessible by your application.

If you want to customize the behavior of "resize cells" there are virtual methods in CGXGridCore that you can override: OnStartTracking, OnMoveTracking, OnCancelTracking and OnEndTracking. These methods are still called in the same way as with earlier grid versions even though their concrete implementation for performing the action has moved to CGXGridUserResizeCellsImp.



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.