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

界面编程

开发平台:

Visual C++

  1. // MainFrm.h : interface of the CMainFrame class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MAINFRM_H__205C43B5_15CF_429F_8CA0_07C395066CE5__INCLUDED_)
  5. #define AFX_MAINFRM_H__205C43B5_15CF_429F_8CA0_07C395066CE5__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #if !defined(__EXT_TEMPL_H)
  10. #include <ExtTempl.h>
  11. #endif
  12. #include "resource.h"
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CDialogThemes
  15. class CDialogThemes
  16. : public CExtResizableDialog
  17. {
  18. public:
  19. CDialogThemes();
  20. virtual ~CDialogThemes();
  21. bool CreateInsideBar(
  22. CExtControlBar * pBar
  23. );
  24. void InvokeMainFrameCommand( UINT nCmdID );
  25. //{{AFX_DATA(CDialogThemes)
  26. enum { IDD = IDD_DIALOG_THEMES };
  27. CExtHyperLinkButton m_wndButtonInstallTheme2005;
  28. CExtHyperLinkButton m_wndButtonInstallTheme2003;
  29. CExtHyperLinkButton m_wndButtonInstallThemeXP;
  30. CExtHyperLinkButton m_wndButtonInstallTheme2000;
  31. CExtHyperLinkButton m_wndButtonLoadThemeBIN;
  32. CExtHyperLinkButton m_wndButtonLoadThemeXML;
  33. //}}AFX_DATA
  34. //{{AFX_VIRTUAL(CDialogThemes)
  35. protected:
  36. virtual void DoDataExchange( CDataExchange * pDX );
  37. //}}AFX_VIRTUAL
  38. protected:
  39. //{{AFX_MSG(CDialogThemes)
  40. virtual BOOL OnInitDialog();
  41. afx_msg void OnButtonLoadThemeXml();
  42. afx_msg void OnButtonLoadThemeBin();
  43. afx_msg void OnButtonTheme2005();
  44. afx_msg void OnButtonTheme2003();
  45. afx_msg void OnButtonThemeXp();
  46. afx_msg void OnButtonTheme2000();
  47. //}}AFX_MSG
  48. DECLARE_MESSAGE_MAP()
  49. };
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CDialogInvokeModalDialogs
  52. class CDialogInvokeModalDialogs
  53. : public CExtResizableDialog
  54. {
  55. public:
  56. CDialogInvokeModalDialogs();
  57. virtual ~CDialogInvokeModalDialogs();
  58. bool CreateInsideBar(
  59. CExtControlBar * pBar
  60. );
  61. //{{AFX_DATA(CDialogInvokeModalDialogs)
  62. enum { IDD = IDD_DIALOG_INVOKE_MODAL_DIALOGS };
  63. CExtHyperLinkButton m_wndButtonInvokeDialogIconEditor;
  64. CExtHyperLinkButton m_wndButtonInvokeDialogColor;
  65. CExtHyperLinkButton m_wndButtonInvokeDialogAbout;
  66. CExtHyperLinkButton m_wndButtonInvokeFileDialog;
  67. CExtHyperLinkButton m_wndButtonInvokeBffDialog;
  68. //}}AFX_DATA
  69. //{{AFX_VIRTUAL(CDialogInvokeModalDialogs)
  70. protected:
  71. virtual void DoDataExchange( CDataExchange * pDX );
  72. //}}AFX_VIRTUAL
  73. protected:
  74. //{{AFX_MSG(CDialogInvokeModalDialogs)
  75. virtual BOOL OnInitDialog();
  76. afx_msg void OnButtonInvokeColorDialog();
  77. afx_msg void OnButtonInvokeIconEditorDialog();
  78. afx_msg void OnButtonInvokeAboutDialog();
  79. afx_msg void OnButtonInvokeFileDialog();
  80. afx_msg void OnButtonInvokeBffDialog();
  81. //}}AFX_MSG
  82. DECLARE_MESSAGE_MAP()
  83. };
  84. /////////////////////////////////////////////////////////////////////////////
  85. // CDialogInputFields
  86. class CDialogInputFields
  87. : public CExtResizableDialog
  88. {
  89. public:
  90. CDialogInputFields();
  91. virtual ~CDialogInputFields();
  92. bool CreateInsideBar(
  93. CExtControlBar * pBar
  94. );
  95. //{{AFX_DATA(CDialogInputFields)
  96. enum { IDD = IDD_DIALOG_INPUT_FIELDS };
  97. CExtSpinWnd m_wndSpin6;
  98. CExtSpinWnd m_wndSpin5;
  99. CExtSpinWnd m_wndSpin4;
  100. CExtSpinWnd m_wndSpin3;
  101. CExtEdit m_wndEdit6;
  102. CExtEdit m_wndEdit5;
  103. CExtEdit m_wndEdit4;
  104. CExtEdit m_wndEdit3;
  105. CExtEdit m_wndEdit2;
  106. CExtEdit m_wndEdit1;
  107. CExtLabel m_wndLabel6;
  108. CExtLabel m_wndLabel5;
  109. CExtLabel m_wndLabel4;
  110. CExtLabel m_wndLabel3;
  111. CExtLabel m_wndLabel2;
  112. CExtLabel m_wndLabel1;
  113. CExtComboBox m_wndCombo4;
  114. CExtComboBox m_wndCombo3;
  115. CExtComboBox m_wndCombo2;
  116. CExtComboBox m_wndCombo1;
  117. //}}AFX_DATA
  118. //{{AFX_VIRTUAL(CDialogInputFields)
  119. protected:
  120. virtual void DoDataExchange( CDataExchange * pDX );
  121. //}}AFX_VIRTUAL
  122. protected:
  123. //{{AFX_MSG(CDialogInputFields)
  124. virtual BOOL OnInitDialog();
  125. //}}AFX_MSG
  126. DECLARE_MESSAGE_MAP()
  127. };
  128. #if (!defined __EXT_MFC_NO_DURATIONWND ) && (!defined __EXT_MFC_NO_DATETIMEWND)
  129. /////////////////////////////////////////////////////////////////////////////
  130. // CDialogDateTimeDuration dialog
  131. class CDialogDateTimeDuration : public CExtResizableDialog
  132. {
  133. // Construction
  134. public:
  135. CDialogDateTimeDuration(CWnd* pParent = NULL);   // standard constructor
  136. bool CreateInsideBar(
  137. CExtControlBar * pBar
  138. );
  139. // Dialog Data
  140. //{{AFX_DATA(CDialogDateTimeDuration)
  141. enum { IDD = IDD_DIALOG_DATE_TIME_DURATION };
  142. CExtCheckBox m_wndDisabledDuration;
  143. CExtCheckBox m_wndDisabledDateTime;
  144. CExtCheckBox m_wndModeSeconds;
  145. CExtCheckBox m_wndModeMinutes;
  146. CExtCheckBox m_wndModeHours;
  147. CExtCheckBox m_wndModeDays;
  148. CExtLabel m_wndLabelNotifications;
  149. CExtCheckBox m_wndContinuousDateTime;
  150. CExtCheckBox m_wndContinuousDuration;
  151. CExtGroupBox m_wndBoxTimeFormat;
  152. CExtGroupBox m_wndBoxModeDateTime;
  153. CExtGroupBox m_wndBoxModeDuration;
  154. CExtCheckBox m_wndBtnSpinDateTime;
  155. CExtCheckBox m_wndBtnSpinDuration;
  156. CExtCheckBox m_wndBtnDropDown;
  157. CEdit m_wndNotifications;
  158. CExtColorButton m_wndColorTextDateTime;
  159. CExtColorButton m_wndColorBackDateTime;
  160. CExtButton m_wndAdjustSizeDateTime;
  161. CExtColorButton m_wndColorTextDuration;
  162. CExtColorButton m_wndColorBackDuration;
  163. CExtButton m_wndAdjustSizeDuration;
  164. CExtGroupBox m_wndBoxDuration;
  165. CExtGroupBox m_wndBoxDateTime;
  166. CExtDurationWnd m_wndDuration;
  167. CExtDateTimeWnd m_wndDateTime;
  168. CExtRadioButton m_wndTimeFormatAuto;
  169. CExtRadioButton m_wndTimeFormatH12;
  170. CExtRadioButton m_wndTimeFormatH24;
  171. CExtRadioButton m_wndModeTime;
  172. CExtRadioButton m_wndModeDate;
  173. CExtRadioButton m_wndModeDateTime;
  174. int m_nTimeFormat;
  175. int m_nMode;
  176. //}}AFX_DATA
  177. // Overrides
  178. // ClassWizard generated virtual function overrides
  179. //{{AFX_VIRTUAL(CDialogDateTimeDuration)
  180. public:
  181. virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  182. protected:
  183. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  184. //}}AFX_VIRTUAL
  185. // Implementation
  186. protected:
  187. bool m_bInitComplete:1;
  188. // Generated message map functions
  189. //{{AFX_MSG(CDialogDateTimeDuration)
  190. virtual BOOL OnInitDialog();
  191. //}}AFX_MSG
  192. LRESULT OnSelChangedDuration( WPARAM wParam, LPARAM lParam );
  193. LRESULT OnSelChangedDateTime( WPARAM wParam, LPARAM lParam );
  194. afx_msg LRESULT OnColorChanged(WPARAM wParam, LPARAM lParam);
  195. DECLARE_MESSAGE_MAP()
  196. };
  197. #endif // (!defined __EXT_MFC_NO_DURATIONWND ) && (!defined __EXT_MFC_NO_DATETIMEWND)
  198. /////////////////////////////////////////////////////////////////////////////
  199. // CDialogButtons
  200. class CDialogButtons
  201. : public CExtResizableDialog
  202. {
  203. static HICON GetSmallIconForButton()
  204. {
  205. HICON hIcon = (HICON)
  206. ::LoadImage(
  207. ::AfxGetInstanceHandle(),
  208. MAKEINTRESOURCE( IDR_MAINFRAME ),
  209. IMAGE_ICON,
  210. 16,
  211. 16,
  212. 0
  213. );
  214. ASSERT( hIcon != NULL );
  215. return hIcon;
  216. }
  217. public:
  218. CDialogButtons();
  219. virtual ~CDialogButtons();
  220. bool CreateInsideBar(
  221. CExtControlBar * pBar
  222. );
  223. //{{AFX_DATA(CDialogButtons)
  224. enum { IDD = IDD_DIALOG_BUTTONS };
  225. CExtButton m_wndButtonDisabled1;
  226. CExtButton m_wndButtonNormal1;
  227. CExtButton m_wndButtonDefault1;
  228. CExtButton m_wndButtonDisabled2;
  229. CExtButton m_wndButtonNormal2;
  230. CExtButton m_wndButtonDefault2;
  231. CExtButton m_wndButtonDisabled3;
  232. CExtButton m_wndButtonNormal3;
  233. CExtButton m_wndButtonDefault3;
  234. CExtHyperLinkButton m_wndButtonNormal4;
  235. CExtHyperLinkButton m_wndButtonDefault4;
  236. CExtColorButton m_wndButtonDisabled5;
  237. CExtColorButton m_wndButtonNormal5;
  238. CExtColorButton m_wndButtonDefault5;
  239. CExtColorButton m_wndButtonDisabled6;
  240. CExtColorButton m_wndButtonNormal6;
  241. CExtColorButton m_wndButtonDefault6;
  242. CExtGroupBox m_wndGroupBox1;
  243. CExtGroupBox m_wndGroupBox2;
  244. CExtGroupBox m_wndGroupBox3;
  245. CExtGroupBox m_wndGroupBox4;
  246. CExtGroupBox m_wndGroupBox5;
  247. CExtGroupBox m_wndGroupBox6;
  248. CExtGroupBox m_wndGroupBox7;
  249. CExtGroupBox m_wndGroupBox8;
  250. CExtGroupBox m_wndGroupBox9;
  251. CExtRadioButton m_wndRadio1;
  252. CExtRadioButton m_wndRadio2;
  253. CExtRadioButton m_wndRadioDisabled;
  254. CExtCheckBox m_wndCheckTwoState;
  255. CExtCheckBox m_wndCheckThreeState;
  256. CExtCheckBox m_wndCheckDisabled;
  257. //}}AFX_DATA
  258. //{{AFX_VIRTUAL(CDialogButtons)
  259. protected:
  260. virtual void DoDataExchange( CDataExchange * pDX );
  261. //}}AFX_VIRTUAL
  262. protected:
  263. //{{AFX_MSG(CDialogButtons)
  264. virtual BOOL OnInitDialog();
  265. afx_msg void OnEditCopy();
  266. afx_msg void OnEditCut();
  267. afx_msg void OnEditPaste();
  268. //}}AFX_MSG
  269. DECLARE_MESSAGE_MAP()
  270. };
  271. /////////////////////////////////////////////////////////////////////////////
  272. // CColorControlsView window
  273. class CColorControlsView : public CWnd
  274. {
  275. // Construction
  276. public:
  277. CColorControlsView();
  278. bool CreateInsideBar(
  279. CExtControlBar * pBar
  280. );
  281. // Attributes
  282. public:
  283. protected:
  284. CExtColorCtrl
  285. m_wndColorCtrlRoller,
  286. m_wndColorCtrlCubeRGB,
  287. m_wndColorCtrlCubeCMY,
  288. m_wndColorCtrlMixerRGB,
  289. m_wndColorCtrlMixerCMY,
  290. m_wndColorCtrlHSL;
  291. bool m_bSyncingValues;
  292. bool m_bColorControlsVisible;
  293. // Operations
  294. public:
  295. // Overrides
  296. // ClassWizard generated virtual function overrides
  297. //{{AFX_VIRTUAL(CColorControlsView)
  298. protected:
  299. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  300. //}}AFX_VIRTUAL
  301. // Implementation
  302. public:
  303. virtual ~CColorControlsView();
  304. // Generated message map functions
  305. protected:
  306. //{{AFX_MSG(CColorControlsView)
  307. afx_msg void OnPaint();
  308. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  309. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  310. //}}AFX_MSG
  311. LRESULT OnColorChanged(WPARAM wParam,LPARAM lParam);
  312. DECLARE_MESSAGE_MAP()
  313. };
  314. /////////////////////////////////////////////////////////////////////////////
  315. // CMainFrame
  316. class CMainFrame
  317. : public CExtNCW < CMDIFrameWnd >
  318. , public CExtDynamicBarSite
  319. {
  320. public:
  321. DECLARE_DYNAMIC( CMainFrame );
  322. CMainFrame();
  323. // Attributes
  324. protected:
  325. WINDOWPLACEMENT m_dataFrameWP;
  326. // Operations
  327. public:
  328. // Overrides
  329. // ClassWizard generated virtual function overrides
  330. //{{AFX_VIRTUAL(CMainFrame)
  331. virtual BOOL DestroyWindow();
  332. virtual BOOL PreTranslateMessage(MSG* pMsg);
  333. virtual void ActivateFrame(int nCmdShow = -1);
  334. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  335. virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
  336. //}}AFX_VIRTUAL
  337. // Implementation
  338. public:
  339. virtual ~CMainFrame();
  340. #ifdef _DEBUG
  341. virtual void AssertValid() const;
  342. virtual void Dump(CDumpContext& dc) const;
  343. #endif
  344. protected:  // control bar embedded members
  345. CExtMenuControlBar m_wndMenuBar;
  346. CExtStatusControlBar m_wndStatusBar;
  347. CExtComboBox m_wndComboInToolBar;
  348. CExtToolControlBar m_wndToolBarStandard;
  349. CExtToolControlBar m_wndToolBarThemes;
  350. CExtToolControlBar m_wndToolBarSkins;
  351. CExtDynamicControlBar * m_pBarButtons;
  352. CDialogButtons m_dlgButtons;
  353. CExtDynamicControlBar * m_pBarInputFields;
  354. CDialogInputFields m_dlgInputFields;
  355. #if (!defined __EXT_MFC_NO_DURATIONWND ) && (!defined __EXT_MFC_NO_DATETIMEWND)
  356. CExtDynamicControlBar * m_pBarDateTimeDuration;
  357. CDialogDateTimeDuration m_dlgDateTimeDuration;
  358. #endif // (!defined __EXT_MFC_NO_DURATIONWND ) && (!defined __EXT_MFC_NO_DATETIMEWND)
  359. CExtDynamicControlBar * m_pBarColorControls;
  360. CColorControlsView m_viewColorControls;
  361. CExtDynamicControlBar * m_pBarInvokeModalDialogs;
  362. CDialogInvokeModalDialogs m_dlgInvokeModalDialogs;
  363. CExtDynamicControlBar * m_pBarThemes;
  364. CDialogThemes m_dlgThemes;
  365. #if (!defined __EXT_MFC_NO_TABMDI_CTRL)
  366. CExtTMDBS < CExtTabMdiWnd > m_wndMdiTabs;
  367. #endif // (!defined __EXT_MFC_NO_TABMDI_CTRL)
  368. // Generated message map functions
  369. protected:
  370. //{{AFX_MSG(CMainFrame)
  371. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  372. afx_msg void OnTheme2000();
  373. afx_msg void OnUpdateTheme2000(CCmdUI* pCmdUI);
  374. afx_msg void OnThemeXp();
  375. afx_msg void OnUpdateThemeXp(CCmdUI* pCmdUI);
  376. afx_msg void OnTheme2003();
  377. afx_msg void OnUpdateTheme2003(CCmdUI* pCmdUI);
  378. afx_msg void OnTheme2005();
  379. afx_msg void OnUpdateTheme2005(CCmdUI* pCmdUI);
  380. afx_msg void OnFileNew();
  381. afx_msg void OnFileOpen();
  382. afx_msg void OnFileSave();
  383. afx_msg void OnEditCopy();
  384. afx_msg void OnEditCut();
  385. afx_msg void OnEditPaste();
  386. afx_msg void OnThemeLoadSkinXml();
  387. afx_msg void OnThemeLoadSkinBin();
  388. afx_msg void OnComboBoxInToolbar();
  389. //}}AFX_MSG
  390. DECLARE_MESSAGE_MAP()
  391. afx_msg LRESULT OnExtMenuPrepare(WPARAM wParam, LPARAM lParam);
  392. #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
  393. afx_msg void OnUpdateControlBarMenu(CCmdUI* pCmdUI);
  394. afx_msg BOOL OnBarCheck(UINT nID);
  395. #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
  396. };
  397. /////////////////////////////////////////////////////////////////////////////
  398. //{{AFX_INSERT_LOCATION}}
  399. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  400. #endif // !defined(AFX_MAINFRM_H__205C43B5_15CF_429F_8CA0_07C395066CE5__INCLUDED_)