PropertyList.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #ifndef CPROPERTYLIST_H
  2. #define CPROPERTYLIST_H
  3. #include "../cmStandardIncludes.h"
  4. /////////////////////////////////////////////////////////////////////////////
  5. //CPropertyList Items
  6. class CPropertyItem
  7. {
  8. // Attributes
  9. public:
  10. CString m_HelpString;
  11. CString m_propName;
  12. CString m_curValue;
  13. int m_nItemType;
  14. CString m_cmbItems;
  15. bool m_Removed;
  16. public:
  17. CPropertyItem(CString propName, CString curValue,
  18. CString helpString,
  19. int nItemType, CString cmbItems)
  20. {
  21. m_HelpString = helpString;
  22. m_Removed = false;
  23. m_propName = propName;
  24. m_curValue = curValue;
  25. m_nItemType = nItemType;
  26. m_cmbItems = cmbItems;
  27. }
  28. };
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CPropertyList window
  31. class CPropertyList : public CListBox
  32. {
  33. // Construction
  34. public:
  35. enum ItemType
  36. {
  37. COMBO = 0,
  38. EDIT,
  39. COLOR,
  40. FONT,
  41. FILE,
  42. CHECKBOX,
  43. PATH
  44. };
  45. CPropertyList();
  46. // Attributes
  47. public:
  48. // Operations
  49. public:
  50. int AddItem(CString txt);
  51. int AddProperty(const char* name,
  52. const char* value,
  53. const char* helpString,
  54. int type,
  55. const char* comboItems);
  56. std::set<CPropertyItem*> GetItems()
  57. {
  58. return m_PropertyItems;
  59. }
  60. void RemoveAll();
  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. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  70. virtual void PreSubclassWindow();
  71. //}}AFX_VIRTUAL
  72. // Implementation
  73. public:
  74. virtual ~CPropertyList();
  75. // Generated message map functions
  76. protected:
  77. //{{AFX_MSG(CPropertyList)
  78. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  79. afx_msg void OnSelchange();
  80. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  81. afx_msg void OnKillFocus(CWnd* pNewWnd);
  82. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  83. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  84. afx_msg void OnRButtonUp( UINT nFlags, CPoint point );
  85. //}}AFX_MSG
  86. afx_msg void OnKillfocusCmbBox();
  87. afx_msg void OnSelchangeCmbBox();
  88. afx_msg void OnKillfocusEditBox();
  89. afx_msg void OnChangeEditBox();
  90. afx_msg void OnButton();
  91. afx_msg void OnDelete();
  92. afx_msg void OnHelp();
  93. afx_msg void OnCheckBox();
  94. DECLARE_MESSAGE_MAP()
  95. void InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo);
  96. void DisplayButton(CRect region);
  97. int AddPropItem(CPropertyItem* pItem);
  98. CComboBox m_cmbBox;
  99. CEdit m_editBox;
  100. CButton m_btnCtrl;
  101. CButton m_CheckBoxControl;
  102. CFont m_SSerif8Font;
  103. bool m_Dirty;
  104. int m_curSel;
  105. int m_prevSel;
  106. int m_nDivider;
  107. int m_nDivTop;
  108. int m_nDivBtm;
  109. int m_nOldDivX;
  110. int m_nLastBox;
  111. BOOL m_bTracking;
  112. BOOL m_bDivIsSet;
  113. HCURSOR m_hCursorArrow;
  114. HCURSOR m_hCursorSize;
  115. std::set<CPropertyItem*> m_PropertyItems;
  116. };
  117. /////////////////////////////////////////////////////////////////////////////
  118. //{{AFX_INSERT_LOCATION}}
  119. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  120. #endif // !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)