XTPCustomizeKeyboardPage.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:6k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // XTPCustomizeKeyboardPage.h : interface for the CXTPCustomizeKeyboardPage class.
  2. //
  3. // This file is a part of the XTREME COMMANDBARS MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. //{{AFX_CODEJOCK_PRIVATE
  21. #if !defined(__XTPCUSTOMIZEKEYBOARDPAGE_H__)
  22. #define __XTPCUSTOMIZEKEYBOARDPAGE_H__
  23. //}}AFX_CODEJOCK_PRIVATE
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. class CXTPCustomizeSheet;
  28. class CXTPShortcutManagerAccelTable;
  29. //===========================================================================
  30. // Summary:
  31. //     CXTPCustomizeKeyboardPage is a CPropertyPage derived class.
  32. //     It represents the Keyboard page of the Customize dialog.
  33. //===========================================================================
  34. class _XTP_EXT_CLASS CXTPCustomizeKeyboardPage : public CPropertyPage
  35. {
  36. public:
  37. //-----------------------------------------------------------------------
  38. // Summary:
  39. //     Constructs a CXTPCustomizeKeyboardPage object
  40. // Parameters:
  41. //     pSheet - Points to a CXTPCustomizeSheet object that this page
  42. //     belongs to.
  43. //-----------------------------------------------------------------------
  44. CXTPCustomizeKeyboardPage(CXTPCustomizeSheet* pSheet);
  45. //-----------------------------------------------------------------------
  46. // Summary:
  47. //     Destroys a CXTPCustomizeKeyboardPage object, handles cleanup
  48. //     and deallocation.
  49. //-----------------------------------------------------------------------
  50. ~CXTPCustomizeKeyboardPage();
  51. public:
  52. //-----------------------------------------------------------------------
  53. // Summary:
  54. //     Finds the category.
  55. // Parameters:
  56. //     strCategory - Category needed to find.
  57. //-----------------------------------------------------------------------
  58. XTP_COMMANDBARS_CATEGORYINFO* FindCategory(LPCTSTR strCategory) const;
  59. //-----------------------------------------------------------------------
  60. // Summary:
  61. //     This method adds a new empty category in the given index.
  62. // Parameters:
  63. //     strCategory - Category to be added.
  64. //     nIndex - Index to insert.
  65. // Returns:
  66. //     A pointer to a CXTPControls object
  67. //-----------------------------------------------------------------------
  68. CXTPControls* InsertCategory(LPCTSTR strCategory, int nIndex = -1);
  69. //-----------------------------------------------------------------------
  70. // Summary:
  71. //     Adds a new category from a CMenu object.
  72. // Parameters:
  73. //     strCategory - Category to be added.
  74. //     pMenu - Points to a CMenu object
  75. //     bListSubItems - TRUE to add sub menus to categories.
  76. // Returns:
  77. //     TRUE if successful; otherwise returns FALSE
  78. //-----------------------------------------------------------------------
  79. BOOL AddCategory(LPCTSTR strCategory, CMenu* pMenu, BOOL bListSubItems = FALSE);
  80. //-----------------------------------------------------------------------
  81. // Summary:
  82. //     Adds categories branch from Control or resource ID.
  83. // Parameters:
  84. //     pControls - Points to a CXTPControls object
  85. //     nIDResource - Menu resource from where categories will be built.
  86. //     bListSubItems - TRUE to add sub menus to categories.
  87. // Returns:
  88. //     TRUE if successful; otherwise returns FALSE
  89. //-----------------------------------------------------------------------
  90. BOOL AddCategories(CXTPControls* pControls);
  91. BOOL AddCategories(UINT nIDResource, BOOL bListSubItems = FALSE); //<combine CXTPCustomizeKeyboardPage::AddCategories@CXTPControls*>
  92. //-----------------------------------------------------------------------
  93. // Summary:
  94. //     This member function is called by the page to reload the list
  95. //     items.
  96. //-----------------------------------------------------------------------
  97. void ReloadList();
  98. //-----------------------------------------------------------------------
  99. // Summary:
  100. //     This member function is called by the page to enable the
  101. //     assignment buttons.
  102. //-----------------------------------------------------------------------
  103. void EnableControls();
  104. //-----------------------------------------------------------------------
  105. // Summary:
  106. //     Retrieves frame accelerators.
  107. //-----------------------------------------------------------------------
  108. CXTPShortcutManagerAccelTable* GetFrameAccelerator() const;
  109. //-----------------------------------------------------------------------
  110. // Summary:
  111. //     Updates frame accelerators.
  112. // Parameters:
  113. //     lpAccel - Accelerator table to set.
  114. //     nSize - Number of items.
  115. //-----------------------------------------------------------------------
  116. void UpdateAcellTable(LPACCEL lpAccel, int nSize);
  117. protected:
  118. //{{AFX_CODEJOCK_PRIVATE
  119. DECLARE_MESSAGE_MAP()
  120. //{{AFX_VIRTUAL(CXTPCustomizeKeyboardPage)
  121. virtual BOOL OnSetActive();
  122. virtual void DoDataExchange(CDataExchange* pDX);
  123. BOOL OnInitDialog();
  124. //}}AFX_VIRTUAL
  125. //{{AFX_MSG(CXTPCustomizeKeyboardPage)
  126. afx_msg void OnSelchangeCategory();
  127. afx_msg void OnSelchangeCommands();
  128. afx_msg void OnSelchangeCurKeys();
  129. afx_msg void OnChangeShortcutKey();
  130. afx_msg void OnAssign();
  131. afx_msg void OnResetAll();
  132. afx_msg void OnRemove();
  133. //}}AFX_MSG
  134. //}}AFX_CODEJOCK_PRIVATE
  135. public:
  136. enum
  137. {
  138. IDD = XTP_IDD_PAGE_KEYBOARD     // Property page identifier
  139. };
  140. CListBox        m_lboxKeys;         // Keys list box
  141. CListBox        m_lboxCommands;     // Commands list box
  142. CComboBox       m_comboCategory;    // Categories combo box
  143. CString         m_strDesc;          // Description of selected control
  144. int             m_iCategory;        // Selected category
  145. CXTPShortcutManager::CKeyAssign m_editShortcutKey;          // Shortcut edit control
  146. protected:
  147. CXTPCommandBarsCategoryArray  m_arrCategories;  // Array of categories
  148. CXTPCustomizeSheet* m_pSheet;                   // Parent Customize dialog
  149. };
  150. #endif // !defined(__XTPCUSTOMIZEKEYBOARDPAGE_H__)