Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / MFCDialog / PropertyList.h
blob0450258e980c1a3159fca93bc14d18fbce98220c
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: PropertyList.h,v $
5 Language: C++
6 Date: $Date: 2004/01/02 22:24:19 $
7 Version: $Revision: 1.13 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef CPROPERTYLIST_H
18 #define CPROPERTYLIST_H
22 #include "../cmStandardIncludes.h"
23 class CMakeSetupDialog;
25 /////////////////////////////////////////////////////////////////////////////
26 //CPropertyList Items
27 class CPropertyItem
29 // Attributes
30 public:
31 CString m_HelpString;
32 CString m_propName;
33 CString m_curValue;
34 int m_nItemType;
35 CString m_cmbItems;
36 bool m_NewValue;
37 bool m_Removed;
38 bool m_Advanced;
40 public:
41 CPropertyItem(CString propName, CString curValue,
42 CString helpString,
43 int nItemType, CString cmbItems)
45 m_NewValue = true;
46 m_HelpString = helpString;
47 m_Removed = false;
48 m_propName = propName;
49 m_curValue = curValue;
50 m_nItemType = nItemType;
51 m_cmbItems = cmbItems;
52 m_Advanced = false;
56 /////////////////////////////////////////////////////////////////////////////
57 // CPropertyList window
59 class CPropertyList : public CListBox
61 // Construction
62 public:
63 enum ItemType
65 COMBO = 0,
66 EDIT,
67 COLOR,
68 FONT,
69 FILE,
70 CHECKBOX,
71 PATH
73 CPropertyList();
75 // Attributes
76 public:
77 CMakeSetupDialog *m_CMakeSetupDialog;
79 // Operations
80 public:
81 bool GetShowAdvanced() {return m_ShowAdvanced;}
82 bool IsDirty() { return m_Dirty; }
83 void ClearDirty() { m_Dirty = false; }
85 int AddItem(CString txt);
86 void AddProperty(const char* name,
87 const char* value,
88 const char* helpString,
89 int type,
90 const char* comboItems,
91 bool reverseOrder,
92 bool advanced);
93 void RemoveProperty(const char* name);
94 void HideControls();
95 void ShowAdvanced();
96 void HideAdvanced();
97 std::set<CPropertyItem*> GetItems()
99 return m_PropertyItems;
101 void RemoveAll();
102 CPropertyItem* GetItem(int index);
103 // Overrides
104 // ClassWizard generated virtual function overrides
105 //{{AFX_VIRTUAL(CPropertyList)
106 public:
107 virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
108 virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
109 protected:
110 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
111 virtual void PreSubclassWindow();
112 //}}AFX_VIRTUAL
114 // Implementation
115 public:
116 virtual ~CPropertyList();
118 // Generated message map functions
119 protected:
120 //{{AFX_MSG(CPropertyList)
121 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
122 afx_msg void OnSelchange();
123 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
124 afx_msg void OnKillFocus(CWnd* pNewWnd);
125 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
126 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
127 afx_msg void OnRButtonUp( UINT nFlags, CPoint point );
128 //}}AFX_MSG
129 afx_msg void OnKillfocusCmbBox();
130 afx_msg void OnSelchangeCmbBox();
131 afx_msg void OnKillfocusEditBox();
132 afx_msg void OnChangeEditBox();
133 afx_msg void OnButton();
134 afx_msg void OnIgnore();
135 afx_msg void OnDelete();
136 afx_msg void OnHelp();
137 afx_msg void OnCheckBox();
138 afx_msg void OnVScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar );
141 DECLARE_MESSAGE_MAP()
143 void InvertLine(CDC* pDC,CPoint ptFrom,CPoint ptTo);
144 void DisplayButton(CRect region);
145 // order = 0 sorted
146 // order = 1 add to top
147 // order = 2 add to bottom
148 int AddPropItem(CPropertyItem* pItem, int order);
149 void InvalidateList();
151 CComboBox m_cmbBox;
152 CEdit m_editBox;
153 CButton m_btnCtrl;
154 CButton m_CheckBoxControl;
156 CFont m_SSerif8Font;
158 bool m_Dirty;
159 int m_curSel;
160 int m_prevSel;
161 int m_nDivider;
162 int m_nDivTop;
163 int m_nDivBtm;
164 int m_nOldDivX;
165 int m_nLastBox;
166 BOOL m_bTracking;
167 BOOL m_bDivIsSet;
168 HCURSOR m_hCursorArrow;
169 HCURSOR m_hCursorSize;
170 bool m_ShowAdvanced;
171 std::set<CPropertyItem*> m_PropertyItems;
174 /////////////////////////////////////////////////////////////////////////////
176 //{{AFX_INSERT_LOCATION}}
177 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
179 #endif // !defined(AFX_PROPERTYLIST_H__74205380_1B56_11D4_BC48_00105AA2186F__INCLUDED_)