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

3.4 Control Classes

All MFC control classes are derived from CWnd, but this base class does not provide some of the control interfaces needed by the grid object such as mouse operations, find and replace, etc. Objective Grid uses the same multiple inheritance technique to create control classes with an appropriate interface.

Controls can be combined with children. For example, a spin control has two arrow children: an up-arrow child and a down-arrow child. Objective Grid provides several control child classes, mainly to be used as small buttons in a cell.

You need to register new controls in the grid object (with CGXGridCore::RegisterControl) before using them as cell controls. See Section 14.7, "Quick-Reference Guide to Built-in Functions," for more information.

Figure 6 shows the class hierarchy for the control classes.

Figure 6: Control classes hierarchy

3.4.1 CGXControl

The CGXControl class is an abstract base class. CGXControl establishes a default grid-to-control interface that derived control classes must implement. By deriving from CGXControl, new controls can be implemented simply by overriding a handful of methods. New controls can also be derived from CGXControl and an existing MFC control class to implement a standard MFC control derivative. The resulting MFC control derivative derives its message map from the MFC inheritance and its grid properties from the CGXControl inheritance. For example, classes CGXEditControl, CGXComboBoxWnd and CGXListBox are MFC control derivatives that use this approach.

Developers can easily modify the behavior of the CGXControl derived classes. For example, you could create an owner-drawn combo box of colors or a drop-down calendar.

3.4.2 CGXBitmapButton

The CGXBitmapButton class implements a bitmap button control that can be used in grid cells.

Figure 7: CGXBitmapButton in action

3.4.3 CGXCheckBox

The CGXCheckBox class implements a check box control that can be used in grid cells. This class realizes the GX_IDS_CTRL_CHECKBOX and GX_IDS_CTRL_CHECKBOX3D control IDs.

Figure 8: CGXCheckBox in action

Figure 9: 3D CGXCheckBox in action

3.4.4 CGXCheckBoxEx

The CGXCheckBoxEx class implements a check box control that can be used in grid cells. It also supports an active state for the check box control. This class realizes the GX_IDS_CTRL_CHECKBOX_EX and GX_IDS_CTRL_CHECKBOX3D_EX control IDs.

Figure 10: CGXCheckBoxEx in action

Figure 11: 3D CGXCheckBoxEx in action

3.4.5 CGXCheckListComboBox

The CGXCheckListComboBox class implements a drop down list that allows the user make multiple selections. This class realizes the GX_IDS_CTRL_CHECKLIST_COMBOBOX control ID.

Figure 12: CGXCheckListComboBox in action

3.4.6 CGXComboBox

The CGXComboBox class implements a text input control that can be used to display and edit text in cells. The user can modify this text in place or select an item from a drop down list box. CGXComboBox realizes the GX_IDS_CTRL_COMBOBOX, GX_IDS_CTRL_TEXTFIT, GX_IDS_CTRL_ZEROBASED, GX_IDS_CTRL_ONEBASED, GX_IDS_CTRL_ZEROBASED_EX, and GX_IDS_CTRL_ONEBASED_EX control IDs.

Figure 13: CGXComboBox in action

3.4.7 CGXComboBoxWnd

The CGXComboBoxWnd class implements a combo box control that can be used to display and select items from a list. The user can select items in the combo box. The difference between CGXComboBoxWnd and CGXComboBox is that CGXComboBoxWnd is derived from the Windows standard CComboBox control, while CGXComboBox is a CGXEditControl with a small button at the right-hand side of the input area. CGXComboBoxWnd realizes the GX_IDS_CTRL_CBS_DROPDOWN and GX_IDS_CTRL_CBS_DROPDOWNLIST control IDs.

Figure 14: CGXComboBoxWnd in action

3.4.8 CGXCurrencyEdit

The CGXCurrencyEdit class implements a currency control cell type that can be used to display and enter currency values. CGXCurrencyEdit realizes the GX_IDS_CTRL_CURRENCY control ID.

Figure 15: CGXCurrencyEdit in action

3.4.9 CGXDateTimeCtrl

The CGXDateTimeCtrl class implements a date control cell type that can be used to display and enter dates. CGXDateTimeCtrl realizes the GX_IDS_CTRL_DATETIME and GX_IDS_CTRL_DATETIMENOCAL control IDs.

Figure 16: CGXDateTimeCtrl in action

3.4.10 CGXEditControl

The CGXEditControl class implements a text input control that can be used to display and edit text in cells. CGXEditControl realizes the GX_IDS_CTRL_EDIT control ID.

Figure 17: CGXEditControl in action

3.4.11 CGXHeader

The CGXHeader class implements a static text control which is used to display column and row headers. Headers typically have a 3d-button-look and a special feature is that they are drawn in a pressed state if the current cell is at the same row or column. CGXHeader realizes the GX_IDS_CTRL_HEADER control ID.

Figure 18: CGXHeader in action

3.4.12 CGXHotSpotEdit

The CGXHotSpotEdit class implements a text input control that can be used to display and edit text in cells. The user can modify this text in place . The difference between CGXHotSpotEdit and CGXEditControl is that CGXHotSpotEdit displays a small button at the right side of the input area. CGXHotSpotEdit realizes the GX_IDS_CTRL_HOTSPOT control ID.

Figure 19: CGXHotSpotEdit in action

3.4.13 CGXListBox

