PropertyList.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #if !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)
  2. #define AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // PropertyList.h : header file
  7. //
  8. #define PIT_COMBO 0 //PIT = property item type
  9. #define PIT_EDIT 1
  10. #define PIT_COLOR 2
  11. #define PIT_FONT 3
  12. #define PIT_FILE 4
  13. #define PIT_CHECKBOX 5
  14. #define IDC_PROPCMBBOX 712
  15. #define IDC_PROPEDITBOX 713
  16. #define IDC_PROPBTNCTRL 714
  17. #define IDC_PROPCHECKBOXCTRL 715
  18. #include "../cmStandardIncludes.h"
  19. /////////////////////////////////////////////////////////////////////////////
  20. //CPropertyList Items
  21. class CPropertyItem
  22. {
  23. // Attributes
  24. public:
  25. CString m_propName;
  26. CString m_curValue;
  27. int m_nItemType;
  28. CString m_cmbItems;
  29. bool m_Removed;
  30. public:
  31. CPropertyItem(CString propName, CString curValue,
  32. int nItemType, CString cmbItems)
  33. {
  34. m_Removed = false;
  35. m_propName = propName;
  36. m_curValue = curValue;
  37. m_nItemType = nItemType;
  38. m_cmbItems = cmbItems;
  39. }
  40. };
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CPropertyList window
  43. class CPropertyList : public CListBox
  44. {
  45. // Construction
  46. public:
  47. CPropertyList();
  48. // Attributes
  49. public:
  50. // Operations
  51. public:
  52. int AddItem(CString txt);
  53. int AddProperty(const char* name,
  54. const char* value,
  55. int type,
  56. const char* comboItems);
  57. std::set<CPropertyItem*> GetItems()
  58. {
  59. return m_PropertyItems;
  60. }
  61. CPropertyItem* GetItem(int index);
  62. // Overrides
  63. // ClassWizard generated virtual function overrides
  64. //{{AFX_VIRTUAL(CPropertyList)
  65. public:
  66. virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  67. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  68. protected:
  69. int AddPropItem(CPropertyItem* pItem);
  70. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  71. virtual void PreSubclassWindow();
  72. //}}AFX_VIRTUAL
  73. // Implementation
  74. public:
  75. virtual ~CPropertyList();
  76. // Generated message map functions
  77. protected:
  78. //{{AFX_MSG(CPropertyList)
  79. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  80. afx_msg void OnSelchange();
  81. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  82. afx_msg void OnKillFocus(CWnd* pNewWnd);
  83. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  84. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  85. afx_msg void OnRButtonUp( UINT nFlags, CPoint point );
  86. //}}AFX_MSG
  87. afx_msg void OnKillfocusCmbBox();
  88. afx_msg void OnSelchangeCmbBox();
  89. afx_msg void OnKillfocusEditBox();
  90. afx_msg void OnChangeEditBox();
  91. afx_msg void OnButton();
  92. afx_msg void OnDelete();
  93. afx_msg void OnCheckBox();
  94. DECLARE_MESSAGE_MAP()
  95. void InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo);
  96. void DisplayButton(CRect region);
  97. CComboBox m_cmbBox;
  98. CEdit m_editBox;
  99. CButton m_btnCtrl;
  100. CButton m_CheckBoxControl;
  101. CFont m_SSerif8Font;
  102. bool m_Dirty;
  103. int m_curSel;
  104. int m_prevSel;
  105. int m_nDivider;
  106. int m_nDivTop;
  107. int m_nDivBtm;
  108. int m_nOldDivX;
  109. int m_nLastBox;
  110. BOOL m_bTracking;
  111. BOOL m_bDivIsSet;
  112. HCURSOR m_hCursorArrow;
  113. HCURSOR m_hCursorSize;
  114. std::set<CPropertyItem*> m_PropertyItems;
  115. };
  116. /////////////////////////////////////////////////////////////////////////////
  117. //{{AFX_INSERT_LOCATION}}
  118. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  119. #endif // !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)