MainFrm.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // 这段 MFC 示例源代码演示如何使用 MFC Microsoft Office Fluent 用户界面
  2. // ("Fluent UI"),该示例仅作为参考资料提供,
  3. // 用以补充《Microsoft 基础类参考》和
  4. // MFC C++ 库软件随附的相关电子文档。
  5. // 复制、使用或分发 Fluent UI 的许可条款是单独提供的。
  6. // 若要了解有关 Fluent UI 许可计划的详细信息,请访问
  7. // http://msdn.microsoft.com/officeui。
  8. //
  9. // 版权所有 (C) Microsoft Corporation
  10. // 保留所有权利。
  11. // MainFrm.h : CMainFrame 类的接口
  12. //
  13. #pragma once
  14. #include "FileView.h"
  15. #include "ClassView.h"
  16. #include "OutputWnd.h"
  17. #include "PropertiesWnd.h"
  18. #include "CalendarBar.h"
  19. #include "Resource.h"
  20. class COutlookBar : public CMFCOutlookBar
  21. {
  22. virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
  23. virtual void GetPaneName(CString& strName) const { BOOL bNameValid = strName.LoadString(IDS_OUTLOOKBAR); ASSERT(bNameValid); }
  24. };
  25. class CMainFrame : public CMDIFrameWndEx
  26. {
  27. DECLARE_DYNAMIC(CMainFrame)
  28. public:
  29. CMainFrame();
  30. // 属性
  31. public:
  32. // 操作
  33. public:
  34. // 重写
  35. public:
  36. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  37. // 实现
  38. public:
  39. virtual ~CMainFrame();
  40. #ifdef _DEBUG
  41. virtual void AssertValid() const;
  42. virtual void Dump(CDumpContext& dc) const;
  43. #endif
  44. protected: // 控件条嵌入成员
  45. CMFCRibbonBar m_wndRibbonBar;
  46. CMFCRibbonApplicationButton m_MainButton;
  47. CMFCToolBarImages m_PanelImages;
  48. CMFCRibbonStatusBar m_wndStatusBar;
  49. CFileView m_wndFileView;
  50. CClassView m_wndClassView;
  51. COutputWnd m_wndOutput;
  52. CPropertiesWnd m_wndProperties;
  53. COutlookBar m_wndNavigationBar;
  54. #if __OUTLOOKBAR__
  55. CMFCShellTreeCtrl m_wndTree;
  56. CCalendarBar m_wndCalendar;
  57. #endif
  58. CMFCCaptionBar m_wndCaptionBar;
  59. // 生成的消息映射函数
  60. protected:
  61. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  62. afx_msg void OnWindowManager();
  63. afx_msg void OnApplicationLook(UINT id);
  64. afx_msg void OnUpdateApplicationLook(CCmdUI* pCmdUI);
  65. afx_msg void OnViewCaptionBar();
  66. afx_msg void OnUpdateViewCaptionBar(CCmdUI* pCmdUI);
  67. DECLARE_MESSAGE_MAP()
  68. void InitializeRibbon();
  69. BOOL CreateDockingWindows();
  70. void SetDockingWindowIcons(BOOL bHiColorIcons);
  71. BOOL CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth);
  72. BOOL CreateCaptionBar();
  73. int FindFocusedOutlookWnd(CMFCOutlookBarTabCtrl** ppOutlookWnd);
  74. CMFCOutlookBarTabCtrl* FindOutlookParent(CWnd* pWnd);
  75. CMFCOutlookBarTabCtrl* m_pCurrOutlookWnd;
  76. CMFCOutlookBarPane* m_pCurrOutlookPage;
  77. };