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

对话框与窗口

开发平台:

Visual C++

  1. // XTPPropertyPageNavigator.h : interface for the CXTPPropertyPageNavigator class.
  2. //
  3. // This file is a part of the XTREME CONTROLS 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(__XTPPROPERTYPAGENAVIGATOR_H__)
  22. #define __XTPPROPERTYPAGENAVIGATOR_H__
  23. //}}AFX_CODEJOCK_PRIVATE
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. #include "TabManager/XTPTabControl.h"
  28. #include "XTListBox.h"
  29. class CXTPPropertySheet;
  30. class CXTPPropertyPage;
  31. //===========================================================================
  32. // Summary:
  33. //     CXTPPropertyPageNavigator is a standalone class
  34. //     CXTPPropertyPageNavigator represents base navigator object for CXTPPropertySheet
  35. // See Also:
  36. //     CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator
  37. //===========================================================================
  38. class _XTP_EXT_CLASS CXTPPropertyPageNavigator
  39. {
  40. public:
  41. //-----------------------------------------------------------------------
  42. // Summary:
  43. //     Constructs a CXTPPropertyPageNavigator object.
  44. //-----------------------------------------------------------------------
  45. CXTPPropertyPageNavigator();
  46. //-----------------------------------------------------------------------
  47. // Summary:
  48. //     Destroys a CXTPPropertyPageNavigator object, handles cleanup and deallocation
  49. //-----------------------------------------------------------------------
  50. virtual ~CXTPPropertyPageNavigator();
  51. public:
  52. //-----------------------------------------------------------------------
  53. // Summary:
  54. //     This method is called to create page navigator
  55. //-----------------------------------------------------------------------
  56. virtual BOOL Create() = 0;
  57. //-----------------------------------------------------------------------
  58. // Summary:
  59. //     This method is called to reposition property sheet using size of property page
  60. // Parameters:
  61. //     pLayout - Address of an AFX_SIZEPARENTPARAMS structure
  62. //     szPage  - Page size to calculate from
  63. //     rcPage  - Result bounding rectangle of property pages
  64. //     szClient - Result size of property sheet
  65. //-----------------------------------------------------------------------
  66. virtual void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient) = 0;
  67. //-----------------------------------------------------------------------
  68. // Summary:
  69. //     This method is called to reposition property page using property sheet size
  70. // Parameters:
  71. //     pLayout - Address of an AFX_SIZEPARENTPARAMS structure
  72. //     szClient - Size of property sheet
  73. //     rcPage  - Result bounding rectangle of property pages
  74. //-----------------------------------------------------------------------
  75. virtual void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage) = 0;
  76. //-----------------------------------------------------------------------
  77. // Summary:
  78. //     This method is called when page become selected
  79. // Parameters:
  80. //     pPage - Property page that become selected.
  81. //-----------------------------------------------------------------------
  82. virtual void OnPageSelected(CXTPPropertyPage* pPage) = 0;
  83. //-----------------------------------------------------------------------
  84. // Summary:
  85. //     This method is called to get window handler of navigator window
  86. //-----------------------------------------------------------------------
  87. virtual HWND GetSafeHwnd() const = 0;
  88. //-----------------------------------------------------------------------
  89. // Summary:
  90. //     Retrieves page brush.
  91. // Parameters:
  92. //     pDC - Pointer to valid device context
  93. //     pPage - Property page to draw
  94. //-----------------------------------------------------------------------
  95. virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage) = 0;
  96. public:
  97. CRect m_rcNavigatorMargin;  // Total navigator margin
  98. CRect m_rcButtonMargin;     // Total buttons margin
  99. CRect m_rcPageMargin;       // Total page margin
  100. protected:
  101. CXTPPropertySheet* m_pSheet;    // Parent property sheet object
  102. friend class CXTPPropertySheet;
  103. };
  104. //===========================================================================
  105. // Summary:
  106. //     CXTPPropertyPageTabNavigator is CXTPTabControl and CXTPPropertyPageNavigator derived class
  107. //     It represents tabbed property page navigator
  108. // See Also:
  109. //     CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator
  110. //===========================================================================
  111. class _XTP_EXT_CLASS CXTPPropertyPageTabNavigator : public CXTPTabControl, public CXTPPropertyPageNavigator
  112. {
  113. public:
  114. //-----------------------------------------------------------------------
  115. // Summary:
  116. //     Constructs a CXTPPropertyPageTabNavigator object.
  117. //-----------------------------------------------------------------------
  118. CXTPPropertyPageTabNavigator();
  119. //{{AFX_CODEJOCK_PRIVATE
  120. public:
  121. virtual BOOL Create();
  122. void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient);
  123. void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage);
  124. virtual void OnPageSelected(CXTPPropertyPage* pPage);
  125. virtual HWND GetSafeHwnd() const { return m_hWnd; }
  126. virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage);
  127. protected:
  128. void SetSelectedItem(CXTPTabManagerItem* pItem);
  129. protected:
  130. DECLARE_MESSAGE_MAP()
  131. afx_msg void OnSysColorChange();
  132. private:
  133. CBrush m_brushPage;
  134. COLORREF m_clrBrush;
  135. //}}AFX_CODEJOCK_PRIVATE
  136. };
  137. //===========================================================================
  138. // Summary:
  139. //     CXTPPropertyPageControlNavigator is CXTPPropertyPageNavigator derived class
  140. //     It represents base control property page navigator
  141. // See Also:
  142. //     CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator
  143. //===========================================================================
  144. class _XTP_EXT_CLASS CXTPPropertyPageControlNavigator : public CXTPPropertyPageNavigator
  145. {
  146. public:
  147. //-----------------------------------------------------------------------
  148. // Summary:
  149. //     Constructs a CXTPPropertyPageControlNavigator object.
  150. //-----------------------------------------------------------------------
  151. CXTPPropertyPageControlNavigator();
  152. //{{AFX_CODEJOCK_PRIVATE
  153. public:
  154. void PageToSize(AFX_SIZEPARENTPARAMS* pLayout, CSize szPage, CRect& rcPage, CSize& szClient);
  155. void SizeToPage(AFX_SIZEPARENTPARAMS* pLayout, CSize szClient, CRect& rcPage);
  156. virtual HBRUSH GetPageBrush(CDC* pDC, CXTPPropertyPage* pPage);
  157. public:
  158. CSize m_szControl;
  159. private:
  160. CBrush m_brushPage;
  161. COLORREF m_clrBrush;
  162. //}}AFX_CODEJOCK_PRIVATE
  163. };
  164. //===========================================================================
  165. // Summary:
  166. //     CXTPPropertyPageListNavigator is CXTListBox and CXTPPropertyPageControlNavigator derived class
  167. //     It represents list property page navigator
  168. // See Also:
  169. //     CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator
  170. //===========================================================================
  171. class _XTP_EXT_CLASS CXTPPropertyPageListNavigator : public CXTListBox, public CXTPPropertyPageControlNavigator
  172. {
  173. public:
  174. //-----------------------------------------------------------------------
  175. // Summary:
  176. //     Constructs a CXTPPropertyPageListNavigator object.
  177. //-----------------------------------------------------------------------
  178. CXTPPropertyPageListNavigator();
  179. //{{AFX_CODEJOCK_PRIVATE
  180. public:
  181. virtual BOOL Create();
  182. virtual void OnPageSelected(CXTPPropertyPage* pPage);
  183. virtual HWND GetSafeHwnd() const { return m_hWnd; }
  184. protected:
  185. DECLARE_MESSAGE_MAP()
  186. afx_msg void OnSelChanged();
  187. public:
  188. int m_nItemMargin;
  189. protected:
  190. //}}AFX_CODEJOCK_PRIVATE
  191. };
  192. //===========================================================================
  193. // Summary:
  194. //     CXTPPropertyPageTreeNavigator is CTreeCtrl and CXTPPropertyPageControlNavigator derived class
  195. //     It represents tree property page navigator
  196. // See Also:
  197. //     CXTPPropertySheet, CXTPPropertySheet::DoModal, CXTPPropertySheet::SetNavigator
  198. //===========================================================================
  199. class _XTP_EXT_CLASS CXTPPropertyPageTreeNavigator : public CTreeCtrl, public CXTPPropertyPageControlNavigator
  200. {
  201. public:
  202. //-----------------------------------------------------------------------
  203. // Summary:
  204. //     Constructs a CXTPPropertyPageTreeNavigator object.
  205. // Parameters:
  206. //     dwStyle - style of tree control to be used
  207. //-----------------------------------------------------------------------
  208. CXTPPropertyPageTreeNavigator(DWORD dwStyle = TVS_SHOWSELALWAYS);
  209. //{{AFX_CODEJOCK_PRIVATE
  210. public:
  211. virtual BOOL Create();
  212. virtual void OnPageSelected(CXTPPropertyPage* pPage);
  213. virtual HWND GetSafeHwnd() const { return m_hWnd; }
  214. protected:
  215. virtual BOOL CreateTree();
  216. protected:
  217. DECLARE_MESSAGE_MAP()
  218. afx_msg void OnSelChanging(NMHDR* pNMHeader, LRESULT* pResult);
  219. protected:
  220. DWORD m_dwStyle;
  221. //}}AFX_CODEJOCK_PRIVATE
  222. };
  223. #endif // !defined(__XTPPROPERTYPAGENAVIGATOR_H__)