/** * @file XTPRibbonCustomizeQuickAccessPage.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(__XTPRIBBONCUSTOMIZEQUICKACCESSPAGE_H__) # define __XTPRIBBONCUSTOMIZEQUICKACCESSPAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCustomizeSheet; class CXTPCommandBars; class CXTPRibbonBar; struct XTP_COMMANDBARS_CATEGORYINFO; /** * @brief * CXTPRibbonCustomizeQuickAccessPage is a CPropertyPage derived class. * It represents the Quick Access page of the Customize dialog. */ class _XTP_EXT_CLASS CXTPRibbonCustomizeQuickAccessPage : public CXTPPropertyPage { // Construction public: /** * @brief * Constructs a CXTPRibbonCustomizeQuickAccessPage object. * @param pSheet Pointer to a CXTPCustomizeSheet object. * @param nIDTemplate Identifier of the dialog resource to be used * as the page in the Customize dialog. */ CXTPRibbonCustomizeQuickAccessPage(CXTPCustomizeSheet* pSheet, UINT nIDTemplate = (UINT)-1); /** * @brief * Constructs a CXTPRibbonCustomizeQuickAccessPage object. * @param pCommandBars Pointer to a CXTPCommandBars object. */ CXTPRibbonCustomizeQuickAccessPage(CXTPCommandBars* pCommandBars); /** * @brief * Destroys a CXTPRibbonCustomizeQuickAccessPage object, handles * cleanup and deallocation. */ ~CXTPRibbonCustomizeQuickAccessPage(); 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); /** * @brief * Forces a page to update its internal data as this data is supposed * to be changed from outside the page. */ virtual void UpdatePage(void); protected: /** * @brief * Refills the list of Quick Access controls. */ void RefreshQuickAccessList(); // Implementation protected: /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ //{{AFX_VIRTUAL(CXTPRibbonCustomizeQuickAccessPage) protected: virtual void DoDataExchange(CDataExchange* pDX); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPRibbonCustomizeQuickAccessPage) afx_msg void OnCheckShowQuickAccessBelow(); virtual BOOL OnInitDialog(); afx_msg void OnCategoriesSelectionChanged(); afx_msg void OnDblclkListQuickAccess(); afx_msg void OnDblclkListCommands(); afx_msg void OnButtonAdd(); afx_msg void OnButtonRemove(); afx_msg void OnButtonReset(); afx_msg void OnCommandsSelectionChanged(); afx_msg void OnQuickAccessSelectionChanged(); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); //}}AFX_MSG private: XTP_COMMANDBARS_CATEGORYINFO* FindCategory(LPCTSTR strCategory) const; XTP_COMMANDBARS_CATEGORYINFO* GetCategoryInfo(int nIndex); public: # ifdef _XTP_INCLUDE_CONTROLS COLORREF m_clrText; CXTPButton m_btnAdd; CXTPButton m_btnRemove; CXTPButton m_btnReset; CXTPComboBox m_lstCategories; CXTPButton m_btnShowQuickAccessBelow; # else CButton m_btnAdd; CButton m_btnRemove; CButton m_btnReset; CComboBox m_lstCategories; /**< Categories list */ CButton m_btnShowQuickAccessBelow; # endif CXTPCustomizeCommandsListBox m_lstQuickAccess; /**< Quick Access list. */ CXTPCustomizeCommandsListBox m_lstCommands; /**< Commands list. */ BOOL m_bShowQuickAccessBelow; /**< TRUE to show Quick Access below ribbon. */ protected: CXTPCustomizeSheet* m_pSheet; /**< Parent Sheet window. */ CXTPCommandBars* m_pCommandBars; /**< Parent CommandBars object. */ CXTPCommandBarsCategoryArray m_arrCategories; /**< Array of categories. */ # 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(__XTPRIBBONCUSTOMIZEQUICKACCESSPAGE_H__) /** @endcond */