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

6.5 Toolbar Button Map

The toolbar manager for the customizable toolbar also allows you to register a button map. A button map lets you map specific button command IDs to non-standard toolbar buttons such as text buttons, combo box buttons, and two part buttons. You don't need to include a button map if you only need traditional bitmap-only buttons.

The button map supports the following features:

The button map is placed in the implementation file of your frame class, similar to the way a window message map is added.

The following lines of code are an example of a button map.

Once you define a button map, it is given to the toolbar manager. For more information, see Section 6.9.7.

6.5.1 STD_BUTTON

The STD_BUTTON macro extends the standard customizable toolbar bitmap only button by introducing a style parameter. The syntax is as follows:

Table 24: STD_Button Macro Parameters

Macro parameter Description
ButtonID Command ID for the button.
Style Window style (WS_*)

6.5.2 STD_MENU_BUTTON

The STD_MENU_BUTTON macro extends the standard customizable toolbar by creating a bitmap toolbar button that drops down a menu instead of executing a command.

Table 25: STD_MENU_BUTTON Macro Parameters

Macro Parameter Description
ButtonID The command ID for the button. This command is not actually executed when the button is pressed.
style The button's window style. This parameter is usually zero.
MenuResID The resource ID for the menu resource for the drop-down menu.
SubMenuIdx Zero-based index for the popup menu's location in the menu resource—usually zero if creating a separate menu resource.
TPMAlign Alignment of the menu when dropped with respect to the toolbar button. Can be either TPM_LEFTALIGN, TPM_CENTERALIGN, or TPM_RIGHTALIGN.

6.5.3 TEXT_BUTTON

The TEXT_BUTTON macro implements a customizable toolbar button with text. The macro syntax is shown below.

Macro parameter Description
ButtonID Command ID for the button.
TextResourceID Resource ID of the text string (or 0 to load based on the button ID).

6.5.4 TEXT_BUTTON_EX

The TEXT_BUTTON_EX macro is similar to TEXT_BUTTON (it implements a customizable toolbar button with text) except it also introduces a style parameter. The syntax is as follows:

Macro parameter Description
ButtonID Command ID for the button.
TextResourceID Resource ID for the text string (or 0 to load based on the button ID).
Style Window style (WS_*)

6.5.5 TWOPART_BUTTON

The TWOPART_BUTTON macro implements a customizable toolbar button that is divided into two bitmaps. It can issue two separate command IDs (for example, an Undo-Redo button). The syntax for this macro is as follows:

Macro parameter Description
ButtonID Obtains the bitmap resource and command ID for the left side of the button.
ButtonID2 Obtains the bitmap resource for the right side of the button.
Style Window style (WS_*).
DispatchID The command ID for the right side of the button.

6.5.6 COMBO_BUTTON

The COMBO_BUTTON macro implements a customizable toolbar button from which you can drop down a combo box. The syntax is as follows:

Macro parameter Description
ButtonID Command ID for the button.
ComboID Command ID for the combo button.
Style Window style (WS_*).
ComboStyle Combo style (CBS_*). Not all combo styles are supported.
ComboDefWidth Default width of combo button.
ComboMinWidth Minimum width of combo button.
ComboHeight Height of combo button.


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.