InsertDeviceDlg.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma once
  2. #include "afxcmn.h"
  3. #include "btnst.h"
  4. // CInsertDeviceDlg 对话框
  5. class CInsertDeviceDlg : public CDialog
  6. {
  7. DECLARE_DYNAMIC(CInsertDeviceDlg)
  8. public:
  9. CInsertDeviceDlg(CWnd* pParent = NULL); // 标准构造函数
  10. virtual ~CInsertDeviceDlg();
  11. CImageList m_imgList;
  12. CTreeCtrl m_CtrlTree;
  13. CPoint m_mousePoint;
  14. // 根结点;
  15. HTREEITEM hRunRootItem;
  16. // 设备;
  17. typedef struct _STDeviceItem
  18. {
  19. HTREEITEM hDevice;
  20. CString strDevice;
  21. }STDevice,*pSTDevice;
  22. // 厂家;
  23. typedef struct _STFactory
  24. {
  25. HTREEITEM hFactory;
  26. CString strFactory;
  27. vector <STDevice> vtDevice;
  28. }STFactory,*pSTFactory;
  29. // 类别;
  30. typedef struct _STTreeInfo
  31. {
  32. HTREEITEM hType;
  33. CString strType;
  34. vector <STFactory> vtFactory;
  35. }STTreeInfo,*pSTTreeInfo;
  36. // 树信息;
  37. vector <STTreeInfo> vtSTTreeInfo;
  38. void InitTreeCtrlInfo();
  39. void InitSTButtons();
  40. // 对话框数据
  41. enum { IDD = DLG_INSERTDEVICE };
  42. protected:
  43. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  44. DECLARE_MESSAGE_MAP()
  45. public:
  46. virtual BOOL OnInitDialog();
  47. afx_msg void OnBnClickedOk();
  48. afx_msg void OnBnClickedCancle();
  49. afx_msg void OnBnClickedModify();
  50. CString m_strName; // 设备名;
  51. CString m_strPort; // 串口;
  52. CString m_strAddr; // 地址;
  53. int m_nStarAddr;
  54. int m_nEndAddr;
  55. BOOL m_bMulti;
  56. BOOL m_bModify;
  57. CString m_strDepotPath;
  58. CString m_strRutDepotPath;
  59. protected:
  60. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  61. public:
  62. // afx_msg void OnTvnItemexpandedTree1(NMHDR *pNMHDR, LRESULT *pResult);
  63. //afx_msg void OnTvnItemexpandingTree1(NMHDR *pNMHDR, LRESULT *pResult);
  64. CButtonST m_btnClose;
  65. CButtonST m_btnAdd;
  66. };