FLTKPropertyList.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #ifndef FLTKPROPERTYLIST_H
  2. #define FLTKPROPERTYLIST_H
  3. #include "../cmStandardIncludes.h"
  4. #include <string>
  5. class CMakeSetupGUIImplementation;
  6. namespace fltk {
  7. /////////////////////////////////////////////////////////////////////////////
  8. //PropertyList Items
  9. class PropertyItem
  10. {
  11. // Attributes
  12. public:
  13. std::string m_HelpString;
  14. std::string m_propName;
  15. std::string m_curValue;
  16. int m_nItemType;
  17. std::string m_cmbItems;
  18. bool m_Removed;
  19. public:
  20. PropertyItem( std::string propName,
  21. std::string curValue,
  22. std::string helpString,
  23. int nItemType,
  24. std::string cmbItems )
  25. {
  26. m_HelpString = helpString;
  27. m_Removed = false;
  28. m_propName = propName;
  29. m_curValue = curValue;
  30. m_nItemType = nItemType;
  31. m_cmbItems = cmbItems;
  32. }
  33. };
  34. /////////////////////////////////////////////////////////////////////////////
  35. // PropertyList window
  36. class PropertyList
  37. {
  38. // Construction
  39. public:
  40. enum ItemType
  41. {
  42. COMBO = 0,
  43. EDIT,
  44. COLOR,
  45. FONT,
  46. FILE,
  47. CHECKBOX,
  48. PATH
  49. };
  50. PropertyList( CMakeSetupGUIImplementation * );
  51. // Attributes
  52. public:
  53. // Operations
  54. public:
  55. int AddItem( std::string txt );
  56. int AddProperty(const char* name,
  57. const char* value,
  58. const char* helpString,
  59. int type,
  60. const char* comboItems);
  61. std::set<PropertyItem*> GetItems()
  62. {
  63. return m_PropertyItems;
  64. }
  65. void Invalidate(void)
  66. {
  67. // fltk redraw();
  68. }
  69. int GetCount(void) const
  70. {
  71. return m_PropertyItems.size();
  72. }
  73. void OnButton(void);
  74. void OnHelp(void);
  75. void RemoveAll();
  76. PropertyItem* GetItem(int index);
  77. PropertyItem* GetItemDataPtr(int m_curSel);
  78. // Implementation
  79. public:
  80. virtual ~PropertyList();
  81. protected:
  82. int AddPropItem(PropertyItem* pItem);
  83. std::set<PropertyItem*> m_PropertyItems;
  84. CMakeSetupGUIImplementation * m_CMakeSetup;
  85. };
  86. } // end namespace fltk
  87. #endif