MainFrm.cpp
上传用户:wlkj888
上传日期:2022-08-01
资源大小:806k
文件大小:2k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "CGuiFlatTabbedView.h"
  5. #include "MainFrm.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMainFrame
  13. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  14. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  15. //{{AFX_MSG_MAP(CMainFrame)
  16. ON_WM_CREATE()
  17. ON_WM_TIMER()
  18. //}}AFX_MSG_MAP
  19. END_MESSAGE_MAP()
  20. static UINT indicators[] =
  21. {
  22. ID_SEPARATOR,           // status line indicator
  23. ID_INDICATOR_CAPS,
  24. ID_INDICATOR_NUM,
  25. ID_INDICATOR_SCRL,
  26. };
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CMainFrame construction/destruction
  29. CMainFrame::CMainFrame()
  30. {
  31. // TODO: add member initialization code here
  32. }
  33. CMainFrame::~CMainFrame()
  34. {
  35. }
  36. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  37. {
  38. if (CGuiMDIFrame::OnCreate(lpCreateStruct) == -1)
  39. return -1;
  40. InitMenu(IDR_MAINFRAME);
  41. InitToolBar(IDR_MAINFRAME);
  42. InitStatusBar(indicators,sizeof(indicators)/sizeof(UINT));
  43. // TODO: Delete these three lines if you don't want the toolbar to
  44. //  be dockable
  45. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  46. EnableDocking(CBRS_ALIGN_ANY);
  47. m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
  48. m_wndMenuBar.SetSaveHistory("MyHistory1",TRUE);
  49. DockControlBar(&m_wndMenuBar,m_dockTop);
  50. DockControlBar(&m_wndToolBar,m_dockTop);
  51. m_wndStatusBar.SetStyle(CGuiStatusBar::OFFICE);
  52. DockControlBar(&m_wndToolBar);
  53. sProfile = _T("GuiFlatDemo");
  54. LoadBars();
  55. SetTimer(1,50,0);
  56. return 0;
  57. }
  58. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  59. {
  60. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  61. return FALSE;
  62. // TODO: Modify the Window class or styles here by modifying
  63. //  the CREATESTRUCT cs
  64. return TRUE;
  65. }
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CMainFrame diagnostics
  68. #ifdef _DEBUG
  69. void CMainFrame::AssertValid() const
  70. {
  71. CMDIFrameWnd::AssertValid();
  72. }
  73. void CMainFrame::Dump(CDumpContext& dc) const
  74. {
  75. CMDIFrameWnd::Dump(dc);
  76. }
  77. #endif //_DEBUG
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CMainFrame message handlers
  80. void CMainFrame::OnTimer(UINT nIDEvent) 
  81. {
  82. StyleDispl(GUISTYLE_2003);
  83. GuiDrawLayer::IsThemeXP();
  84. KillTimer(nIDEvent);
  85. CMDIFrameWnd::OnTimer(nIDEvent);
  86. }