void CBCGPToolbarCustomize::AddMenuCommands | ( | const CMenu * | pMenu, |
BOOL | bPopup, | ||
LPCTSTR | lpszCategory = NULL , |
||
LPCTSTR | lpszMenuPath = NULL |
||
) |
Adds a menu commands to the list box of commands on the "Commands" page.
The AddMenuCommands function loops over all menu items of pMenu. For each menu item it checks whether the item has a valid command ID (a regular item), 0 (a separator), or it is a popup menu item. Then, it converts the regular items to the CBCGPToolbarButton objects, and calls the AddButton() member function to add the menu item as a toolbar button to the list box of commands on the "Commands" page.
If bPopup is TRUE it converts the popup menu items to the CBCGPToolbarMenuButton objects and inserts them to the list of commands, otherwise the popup menu items are not displayed in the list of commands.
When this function encounters a popup menu item, it calls itself recursively passing a pointer to the sub menu as the pMenu parameter.
pMenu | Specifies a pointer to the CMenu object to add. |
bPopup | Specifies whether to insert the popup menu items to the list of commands. |
lpszCategory | Specifies the name of the category to insert the menu. |
lpszMenuPath | Specifies the name of the category to insert the menu. |