Share via


CMFCRibbonGalleryMenuButton クラス

リボン ギャラリーを含むリボン メニュー ボタンを実装します。 詳細については、Visual Studio インストールの VC\atlmfc\src\mfc フォルダーにあるソース コードを参照してください。

構文

class CMFCRibbonGalleryMenuButton : public CMFCToolBarMenuButton

メンバー

パブリック コンストラクター

名前 説明
CMFCRibbonGalleryMenuButton::CMFCRibbonGalleryMenuButton CMFCRibbonGalleryMenuButton オブジェクトを構築して初期化します。

パブリック メソッド

名前 説明
CMFCRibbonGalleryMenuButton::CopyFrom (オーバーライド CMFCToolBarMenuButton::CopyFrom.)
CMFCRibbonGalleryMenuButton::CreatePopupMenu (オーバーライド CMFCToolBarMenuButton::CreatePopupMenu.)
CMFCRibbonGalleryMenuButton::GetPalette
CMFCRibbonGalleryMenuButton::HasButton ( CMFCToolBarMenuButton::HasButtonをオーバーライドします)。
CMFCRibbonGalleryMenuButton::IsEmptyMenuAllowed (オーバーライド CMFCToolBarMenuButton::IsEmptyMenuAllowed.)

解説

ギャラリー メニュー ボタンが、矢印付きのポップアップ メニューとして表示されます。 ユーザーがこのボタンをクリックすると、イメージのギャラリーが表示されます。 ギャラリー メニュー ボタンを構築する場合は、それらのイメージが含まれているイメージ リストを指定する必要があります。

次の例は、メニュー ボタンに行頭記号のギャラリーを表示する方法を示しています。

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);
    }
}

継承階層

CObject
└ CMFCToolBarButton
└ CMFCToolBarMenuButton
  └ CMFCRibbonGalleryMenuButton

必要条件

ヘッダー: afxRibbonPaletteGallery.h

CMFCRibbonGalleryMenuButton::CopyFrom

virtual void CopyFrom(const CMFCToolBarButton& src);

パラメーター

[in] Src

解説

CMFCRibbonGalleryMenuButton::CMFCRibbonGalleryMenuButton

CMFCRibbonGalleryMenuButton オブジェクトを構築して初期化します。

CMFCRibbonGalleryMenuButton(
    UINT uiID,
    int iImage,
    LPCTSTR lpszText,
    CMFCToolBarImages& imagesPalette);

CMFCRibbonGalleryMenuButton(
    UINT uiID,
    int iImage,
    LPCTSTR lpszText,
    UINT uiImagesPaletteResID = 0,
    int cxPaletteImage = 0);

パラメーター

uiID
ボタンのコマンド ID。 これは、ユーザーがこのボタンをクリックしたときにWM_COMMAND メッセージで送信される値です。

iImage
ギャラリー メニュー ボタンと共に表示するイメージのインデックス。 イメージは imagesPalette パラメーターに格納されます。

lpszText
メニュー ボタンに表示するテキスト。

imagesPalette
ギャラリーに表示するイメージの一覧が含まれています。

uiImagesPaletteResID
ギャラリーに表示するイメージのイメージ 一覧のリソース ID。

cxPaletteImage
ギャラリーに表示するイメージの幅をピクセル単位で指定します。

解説

ギャラリー メニュー ボタンは、矢印を含むポップアップ メニューとして表示されます。 ユーザーがこのボタンをクリックすると、イメージのギャラリーが表示されます。

次の例では、クラスのコンストラクターを使用する方法を CMFCRibbonGalleryMenuButton 示します。 このコード スニペットは、MS Office 2007 デモ サンプル一部です。

// CMFCToolBarButton pExButton
CMFCRibbonGalleryMenuButton paletteBullet(pExButton->m_nID, pExButton->GetImage(), pExButton->m_strText);

CMFCRibbonGalleryMenuButton::CreatePopupMenu

virtual CMFCPopupMenu* CreatePopupMenu();

戻り値

解説

CMFCRibbonGalleryMenuButton::GetPalette

CMFCRibbonGallery& GetPalette();

戻り値

解説

CMFCRibbonGalleryMenuButton::HasButton

virtual BOOL HasButton() const;

戻り値

解説

CMFCRibbonGalleryMenuButton::IsEmptyMenuAllowed

virtual BOOL IsEmptyMenuAllowed() const;

戻り値

解説

関連項目

階層図
クラス
CMFCToolBarMenuButton クラス
CMFCRibbonGallery クラス