summaryrefslogtreecommitdiffstats
path: root/Source/FLTKDialog/FLTKPropertyList.h
blob: ea98609e909ec4355a47ff2e6b1022fefcbbb2e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef FLTKPROPERTYLIST_H
#define FLTKPROPERTYLIST_H

#include "../cmStandardIncludes.h"
#include <string>


class CMakeSetupGUIImplementation;  


namespace fltk {


/////////////////////////////////////////////////////////////////////////////
//PropertyList Items
class PropertyItem 
{
// Attributes
public:
  std::string m_HelpString;
  std::string m_propName;
  std::string m_curValue;
  int m_nItemType;
  std::string m_cmbItems;
  bool m_Removed;
  bool m_NewValue;
  bool m_Dirty;
public:
  PropertyItem( std::string propName, 
                std::string curValue,
                std::string helpString,
                int nItemType, 
                std::string cmbItems )
    {
      m_HelpString  = helpString;
      m_propName    = propName;
      m_curValue    = curValue;
      m_nItemType   = nItemType;
      m_cmbItems    = cmbItems;
      m_Removed     = false;
      m_NewValue    = true;
      m_Dirty       = false;
    }
};





/////////////////////////////////////////////////////////////////////////////
// PropertyList window

class PropertyList 
{
// Construction
public:
  enum ItemType 
    {
      COMBO = 0,
      EDIT,
      COLOR,
      FONT,
      FILE,
      CHECKBOX,
      PATH
    };

  PropertyList( CMakeSetupGUIImplementation * );
  
// Attributes
public:

// Operations
public:
  int AddItem( std::string txt );
  int AddProperty(const char* name,
                  const char* value,
                  const char* helpString,
                  int type,
                  const char* comboItems,
                  bool reverseOrder);
  void RemoveProperty(const char* name);
  std::set<PropertyItem*> & GetItems() 
    {
      return m_PropertyItems;
    }

  void InvalidateList(void);
  void Invalidate(void) 
  {
    // fltk redraw();
  }
  
  int GetCount(void) const 
  {
    return m_PropertyItems.size();
  }
  void OnButton(void);
  void OnHelp(void);
  void RemoveAll();
  PropertyItem* GetItem(int index);
  PropertyItem* GetItemDataPtr(int m_curSel);

  void ClearDirty(void)    { m_Dirty = false; }
  void SetDirty(void)      { m_Dirty = true;  }
  bool IsDirty(void) const { return m_Dirty;  }

// Implementation
public:
  virtual ~PropertyList();

protected:

  int AddPropItem(PropertyItem* pItem,bool reverseOrder);

  std::set<PropertyItem*> m_PropertyItems;

  CMakeSetupGUIImplementation * m_CMakeSetup;

  bool            m_Dirty;

};


} // end namespace fltk

#endif