CMFCRibbonCustomizePropertyPage Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCRibbonCustomizePropertyPage Class.

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

class CMFCRibbonCustomizePropertyPage: public CMFCPropertyPage  

Public Constructors

NameDescription
CMFCRibbonCustomizePropertyPage::CMFCRibbonCustomizePropertyPageConstructs a CMFCRibbonCustomizePropertyPage object.
CMFCRibbonCustomizePropertyPage::~CMFCRibbonCustomizePropertyPageDestructor.

Public Methods

NameDescription
CMFCRibbonCustomizePropertyPage::AddCustomCategoryAdds a custom category to the Commands combo box.
CMFCRibbonCustomizePropertyPage::CreateObjectUsed by the framework to create a dynamic instance of this class type.
CMFCRibbonCustomizePropertyPage::GetThisClassUsed by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.
CMFCRibbonCustomizePropertyPage::OnOKCalled by the system when a user clicks OK on the Customize dialog box.

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.

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

CObject

CCmdTarget

CWnd

CDialog

CPropertyPage

CMFCPropertyPage

CMFCRibbonCustomizePropertyPage

Header: afxribboncustomizedialog.h

Adds a custom category to the Commands combo box.

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

Parameters

ParameterDescription
[in] lpszNameSpecifies the custom category name.
[in] lstIDSContains 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.

Constructs a CMFCRibbonCustomizePropertyPage object.

CMFCRibbonCustomizePropertyPage(CMFCRibbonBar* pRibbonBar = NULL);

Parameters

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

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.

Hierarchy Chart
Classes

Show: