CMFCRibbonCustomizePropertyPage Class
Implements a custom page for the Customize dialog box in Ribbon-based applications.
class CMFCRibbonCustomizePropertyPage: public CMFCPropertyPage
Name | Description |
---|---|
CMFCRibbonCustomizePropertyPage::CMFCRibbonCustomizePropertyPage | Constructs a CMFCRibbonCustomizePropertyPage object. |
CMFCRibbonCustomizePropertyPage::~CMFCRibbonCustomizePropertyPage |
Destructor. |
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. |
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);
CMFCRibbonCustomizePropertyPage
Header: afxribboncustomizedialog.h
Adds a custom category to the Commands combo box.
void AddCustomCategory(
LPCTSTR lpszName,
const CList<UINT, UINT>& lstIDS);
lpszName
[in] Specifies the custom category name.
lstIDS
[in] Contains ribbon command IDs to be shown in the custom category.
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);
pRibbonBar
[in] 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();
The default implementation applies the options selected in the Customize dialog box to the Quick Access Toolbar.