ExtResizableDialog.h
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:8k
源码类别:

界面编程

开发平台:

Visual C++

  1. // This is part of the Professional User Interface Suite library.
  2. // Copyright (C) 2001-2009 FOSS Software, Inc.
  3. // All rights reserved.
  4. //
  5. // http://www.prof-uis.com
  6. // mailto:support@prof-uis.com
  7. //
  8. // This source code can be used, modified and redistributed
  9. // under the terms of the license agreement that is included
  10. // in the Professional User Interface Suite package.
  11. //
  12. // Warranties and Disclaimers:
  13. // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
  14. // INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  16. // IN NO EVENT WILL FOSS SOFTWARE INC. BE LIABLE FOR ANY DIRECT,
  17. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES,
  18. // INCLUDING DAMAGES FOR LOSS OF PROFITS, LOSS OR INACCURACY OF DATA,
  19. // INCURRED BY ANY PERSON FROM SUCH PERSON'S USAGE OF THIS SOFTWARE
  20. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  21. #if (!defined __EXT_RESIZABLE_DIALOG_H)
  22. #define __EXT_RESIZABLE_DIALOG_H
  23. #if (!defined __EXT_MFC_DEF_H)
  24. #include <ExtMfcDef.h>
  25. #endif // __EXT_MFC_DEF_H
  26. #if (!defined __EXT_BUTTON_H)
  27. #include <ExtButton.h>
  28. #endif // __EXT_BUTTON_H
  29. #if (!defined __EXT_TEMPL_H)
  30. #include <ExtTempl.h>
  31. #endif // __EXT_TEMPL_H
  32. #if (!defined __ExtCmdManager_H)
  33. #include <ExtCmdManager.h>
  34. #endif
  35. #if (!defined __EXT_HOOK_H)
  36. #include "../Src/ExtHook.h"
  37. #endif
  38. class CExtBitmap;
  39. #if _MSC_VER > 1000
  40. #pragma once
  41. #endif // _MSC_VER > 1000
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CExtResizableDialog window
  44. #if _MFC_VER < 0x700
  45. #define __BASEOF_CExtResizableDialog__ CExtResDlg
  46. #else
  47. #define __BASEOF_CExtResizableDialog__ CExtADLG < CExtResDlg >
  48. #ifndef __EXT_PROFUIS_STATIC_LINK
  49. template class __PROF_UIS_API __BASEOF_CExtResizableDialog__;
  50. template class __PROF_UIS_API CExtWS < __BASEOF_CExtResizableDialog__ >;
  51. template class __PROF_UIS_API CExtWA < CExtWS < __BASEOF_CExtResizableDialog__ > >;
  52. #endif  // #ifndef __EXT_PROFUIS_STATIC_LINK
  53. #endif
  54. class __PROF_UIS_API CExtResizableDialog
  55. : public CExtWA < CExtWS < __BASEOF_CExtResizableDialog__ > >
  56. , public CExtHookSpy
  57. {
  58. public:
  59. bool m_bEnabledControlBarUpdate:1;
  60. protected:
  61. bool m_bInConrolBarUpdate:1;
  62. HWND m_hWndFocus;
  63. bool _SaveFocusControl();
  64. bool m_bHelperSizingMoving:1;
  65. // Construction
  66. public:
  67. DECLARE_DYNCREATE( CExtResizableDialog )
  68. CExtResizableDialog();
  69. CExtResizableDialog(
  70. UINT nIDTemplate,
  71. CWnd * pParentWnd = NULL
  72. );
  73. CExtResizableDialog(
  74. __EXT_MFC_SAFE_LPCTSTR lpszTemplateName,
  75. CWnd * pParentWnd = NULL
  76. );
  77. virtual ~CExtResizableDialog();
  78. virtual __EXT_MFC_SAFE_LPCTSTR OnQuerySkinnedFontParmName() const;
  79. // Operations
  80. public:
  81. // Overrides
  82. //{{AFX_VIRTUAL(CExtResizableDialog)
  83. public:
  84. virtual BOOL PreTranslateMessage(MSG* pMsg);
  85. protected:
  86. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  87. virtual void PreSubclassWindow();
  88. virtual void PostNcDestroy();
  89. //}}AFX_VIRTUAL
  90. // Implementation
  91. public:
  92. virtual bool OnHookSpyPreTranslateMessage(
  93. MSG * pMSG
  94. );
  95. virtual bool OnHookSpyKeyMsg(
  96. MSG * pMSG
  97. );
  98. // Generated message map functions
  99. protected:
  100. //{{AFX_MSG(CExtResizableDialog)
  101. //}}AFX_MSG
  102. DECLARE_MESSAGE_MAP()
  103. virtual void OnOK();
  104. virtual void OnCancel();
  105. public:
  106. static bool g_bAllowLongFocusJumpFix;
  107. bool m_bAllowLongFocusJumpFix:1;
  108. static bool g_bProcessingLongFocusJump;
  109. static bool g_bProcessingLongFocusJumpToPrevDir;
  110. static HWND stat_GetNextItemZ( HWND hWndMain, HWND hWndDialog, HWND hWndControl, BOOL bPrevious );
  111. }; // class CExtResizableDialog
  112. /////////////////////////////////////////////////////////////////////////////
  113. // CExtResizablePropertyPage window
  114. #if _MFC_VER < 0x700
  115. #define __BASEOF_CExtResizablePropertyPage__ CExtResPP
  116. #else
  117. #define __BASEOF_CExtResizablePropertyPage__ CExtAPPG < CExtResPP >
  118. #ifndef __EXT_PROFUIS_STATIC_LINK
  119. template class __PROF_UIS_API __BASEOF_CExtResizablePropertyPage__;
  120. template class __PROF_UIS_API CExtWS < __BASEOF_CExtResizablePropertyPage__ >;
  121. template class __PROF_UIS_API CExtWA < CExtWS < __BASEOF_CExtResizablePropertyPage__ > >;
  122. #endif  // #ifndef __EXT_PROFUIS_STATIC_LINK
  123. #endif
  124. class __PROF_UIS_API CExtResizablePropertyPage
  125. : public CExtWA < CExtWS < __BASEOF_CExtResizablePropertyPage__ > >
  126. , public CExtHookSink
  127. {
  128. public:
  129. bool m_bEnabledControlBarUpdate:1;
  130. protected:
  131. bool m_bInConrolBarUpdate:1;
  132. // Construction
  133. public:
  134. DECLARE_DYNCREATE( CExtResizablePropertyPage )
  135. CExtResizablePropertyPage();
  136. CExtResizablePropertyPage(
  137. UINT nIDTemplate,
  138. UINT nIDCaption = 0 
  139. );
  140. CExtResizablePropertyPage(
  141. __EXT_MFC_SAFE_LPCTSTR lpszTemplateName,
  142. UINT nIDCaption = 0 
  143. );
  144. virtual ~CExtResizablePropertyPage();
  145. virtual __EXT_MFC_SAFE_LPCTSTR OnQuerySkinnedFontParmName() const;
  146. // Operations
  147. public:
  148. // Overrides
  149. //{{AFX_VIRTUAL(CExtResizablePropertyPage)
  150. public:
  151. virtual BOOL PreTranslateMessage(MSG* pMsg);
  152. protected:
  153. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  154. virtual void PreSubclassWindow();
  155. //}}AFX_VIRTUAL
  156. // Implementation
  157. public:
  158. // Generated message map functions
  159. protected:
  160. //{{AFX_MSG(CExtResizablePropertyPage)
  161. //}}AFX_MSG
  162. DECLARE_MESSAGE_MAP()
  163. virtual void OnOK();
  164. virtual void OnCancel();
  165. protected:
  166. virtual bool OnHookWndMsg(
  167. LRESULT & lResult,
  168. HWND hWndHooked,
  169. UINT nMessage,
  170. WPARAM & wParam,
  171. LPARAM & lParam
  172. );
  173. }; // class CExtResizablePropertyPage
  174. /////////////////////////////////////////////////////////////////////////////
  175. // CExtResizablePropertySheet window
  176. #if _MFC_VER < 0x700
  177. #define __BASEOF_CExtResizablePropertySheet__ CExtResPS
  178. #else
  179. #define __BASEOF_CExtResizablePropertySheet__ CExtAPSH < CExtResPS >
  180. #ifndef __EXT_PROFUIS_STATIC_LINK
  181. template class __PROF_UIS_API __BASEOF_CExtResizablePropertySheet__;
  182. template class __PROF_UIS_API CExtWS < __BASEOF_CExtResizablePropertySheet__ >;
  183. template class __PROF_UIS_API CExtWA < CExtWS < __BASEOF_CExtResizablePropertySheet__ > >;
  184. #endif  // #ifndef __EXT_PROFUIS_STATIC_LINK
  185. #endif
  186. class __PROF_UIS_API CExtResizablePropertySheet
  187. : public CExtWA < CExtWS < __BASEOF_CExtResizablePropertySheet__ > >
  188. , public CExtHookSink
  189. {
  190. protected:
  191. bool m_bSheetInitialized:1;
  192. class __PROF_UIS_API CButtonInSheetHook : public CExtButton
  193. {
  194. public:
  195. virtual void PostNcDestroy()
  196. {
  197. CExtButton::PostNcDestroy();
  198. delete this;
  199. }
  200. }; // class CButtonInSheetHook
  201. void _SyncActivePage(
  202. CPropertyPage * pActivePage = NULL
  203. );
  204. // Construction
  205. public:
  206. DECLARE_DYNCREATE( CExtResizablePropertySheet )
  207. CExtResizablePropertySheet();
  208. CExtResizablePropertySheet(
  209. UINT nIDCaption,
  210. CWnd *pParentWnd = NULL,
  211. UINT iSelectPage = 0
  212. );
  213. CExtResizablePropertySheet(
  214. __EXT_MFC_SAFE_LPCTSTR pszCaption,
  215. CWnd *pParentWnd = NULL,
  216. UINT iSelectPage = 0
  217. );
  218. virtual ~CExtResizablePropertySheet();
  219. virtual __EXT_MFC_SAFE_LPCTSTR OnQuerySkinnedFontParmName() const;
  220. //bool m_bAllowTabSwitchingLoop:1;
  221. // Operations
  222. public:
  223. // Overrides
  224. //{{AFX_VIRTUAL(CExtResizablePropertySheet)
  225. //}}AFX_VIRTUAL
  226. // Implementation
  227. public:
  228. virtual void OnResizablePropertySheetInitialized();
  229. protected:
  230. virtual void _TrickSyncActviveChild();
  231. public:
  232. virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  233. virtual BOOL PreTranslateMessage(MSG* pMsg);
  234. virtual void OnRenderWizardWatermarkArea(
  235. CDC & dc,
  236. const RECT & rcWaterMark,
  237. const CExtBitmap & _bitmapWatermark // can be empty
  238. );
  239. protected:
  240. virtual bool OnHookWndMsg(
  241. LRESULT & lResult,
  242. HWND hWndHooked,
  243. UINT nMessage,
  244. WPARAM & wParam,
  245. LPARAM & lParam
  246. );
  247. // Generated message map functions
  248. protected:
  249. //{{AFX_MSG(CExtResizablePropertySheet)
  250. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  251. virtual void PreSubclassWindow();
  252. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  253. afx_msg void OnSize(UINT nType, int cx, int cy);
  254. afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
  255. //}}AFX_MSG
  256. DECLARE_MESSAGE_MAP()
  257. friend class CExtResizablePropertyPage;
  258. }; // class CExtResizablePropertySheet
  259. /////////////////////////////////////////////////////////////////////////////
  260. //{{AFX_INSERT_LOCATION}}
  261. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  262. #endif // !defined(__EXT_RESIZABLE_DIALOG_H)