123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- // 这段 MFC 示例源代码演示如何使用 MFC Microsoft Office Fluent 用户界面
- // ("Fluent UI"),该示例仅作为参考资料提供,
- // 用以补充《Microsoft 基础类参考》和
- // MFC C++ 库软件随附的相关电子文档。
- // 复制、使用或分发 Fluent UI 的许可条款是单独提供的。
- // 若要了解有关 Fluent UI 许可计划的详细信息,请访问
- // http://msdn.microsoft.com/officeui。
- //
- // 版权所有 (C) Microsoft Corporation
- // 保留所有权利。
- // MainFrm.h : CMainFrame 类的接口
- //
- #pragma once
- #include "CalendarBar.h"
- #include "Resource.h"
- #include "PropertiesWnd.h"
- #include "CaptureVideo.h"
- #include "FieldTestToolDoc.h"
- class CChildFrame;
- class COutlookBar : public CMFCOutlookBar
- {
- virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
- virtual void GetPaneName(CString& strName) const { BOOL bNameValid = strName.LoadString(IDS_OUTLOOKBAR); ASSERT(bNameValid); }
- };
- class CMainFrame : public CMDIFrameWndEx
- {
- DECLARE_DYNAMIC(CMainFrame)
- public:
- CMainFrame();
- // 属性
- public:
- CFieldTestToolDoc* m_pDoc;
- CMultiDocTemplate* m_pDocTemplate;
- // 操作
- public:
- // 重写
- public:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- // 实现
- public:
- virtual ~CMainFrame();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected: // 控件条嵌入成员
- CMFCRibbonBar m_wndRibbonBar;
- CMFCRibbonApplicationButton m_MainButton;
- CMFCToolBarImages m_PanelImages;
- CMFCRibbonStatusBar m_wndStatusBar;
- #ifndef DISABLE_OUTLOOKBAR
- COutlookBar m_wndNavigationBar;
- CMFCShellTreeCtrl m_wndTree;
- CCalendarBar m_wndCalendar;
- #endif
- #ifndef DISABLE_CAPTIONBAR
- CMFCCaptionBar m_wndCaptionBar;
- #endif
- CPropertiesWnd m_wndProperties;
- // 生成的消息映射函数
- protected:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnWindowManager();
- afx_msg void OnApplicationLook(UINT id);
- afx_msg void OnUpdateApplicationLook(CCmdUI* pCmdUI);
- #ifndef DISABLE_CAPTIONBAR
- afx_msg void OnViewCaptionBar();
- afx_msg void OnUpdateViewCaptionBar(CCmdUI* pCmdUI);
- #endif
- // 摄像头;
- afx_msg void OnCameraCombobox();
- afx_msg void OnUpdateCameraCombobox(CCmdUI* pCmdUI);
- // 红外:测试精灵;
- afx_msg void OnInfraedCombobox();
- afx_msg void OnUpdateInfraedCombobox(CCmdUI* pCmdUI);
- afx_msg void OnInfraedCheckbox();
- afx_msg void OnUpdateInfraedCheckbox(CCmdUI* pCmdUI);
- // 红外版本选择;
- afx_msg void OnInfraedVersionCombobox();
- afx_msg void OnUpdateInfraedVersionCombobox(CCmdUI* pCmdUI);
- // USB切换器;
- afx_msg void OnSwitcherCombobox();
- afx_msg void OnUpdateSwitcherCombobox(CCmdUI* pCmdUI);
- afx_msg void OnSwitcherCheckbox();
- // 记录Checkbox的状态;
- bool m_bSwitcherCheckA;
- bool m_bSwitcherCheckB;
- afx_msg void OnUpdateSwitcherCheckbox(CCmdUI* pCmdUI);
- afx_msg void OnSwitcherCheckboxA();
- afx_msg void OnUpdateSwitcherCheckboxA(CCmdUI* pCmdUI);
- afx_msg void OnSwitcherCheckboxB();
- afx_msg void OnUpdateSwitcherCheckboxB(CCmdUI* pCmdUI);
- // 摄像头刷新按钮;
- afx_msg void OnCameraFlush();
- afx_msg void OnUpdateCameraFlush(CCmdUI* pCmdUI);
- // 注册设备变化监听;
- bool RegisterDeviceChange();
- afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
- DECLARE_MESSAGE_MAP()
-
- public:
- CMFCRibbonBar* GetRibbonBar() {return &m_wndRibbonBar;}
- CMFCRibbonStatusBar* GetRibbonStatusBar() { return &m_wndStatusBar; }
- void InitializeRibbon();
- BOOL CreateDockingWindows();
- void SetDockingWindowIcons(BOOL bHiColorIcons);
- BOOL CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth);
- BOOL CreateCaptionBar();
- int FindFocusedOutlookWnd(CMFCOutlookBarTabCtrl** ppOutlookWnd);
- CCaptureVideo m_cap;
- CBaseSerial m_SerialTW;
- CBaseSerial m_SerialUSB;
- std::vector<TString> m_vtPorts;
- void InitSerialCombobox();
- // 是否找到测试精灵串口;
- bool m_bFindTestWizardPort;
- // 是否找到u盘切换设备;
- bool m_bFindSwitcherPort;
- // 查找测试精灵串口;
- bool IsTestWizardPort(CString strCOMPort);
- // 查找USB切U盘设备串口
- bool IsUSBSwitchPort(CString strCOMPort);
- // 记录活动窗口;
- CView *m_pActiveView;
- CChildFrame *m_pChildFrame;
- CMFCOutlookBarTabCtrl* FindOutlookParent(CWnd* pWnd);
- CMFCOutlookBarTabCtrl* m_pCurrOutlookWnd;
- CMFCOutlookBarPane* m_pCurrOutlookPage;
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- afx_msg void OnClose();
- };
|