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

2.4 Control Architecture

To completely comprehend the way Objective Grid draws, let's take a look at how it implements and manipulates the controls for each cell.

Each composed style object for a cell contains an identifier for a control. Like any other style attribute, this identifier can be changed at run time allowing the developer maximum flexibility. The CGXGridCore class maintains a map of registered control types and identifiers. In the CGXGridCore::OnGridInitialUpdate() member function, the developer can register any additional control types with their identifiers by calling RegisterControl().

Another interesting facet of the control implementation is the concept of the current cell. Objective Grid manages the current cell as the user navigates through the grid by clicking or using arrow keys. When the user changes the current cell, the grid resets the attributes of the control bound to the previous current cell and initializes the control of the new current cell. Finally, Objective Grid passes all other events to the control so the end user can interact directly with the control. When the user changes the current cell, the grid object takes over again and the current cell process starts over.

2.4.1 Current Cell Interface

CGXGridCore offers several methods that let the developer manipulate the current cell:

SetCurrentCell()
GetCurrentCell()
IsCurrentCell()
MoveCurrentCell()
TransferCurrentCell()

Stores and deactivates the current cell or reinitializes the current cell's contents.

2.4.2 Current Cell Notifications

There are many notification methods the developer can override in a CGXGridCore-derived class. Many of the notification methods have related virtual methods in the CGXControl class. You can choose whether you want to override the method for all cells in the grid or only for specific controls.

CanSelectCurrentCell()
OnCanceledEditing()
OnCancelEditing()
OnClickedButtonRowCol()
OnDeleteCell()
OnEndEditing()
OnInitCurrentCell()
DoLButtonDown()
OnLButtonClickedRowCol()
OnLButtonDblClkRowCol()
OnLButtonHitRowCol()
OnLeftCell()
OnMButtonClickedRowCol()
OnMButtonDblClkRowCol()
OnMButtonHitRowCol()
OnModifyCell()
OnMovedCurrentCell()
DoRButtonDown()
OnRButtonClickedRowCol()
OnRButtonDblClkRowCol()
OnRButtonHitRowCol()
OnStartEditing()
OnValidateCell()
ProcessKeys()

2.4.3 Predefined Controls

The following control IDs are predefined in Objective Grid. You can use one of the following control IDs in a call to a SetStyleRange() command, without explicitly registering them. Objective Grid will register the control automatically as needed.

Table 2: Predefined control IDs

Control ID Description
GX_IDS_CTRL_EDIT Edit control
GX_IDS_CTRL_SCROLLEDIT Edit control with a vertical scroll bar
GX_IDS_CTRL_HOTSPOT Hot spot or drop edit
GX_IDS_CTRL_SPINEDIT Spin edit
GX_IDS_CTRL_RICHEDIT Rich edit control
GX_IDS_CTRL_MASKEDIT Mask edit control
GX_IDS_CTRL_STATIC Static text
GX_IDS_CTRL_PUSHBTN Push button
GX_IDS_CTRL_RADIOBTN Radio button
GX_IDS_CTRL_RADIOBTN3D Radio buttons with 3D effect
GX_IDS_CTRL_CHECKBOX Check box
GX_IDS_CTRL_CHECKBOX3D Check box with 3D effect
GX_IDS_CTRL_COMBOBOX Regular combo box; allows user to input any text
GX_IDS_CTRL_TEXTFIT Regular combo box with text fit; limits user input to entries in the choice list
GX_IDS_CTRL_ZEROBASED Combo box with zero-based indices; stores and displays the index value
GX_IDS_CTRL_ONEBASED Combo box with one-based indices; stores and displays the index value
GX_IDS_CTRL_ONEBASED_EX Combo box with one-based indices; stores the index value but displays the associated choice list text
GX_IDS_CTRL_ZEROBASED_EX Combo box with zero-based indices; stores the index value but displays the associated choice list text
GX_IDS_CTRL_CBS_DROPDOWN MFC CComboBox with the CBS_DROPDOWN style
GX_IDS_CTRL_CBS_DROPDOWNLIST MFC CComboBox with the CBS_DROPDOWNLIST style
GX_IDS_CTRL_TABBED_COMBOBOX Tabbed combo box
GX_IDS_CTRL_CBS_TABBED_DROPDOWN Tabbed combo box based on an MFC CComboBox with the CBS_DROPDOWN style
GX_IDS_CTRL_CBS_TABBED_DROPDOWNLIST Tabbed combo box based on an MFC CComboBox with the CBS_DROPDOWNLIST style
GX_IDS_CTRL_CHECKLIST_COMBOBOX Drop down checklist combo box
GX_IDS_CTRL_LISTBOX List box
GX_IDS_CTRL_HEADER Header
GX_IDS_CTRL_BROWSEARROWHEADER Row header for browser grids; displays the arrow or pencil icon as appropriate
GX_IDS_CTRL_PROGRESS Progress bar
GX_IDS_CTRL_PASSWORD Password edit
GX_IDS_CTRL_DATETIME Date time control with a pop-up calendar
GX_IDS_CTRL_DATETIMENOCAL Date time control without a pop-up calendar
GX_IDS_CTRL_CURRENCY Formatted currency control

Here is an example of using these settings:



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.