CMFCRibbonGalleryMenuButton Class
Implements a ribbon menu button that contains ribbon galleries.
class CMFCRibbonGalleryMenuButton : public CMFCToolBarMenuButton
Members
Public Constructors
Name |
Description |
---|---|
Constructs and initializes a CMFCRibbonGalleryMenuButton object. |
Public Methods
Name |
Description |
---|---|
(Overrides CMFCToolBarMenuButton::CopyFrom.) |
|
(Overrides CMFCToolBarMenuButton::CreatePopupMenu.) |
|
|
|
(Overrides CMFCToolBarMenuButton::HasButton.) |
|
(Overrides CMFCToolBarMenuButton::IsEmptyMenuAllowed.) |
Remarks
The gallery menu button is displayed as a pop-up menu with an arrow. When the user clicks this button, a gallery of images is displayed. When you construct a gallery menu button, you must specify an image list that contains those images.
Example
The following example demonstrates how to display a gallery of bullets in a menu button:
BOOL CMainFrame::OnShowPopupMenu (CMFCPopupMenu* pMenuPopup)
{
int nBulletIndex = pMenuBar->CommandToIndex (ID_PARA_BULLETS);
if (nBulletIndex >= 0)
{
CMFCToolBarButton* pExButton =
pMenuBar->GetButton(nBulletIndex);
ASSERT_VALID (pExButton);
CMFCRibbonGalleryMenuButton paletteBullet (
pExButton->m_nID,
pExButton->GetImage (),
pExButton->m_strText);
InitBulletPalette (&paletteBullet.GetPalette ());
pMenuBar->ReplaceButton (ID_PARA_BULLETS, paletteBullet);
}
}
Inheritance Hierarchy
CObject CMFCToolBarButton CMFCToolBarMenuButton CMFCRibbonGalleryMenuButton
Requirements
Header: afxRibbonPaletteGallery.h