void CBCGPToolbarCustomize::ReplaceButton | ( | UINT | uiCmd, |
const CBCGPToolbarButton & | button | ||
) |
Replaces a toolbar button in the list box of commands on the "Commands" page.
When the customization dialog scans all menus and toolbars, it inserts the buttons into the list box of commands as the regular CBCGPToolbarButton objects. Therefore, if the actual button object is derived from CBCGPToolbarButton, the customization dialog will not recognize it, and if the user tries to insert this button into toolbar, the inserted button will be a CBCGPToolbarButton object.
To prevent this, you need in your code explicitly replace the buttons that are derived from CBCGPToolbarButton.
Example:
uiCmd | Specifies the command of the button to be replaced. |
button | A const reference the toolbar button object that replaces the old button. |