Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / FLTKDialog / FLTKPropertyList.h
blobd8600238f1eea533c54863eb4c56d36e1f4943d9
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: FLTKPropertyList.h,v $
5 Language: C++
6 Date: $Date: 2005/09/23 21:47:32 $
7 Version: $Revision: 1.8 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 FLTKPROPERTYLIST_H
18 #define FLTKPROPERTYLIST_H
20 #include "../cmStandardIncludes.h"
21 #include <string>
24 class CMakeSetupGUIImplementation;
27 namespace fltk {
30 /////////////////////////////////////////////////////////////////////////////
31 //PropertyList Items
32 class PropertyItem
34 // Attributes
35 public:
36 std::string m_HelpString;
37 std::string m_propName;
38 std::string m_curValue;
39 int m_nItemType;
40 std::string m_cmbItems;
41 bool m_Removed;
42 bool m_NewValue;
43 bool m_Dirty;
44 public:
45 PropertyItem( std::string propName,
46 std::string curValue,
47 std::string helpString,
48 int nItemType,
49 std::string cmbItems )
51 m_HelpString = helpString;
52 m_propName = propName;
53 m_curValue = curValue;
54 m_nItemType = nItemType;
55 m_cmbItems = cmbItems;
56 m_Removed = false;
57 m_NewValue = true;
58 m_Dirty = false;
66 /////////////////////////////////////////////////////////////////////////////
67 // PropertyList window
69 class PropertyList
71 // Construction
72 public:
73 enum ItemType
75 COMBO = 0,
76 EDIT,
77 COLOR,
78 FONT,
79 FILE,
80 CHECKBOX,
81 PATH
84 PropertyList( CMakeSetupGUIImplementation * );
86 // Attributes
87 public:
89 // Operations
90 public:
91 int AddItem( std::string txt );
92 int AddProperty(const char* name,
93 const char* value,
94 const char* helpString,
95 int type,
96 const char* comboItems,
97 bool reverseOrder);
98 void RemoveProperty(const char* name);
99 std::set<PropertyItem*> & GetItems()
101 return m_PropertyItems;
104 void InvalidateList(void);
105 void Invalidate(void)
107 // fltk redraw();
110 int GetCount(void) const
112 return m_PropertyItems.size();
114 void OnButton(void);
115 void OnHelp(void);
116 void RemoveAll();
117 PropertyItem* GetItem(int index);
118 PropertyItem* GetItemDataPtr(int m_curSel);
120 void ClearDirty(void) { m_Dirty = false; }
121 void SetDirty(void) { m_Dirty = true; }
122 bool IsDirty(void) const { return m_Dirty; }
124 // Implementation
125 public:
126 virtual ~PropertyList();
128 protected:
130 int AddPropItem(PropertyItem* pItem,bool reverseOrder);
132 std::set<PropertyItem*> m_PropertyItems;
134 CMakeSetupGUIImplementation * m_CMakeSetup;
136 bool m_Dirty;
141 } // end namespace fltk
143 #endif