/** * @file XTPRibbonCustomizePage.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPRIBBONCUSTOMIZEPAGE_H__) # define __XTPRIBBONCUSTOMIZEPAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCustomizeSheet; class CXTPCommandBars; class CXTPRibbonBar; class CXTPCoreTreeItem; class CXTPCoreTreeItems; /** * @brief * CXTPRibbonCustomizePage is a CPropertyPage derived class. * It represents the Quick Access page of the Customize dialog. */ class _XTP_EXT_CLASS CXTPRibbonCustomizePage : public CXTPPropertyPage { // Construction public: /** * @brief * Constructs a CXTPRibbonCustomizePage object. * @param pSheet Pointer to a CXTPCustomizeSheet object. */ CXTPRibbonCustomizePage(CXTPCustomizeSheet* pSheet); /** * @brief * Constructs a CXTPRibbonCustomizePage object. * @param pCommandBars Pointer to a CXTPCommandBars object. */ CXTPRibbonCustomizePage(CXTPCommandBars* pCommandBars); /** * @brief * Destroys a CXTPCustomizeCommandsPage object, handles cleanup * and deallocation. */ virtual ~CXTPRibbonCustomizePage(); public: /** * @brief * Gets the ribbon bar to customize. * @return * A pointer to the ribbon bar to customize. */ CXTPRibbonBar* GetRibbonBar(); public: /** * @brief * Adds a categories branch from a menu resource. * @param nIDResource Menu resource from which categories will be built. * @param bListSubItems TRUE to add sub-menus to categories. * @return * TRUE if successful, otherwise FALSE. */ BOOL AddCategories(UINT nIDResource, BOOL bListSubItems = FALSE); /** * @brief * Adds a categories branch from Controls. * @param pControls Pointer to a CXTPControls object * @return * TRUE if successful, otherwise FALSE. */ BOOL AddCategories(CXTPControls* pControls); /** * @brief * Adds a new category from a CMenu object. * @param strCategory Category to be added. * @param pMenu Pointer to a CMenu object. * @param bListSubItems TRUE to add sub-menus to the category. * @return * TRUE if successful, otherwise FALSE. */ BOOL AddCategory(LPCTSTR strCategory, CMenu* pMenu, BOOL bListSubItems = FALSE); /** * @brief * Adds a new empty category at a specified index. * @param strCategory Category to be added. * @param nIndex Index to insert at. * @return * A pointer to a CXTPControls object. */ CXTPControls* InsertCategory(LPCTSTR strCategory, int nIndex = -1); /** * @brief * Retrieves the control list for a specified category. * @param strCategory Category with the control list to retrieve. * @return * A pointer to a CXTPControls object. */ CXTPControls* GetControls(LPCTSTR strCategory); protected: /** * @brief * Refills the list of Quick Access controls. */ void RefreshRibbonList(); // Implementation protected: /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ //{{AFX_VIRTUAL(CXTPRibbonCustomizePage) protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPRibbonCustomizePage) virtual BOOL OnInitDialog(); afx_msg void OnCategoriesSelectionChanged(); afx_msg void OnButtonAdd(); afx_msg void OnButtonRemove(); afx_msg void OnButtonReset(); afx_msg void OnCommandsSelectionChanged(); afx_msg void OnRibbonSelectionChanged(); afx_msg void OnRibbonTreeCheckChanged(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/); afx_msg void OnRibbonSelChanged(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnCommandsSelChanged(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); afx_msg void OnButtonNewTab(); afx_msg void OnButtonNewGroup(); afx_msg void OnButtonRename(); afx_msg void OnImportDropDown(); afx_msg void OnButtonUp(); afx_msg void OnButtonDown(); //}}AFX_MSG private: XTP_COMMANDBARS_CATEGORYINFO* FindCategory(LPCTSTR strCategory) const; XTP_COMMANDBARS_CATEGORYINFO* GetCategoryInfo(int nIndex); CXTPCoreTreeItem* FindItem(CCmdTarget* pItemData, CXTPCoreTreeItems* pItems = NULL); public: CXTPComboBox m_cmbCategories; /**< Categories list. */ CXTPComboBox m_cmbTabGroup; /**< Categories list. */ CXTPRibbonCustomizeTreeCtrl m_treeRibbon; /**< Ribbon list. */ CXTPRibbonCustomizeTreeCtrl m_treeCommands; /**< Ribbon list. */ protected: CXTPCustomizeSheet* m_pSheet; /**< Parent Sheet window. */ CXTPCommandBars* m_pCommandBars; /**< Parent CommandBars object. */ CXTPCommandBarsCategoryArray m_arrCategories; /**< Array of categories. */ friend class CXTPRibbonCustomizeTreeCtrl; CXTPButton m_btnAdd; CXTPButton m_btnRemove; CXTPButton m_btnNewTab; CXTPButton m_btnNewGroup; CXTPButton m_btnRename; CXTPButton m_btnReset; CXTPButton m_btnImport; CXTPButton m_btnUp; CXTPButton m_btnDown; # ifdef _XTP_INCLUDE_CONTROLS COLORREF m_clrText; # endif # ifdef _XTP_INCLUDE_MARKUP CXTPMarkupStatic& m_wndTitleIcon; CXTPMarkupStatic& m_wndTitle; # else CStatic& m_wndTitleIcon; CStatic& m_wndTitle; # endif }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPRIBBONCUSTOMIZEPAGE_H__) /** @endcond */