DevicesWnd.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // 这段 MFC 示例源代码演示如何使用 MFC Microsoft Office Fluent 用户界面
  2. // (“Fluent UI”)。该示例仅供参考,
  3. // 用以补充《Microsoft 基础类参考》和
  4. // MFC C++ 库软件随附的相关电子文档。
  5. // 复制、使用或分发 Fluent UI 的许可条款是单独提供的。
  6. // 若要了解有关 Fluent UI 许可计划的详细信息,请访问
  7. // https://go.microsoft.com/fwlink/?LinkId=238214.
  8. //
  9. // 版权所有(C) Microsoft Corporation
  10. // 保留所有权利。
  11. #include "DlgService.h"
  12. #include <map>
  13. #pragma once
  14. class CDevicesBar : public CMFCToolBar
  15. {
  16. public:
  17. virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
  18. {
  19. CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
  20. }
  21. virtual BOOL AllowShowOnList() const { return FALSE; }
  22. };
  23. class CDevicesWnd : public CDockablePane
  24. {
  25. // 构造
  26. public:
  27. CDevicesWnd() noexcept;
  28. void AdjustLayout();
  29. // 特性
  30. public:
  31. protected:
  32. BOOL m_bEnd;
  33. CFont m_fntPropList;
  34. // 对话框;
  35. #if 1
  36. CDlgService m_dlgService;
  37. #endif
  38. // 控件;
  39. CStatic m_lb_Actuator;
  40. CStatic m_lb_IP;
  41. CEdit m_edit_Actuator;
  42. CIPAddressCtrl m_edit_TVIP;
  43. CMFCButton m_btnModify;
  44. CMFCButton m_btnAddAndroid;
  45. CListCtrl m_listDevices;
  46. CMFCButton m_btnMIInit;
  47. CMFCButton m_btnSCBCInit;
  48. CMFCButton m_btnSVNUpdate;
  49. CListCtrl m_listTask;
  50. CStatic m_lb_TaskId;
  51. CEdit m_edit_TaskId;
  52. CStatic m_lb_TaskStatus;
  53. // 初始化控件;
  54. int InitCtrl();
  55. // 实现
  56. public:
  57. virtual ~CDevicesWnd();
  58. // 去掉关闭按钮;但组合多个pane时无效;
  59. virtual BOOL CanBeClosed() const { return FALSE; };
  60. // 禁止拖动Pane;
  61. virtual BOOL FloatPane(CRect rectFloat, AFX_DOCK_METHOD dockMethod = DM_UNKNOWN, bool bShow = true) { return FALSE; }
  62. // 禁用停靠,双击底部无效(不会停靠)
  63. //virtual BOOL CanFloat() const { return FALSE; };
  64. // 禁用大小;//崩溃;
  65. //virtual BOOL IsResizable() const {return FALSE;}
  66. protected:
  67. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  68. afx_msg void OnSize(UINT nType, int cx, int cy);
  69. afx_msg void OnExpandAllProperties();
  70. afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
  71. afx_msg void OnSortProperties();
  72. afx_msg void OnUpdateSortProperties(CCmdUI* pCmdUI);
  73. afx_msg void OnProperties1();
  74. afx_msg void OnUpdateProperties1(CCmdUI* pCmdUI);
  75. afx_msg void OnProperties2();
  76. afx_msg void OnUpdateProperties2(CCmdUI* pCmdUI);
  77. afx_msg void OnSetFocus(CWnd* pOldWnd);
  78. afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  79. DECLARE_MESSAGE_MAP()
  80. void SetCtrlFont();
  81. int m_nNormalHeight = 23;
  82. public:
  83. afx_msg void OnPaint();
  84. // 重载(禁用面板自带菜单)
  85. afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
  86. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  87. // 控件事件;
  88. afx_msg void OnBtnActuatorClick();
  89. afx_msg void OnUpdateBtnActuator(CCmdUI* pCmdUI);
  90. afx_msg void OnBtnAddTVIPClick();
  91. afx_msg void OnUpdateBtnAddTVIP(CCmdUI* pCmdUI);
  92. afx_msg void OnBtnMiInitClick();
  93. afx_msg void OnUpdateBtnMiInit(CCmdUI* pCmdUI);
  94. afx_msg void OnBtnScbcInitClick();
  95. afx_msg void OnUpdateBtnScbcInit(CCmdUI* pCmdUI);
  96. afx_msg void OnBtnSATUpdateClick();
  97. afx_msg void OnUpdateBtnSATUpdate(CCmdUI* pCmdUI);
  98. // list事件;
  99. afx_msg void OnNMDblclkListTask(NMHDR* pNMHDR, LRESULT* pResult);
  100. afx_msg void OnNMRClickListDevices(NMHDR* pNMHDR, LRESULT* pResult);
  101. afx_msg void OnDevicesDel();
  102. };