/** * @file XTPCustomizePageKeyboard.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(__XTPCUSTOMIZEKEYBOARDPAGE_H__) && defined(_XTP_INCLUDE_CONTROLS) # define __XTPCUSTOMIZEKEYBOARDPAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCustomizeSheet; class CXTPShortcutManagerAccelTable; /** * @brief * CXTPCustomizeKeyboardPage is a CPropertyPage derived class. * It represents the Keyboard page of the Customize dialog. */ class _XTP_EXT_CLASS CXTPCustomizeKeyboardPage : public CXTPPropertyPage { public: /** * @brief * Constructs a CXTPCustomizeKeyboardPage object * * @param pSheet Points to a CXTPCustomizeSheet object that this page * belongs to. */ CXTPCustomizeKeyboardPage(CXTPCustomizeSheet* pSheet); /** * @brief * Destroys a CXTPCustomizeKeyboardPage object, handles cleanup * and deallocation. */ ~CXTPCustomizeKeyboardPage(); public: /** * @brief * Finds the category. * * @param strCategory Category needed to find. * @return Returns category */ XTP_COMMANDBARS_CATEGORYINFO* FindCategory(LPCTSTR strCategory) const; /** * @brief * Gets the category by its index. * * @param nIndex Index of category * @return Returns category index */ XTP_COMMANDBARS_CATEGORYINFO* GetCategoryInfo(int nIndex) const; /** * @brief * This method adds a new empty category in the given index. * * @param strCategory Category to be added. * @param nIndex Index to insert. * * @return * A pointer to a CXTPControls object */ CXTPControls* InsertCategory(LPCTSTR strCategory, int nIndex = -1); /** * @brief * Adds a new category from a CMenu object. * * @param strCategory Category to be added. * @param pMenu Points to a CMenu object * @param bListSubItems TRUE to add sub menus to categories. * * @return * TRUE if successful; otherwise returns FALSE */ BOOL AddCategory(LPCTSTR strCategory, CMenu* pMenu, BOOL bListSubItems = FALSE); /** * @brief * Adds categories branch from Control or resource ID. * * @param pControls Points to a CXTPControls object * * @return * TRUE if successful; otherwise returns FALSE */ BOOL AddCategories(CXTPControls* pControls); /** * @brief * Adds categories branch from Control or resource ID. * * @param nIDResource Menu resource from where categories will be built. * @param bListSubItems TRUE to add sub menus to categories. * * @return * TRUE if successful; otherwise returns FALSE */ BOOL AddCategories(UINT nIDResource, BOOL bListSubItems = FALSE); /** * @brief * This member function is called by the page to reload the list * items. */ void ReloadList(); /** * @brief * This member function is called by the page to enable the * assignment buttons. */ void EnableControls(); /** * @return * Retrieves frame accelerators. */ CXTPShortcutManagerAccelTable* GetFrameAccelerator() const; /** * @brief * Updates frame accelerators. * * @param lpAccel Accelerator table to set. * @param nSize Number of items. */ void UpdateAcellTable(LPACCEL lpAccel, int nSize); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPCustomizeKeyboardPage) virtual BOOL OnSetActive(); virtual void DoDataExchange(CDataExchange* pDX); BOOL OnInitDialog(); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPCustomizeKeyboardPage) afx_msg void OnSelchangeCategory(); afx_msg void OnSelchangeCommands(); afx_msg void OnSelchangeCurKeys(); afx_msg void OnChangeShortcutKey(); afx_msg void OnAssign(); afx_msg void OnResetAll(); afx_msg void OnRemove(); afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); //}}AFX_MSG /** @endcond */ public: enum { IDD = XTP_IDD_PAGE_KEYBOARD /**< Property page identifier*/ }; # ifdef _XTP_INCLUDE_CONTROLS COLORREF m_clrText; CXTPButton m_btnAssign; CXTPButton m_btnRemove; CXTPButton m_btnResetAll; CXTPListBox m_lboxKeys; CXTPListBox m_lboxCommands; CXTPComboBox m_comboCategory; # else CButton m_btnAssign; CButton m_btnRemove; CButton m_btnResetAll; CListBox m_lboxKeys; /**< Keys list box*/ CListBox m_lboxCommands; /**< Commands list box*/ CComboBox m_comboCategory; /**< Categories combobox*/ # endif CString m_strDesc; /**< Description of selected control*/ int m_iCategory; /**< Selected category*/ CXTPShortcutManager::CKeyAssign m_editShortcutKey; /**< Shortcut edit control*/ protected: CXTPCommandBarsCategoryArray m_arrCategories; /**< Array of categories*/ CXTPCustomizeSheet* m_pSheet; /**< Parent Customize dialog*/ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCUSTOMIZEKEYBOARDPAGE_H__) /** @endcond */