DevicesWnd.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. CFont m_fntPropList;
  33. // 对话框;
  34. CDlgService m_dlgService;
  35. // 实现
  36. public:
  37. virtual ~CDevicesWnd();
  38. // 去掉关闭按钮;但组合多个pane时无效;
  39. virtual BOOL CanBeClosed() const { return FALSE; };
  40. // 禁止拖动Pane;
  41. virtual BOOL FloatPane(CRect rectFloat, AFX_DOCK_METHOD dockMethod = DM_UNKNOWN, bool bShow = true) { return FALSE; }
  42. // 禁用停靠,双击底部无效(不会停靠)
  43. //virtual BOOL CanFloat() const { return FALSE; };
  44. // 禁用大小;//崩溃;
  45. //virtual BOOL IsResizable() const {return FALSE;}
  46. protected:
  47. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  48. afx_msg void OnSize(UINT nType, int cx, int cy);
  49. afx_msg void OnExpandAllProperties();
  50. afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
  51. afx_msg void OnSortProperties();
  52. afx_msg void OnUpdateSortProperties(CCmdUI* pCmdUI);
  53. afx_msg void OnProperties1();
  54. afx_msg void OnUpdateProperties1(CCmdUI* pCmdUI);
  55. afx_msg void OnProperties2();
  56. afx_msg void OnUpdateProperties2(CCmdUI* pCmdUI);
  57. afx_msg void OnSetFocus(CWnd* pOldWnd);
  58. afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  59. DECLARE_MESSAGE_MAP()
  60. void SetPropListFont();
  61. int m_nComboHeight;
  62. public:
  63. afx_msg void OnPaint();
  64. // 重载(禁用面板自带菜单)
  65. afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
  66. };