The CGXListBox class implements a list box control that can be used to display and select items from a list. The user can select items in the list box. CGXListBox realizes the GX_IDS_CTRL_LISTBOX control ID.

Figure 20: CGXListBox in action

3.4.14 CGXMaskControl

CGXMaskControl lets you add formatted input capabilities for cells. CGXMaskControl realizes the GX_IDS_CTRL_MASKEDIT control ID.

Figure 21: CGXMaskControl in action

3.4.15 CGXPasswordControl

The CGXPasswordControl class implements a text input control for passwords. When the user modifies the text, a password character (e.g. an asterisk, *) will be shown for each entered character. CGXPasswordControl realizes the GX_IDS_CTRL_PASSWORD control ID.

Figure 22: CGXPasswordControl in action

3.4.16 CGXProgressCtrl

The CGXProgressCtrl class lets you display a progress bar in cells. It also lets you display text (e.g. percentage value) in the cell. CGXProgressCtrl realizes the GX_IDS_CTRL_PROGRESS control ID.

Figure 23: CGXProgressCtrl in action

3.4.17 CGXPushbutton

The CGXPushbutton class implements a pushbutton control that can be used in grid cells. CGXPushButton realizes the GX_IDS_CTRL_PUSHBTN control ID.

Figure 24: CGXPushbutton in action

3.4.18 CGXRadioButton

The CGXRadioButton class implements a control with a group of radio buttons that can be used in grid cells. CGXRadioButton realizes the GX_IDS_CTRL_RADIOBTN and GX_IDS_CTRL_RADIOBTN3D control IDs.

Figure 25: CGXRadioButton in action

Figure 26: 3D CGXRadioButton in action

3.4.19 CGXRadioButtonEx

The CGXRadioButtonEx class implements a control with a group of radio buttons that can be used in grid cells. It supports an active state for the control as well as horizontal or vertical orientation for the radio buttons. CGXRadioButtonEx realizes the GX_IDS_CTRL_RADIOBTNEX and GX_IDS_CTRL_RADIOBTN3DEX control IDs.

Figure 27: CGXRadioButtonEx in action

Figure 28: 3D CGXRadioButtonEx in action

This control has the ability to align vertically or horizontally via the GX_IDS_UA_RADIOBUTTON_ALIGN user attribute.


In version 7.0 and earlier, text was always located to the right of the radio button. An option in more recent versions allows you to place the text to either the left or right of the radio button.

The GX_IDS_UA_RADIOBUTTONTEXTALIGN user attribute is similar to GX_IDS_UA_RADIOBUTTON_ALIGN, but indicates whether to place the text to the left or right of the button. To get the look you had in earlier versions (text on the right side), try the following code:

3.4.20 CGXRichEditCtrl

The CGXRichEditCtrl lets you display and edit Rich Text in cells. Rich Text allows you to format individual characters or paragraphs with different fonts, colors or horizontal alignment. CGXRichEditCtrl realizes the GX_IDS_CTRL_RICHEDIT control ID.

Figure 29: CGXRichEditCtrl in action

3.4.21 CGXSpinEdit

The CGXSpinEdit class implements a text input control with spin buttons. The user can modify this text in place, increase or decrease the value by clicking on the spin buttons. CGXSpinEdit realizes the GX_IDS_CTRL_SPINEDIT control ID.

Figure 30: CGXSpinEdit in action

3.4.22 CGXStatic

The CGXStatic class implements a static text control that can be used to display text in cells. The user cannot modify this text in place. CGXStatic realizes the GX_IDS_CTRL_STATIC control ID.

Figure 31: CGXStatic in action

3.4.23 CGXTabbedComboBox

The CGXTabbedComboBox class implements a tabbed combo box based on the existing CGXComboBox implementation. CGXTabbedComboBox realizes the GX_IDS_CTRL_TABBED_COMBOBOX control ID.

Figure 32: CGXTabbedComboBox in action

3.4.24 CGXTabbedComboBoxWnd

The CGXTabbedComboBoxWnd class implements a tabbed combo box based on the existing CGXComboBoxWnd implementation. CGXTabbedComboBoxWnd realizes the GX_IDS_CTRL_CBS_TABBED_DROPDOWN and GX_IDS_CTRL_CBS_TABBED_DROPDOWNLIST control IDs.

Figure 33: CGXTabbedComboBoxWnd in action

3.4.25 CGXVScrollEdit

The CGXVScrollEdit class implements a text input control that can be used to display and edit text in cells. The user can modify this text in place. The difference between CGXVScrollEdit and CGXEditControl is that CGXVScrollEdit displays a vertical scrollbar for multiline text cells by default. CGXVScrollEdit realizes the GX_IDS_CTRL_SCROLLEDIT control ID.

Figure 34: CGXVScrollEdit in action

3.4.26 CGXWndWrapper

The CGXWndWrapper class is an adapter-like class for CWnd-derived objects. You can use any CWnd-derived object as a cell in the grid when you wrap it with CGXWndWrapper.

3.4.27 CGXChild

The CGXChild class is an abstract base class. CGXChild establishes a default control to child interface that derived control child classes must implement. CGXChild objects can be added to a CGXControl object and can be used for small buttons (for example the up- and down-arrow button in the CGXSpinEdit control).

3.4.28 CGXButton

The CGXButton class implements a pushbutton that can be used as a child in a control.

3.4.29 CGXBitmapButtonChild

The CGXBitmapButtonChild class implements a bitmap button that can be used as a child in a control.



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.