CMFCRibbonCustomizePropertyPage Class

Implements a custom page for the Customize dialog box in Ribbon-based applications.

Syntax

class CMFCRibbonCustomizePropertyPage: public CMFCPropertyPage

Members

Public Constructors

Name Description
CMFCRibbonCustomizePropertyPage::CMFCRibbonCustomizePropertyPage Constructs a CMFCRibbonCustomizePropertyPage object.
CMFCRibbonCustomizePropertyPage::~CMFCRibbonCustomizePropertyPage Destructor.

Public Methods

Name Description
CMFCRibbonCustomizePropertyPage::AddCustomCategory Adds a custom category to the Commands combo box.
CMFCRibbonCustomizePropertyPage::CreateObject Used by the framework to create a dynamic instance of this class type.
CMFCRibbonCustomizePropertyPage::GetThisClass Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.
CMFCRibbonCustomizePropertyPage::OnOK Called by the system when a user clicks OK on the Customize dialog box.

Remarks

If you want to add custom commands to the Customize dialog box, you must handle the AFX_WM_ON_RIBBON_CUSTOMIZE message. In the message handler, instantiate a CMFCRibbonCustomizePropertyPage object on the stack. Create a list of custom commands, and then call AddCustomCategory to add the new page to the Customize dialog box.

Example

The following example demonstrates how to construct a CMFCRibbonCustomizePropertyPage object and to add a custom category.

// Create "Customize" page
// CMFCRibbonBar m_wndRibbonBar
CMFCRibbonCustomizePropertyPage pageCustomize(&m_wndRibbonBar);

// Create a list of popular items:
CList<UINT, UINT> lstPopular;
lstPopular.AddTail(ID_FILE_NEW);
lstPopular.AddTail(ID_FILE_OPEN);

// add a custom category
pageCustomize.AddCustomCategory(_T("Popular Commands"), lstPopular);

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CDialog

CPropertyPage

CMFCPropertyPage

CMFCRibbonCustomizePropertyPage

Requirements

Header: afxribboncustomizedialog.h

CMFCRibbonCustomizePropertyPage::AddCustomCategory

Adds a custom category to the Commands combo box.

void AddCustomCategory(
    LPCTSTR lpszName,
    const CList<UINT, UINT>& lstIDS);

Parameters

lpszName
[in] Specifies the custom category name.

lstIDS
[in] Contains ribbon command IDs to be shown in the custom category.

Remarks

This method adds a category named lpszName to the Commands combo box. When the user selects the category, the commands specified in lstIDS appear in the command list.

CMFCRibbonCustomizePropertyPage::CMFCRibbonCustomizePropertyPage

Constructs a CMFCRibbonCustomizePropertyPage object.

CMFCRibbonCustomizePropertyPage(CMFCRibbonBar* pRibbonBar = NULL);

Parameters

pRibbonBar
[in] A pointer to a ribbon control for which the options to customize.

CMFCRibbonCustomizePropertyPage::OnOK

Calleld by the system when a user clicks OK on the Customize dialog box.

virtual void OnOK();

Remarks

The default implementation applies the options selected in the Customize dialog box to the Quick Access Toolbar.

See also

Hierarchy Chart
Classes