Partager via


CMFCRibbonGalleryMenuButton Class

Implements a ribbon menu button that contains ribbon galleries.

class CMFCRibbonGalleryMenuButton : public CMFCToolBarMenuButton

Members

Public Constructors

Name

Description

CMFCRibbonGalleryMenuButton::CMFCRibbonGalleryMenuButton

Constructs and initializes a CMFCRibbonGalleryMenuButton object.

Public Methods

Name

Description

CMFCRibbonGalleryMenuButton::CopyFrom

  (Overrides CMFCToolBarMenuButton::CopyFrom.)

CMFCRibbonGalleryMenuButton::CreatePopupMenu

  (Overrides CMFCToolBarMenuButton::CreatePopupMenu.)

CMFCRibbonGalleryMenuButton::GetPalette

 

CMFCRibbonGalleryMenuButton::HasButton

  (Overrides CMFCToolBarMenuButton::HasButton.)

CMFCRibbonGalleryMenuButton::IsEmptyMenuAllowed

  (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

See Also

Reference

Hierarchy Chart

CMFCToolBarMenuButton Class

CMFCRibbonGallery Class

Other Resources

MFC Classes