Provides access to members that control ToolbarControl menu items. Note: the IToolbarMenu interface has been superseded byIToolbarMenu2. Please consider using the more recent version.
Product Availability
Description
A ToolbarMenu supplies the implementation of a menu item that can host Command, Tool, ToolControl, MultiItem and ToolbarPalette objetcs. A ToolbarMenu can either be hosted on the ToolbarControl or can appear as a popup menu.
A ToolbarMenu can be built in two ways. Firstly, an object implementing IMenuDef can be passed to the IToolbarControl::AddItem or IToolbarControl::AddMenuItem method which creates a ToolbarMenu object and populates it from the menu definition. Secondly, the properties and methods on the IToolbarMenu interface can be used to build a menu. Any sub menus on a ToolbarMenu are implemented as another instance of a IToolbarMenu.
Members
Description | ||
---|---|---|
AddItem | Adds an item to the ToolbarMenu. | |
AddSubMenu | Adds a sub-menu to the ToolbarMenu. | |
Bitmap | The bitmap that is used as the icon on this ToolbarMenu. | |
Caption | The caption used by the ToolbarMenu. | |
CommandPool | The CommandPool used by the ToolbarMenu. | |
Count | The number of items on the ToolbarMenu. | |
Find | Returns the index of the first item containing the given command or menu. Returns -1 if it is not found. | |
GetItem | Returns the item at the specified index from the ToolbarMenu. | |
GetMenuDef | Returns the menu definition, this method is obsolete. | |
Hook | The object that is passed as a hook to the OnCreate event of each item's command. | |
MoveItem | Moves an item from one index to another. | |
PopupMenu | Pops up the menu at the position specified. | |
Remove | Removes the item at the specified index from the ToolbarMenu. | |
RemoveAll | Removes all items from the ToolbarMenu. | |
SetHook | Sets the object that is passed as a hook to the OnCreate event of each item's command. |
CoClasses that implement IToolbarMenu
CoClasses and Classes | Description |
---|---|
ToolbarMenu | A menu containing commands that can be used from a ToolbarControl or as a popup menu. |
Remarks
ToolbarMenu items support accelerator (shortcut) and access keys, defined in the ICommand::Caption property. For example, a 'Close' command with the caption "&Close\tAlt+F4" has the 'ALT+F4' key combination as its shortcut key, and the 'C' key as its access key. Although a shortcut key will always work, an access key will only work when the ToolbarMenu is active.