cmCursesWidget.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __cmCursesWidget_h
  2. #define __cmCursesWidget_h
  3. #include "../cmCacheManager.h"
  4. #include "cmCursesStandardIncludes.h"
  5. class cmCursesWidget
  6. {
  7. public:
  8. cmCursesWidget(int width, int height, int left, int top);
  9. virtual ~cmCursesWidget();
  10. // Description:
  11. // Handle user input. Called by the container of this widget
  12. // when this widget has focus. Returns true if the input was
  13. // handled
  14. virtual bool HandleInput(int& key, FORM* form, WINDOW* w) = 0;
  15. // Description:
  16. // Change the position of the widget. Set isNewPage to true
  17. // if this widget marks the beginning of a new page.
  18. virtual void Move(int x, int y, bool isNewPage);
  19. // Description:
  20. // Set/Get the value (setting the value also changes the contents
  21. // of the field buffer).
  22. virtual void SetValue(const char* value);
  23. virtual const char* GetValue();
  24. // Description:
  25. // Get the type of the widget (STRING, PATH etc...)
  26. cmCacheManager::CacheEntryType GetType()
  27. { return m_Type; }
  28. friend class cmCursesMainForm;
  29. protected:
  30. cmCursesWidget(const cmCursesWidget& from);
  31. void operator=(const cmCursesWidget&);
  32. cmCacheManager::CacheEntryType m_Type;
  33. std::string m_Value;
  34. FIELD* m_Field;
  35. };
  36. #endif // __cmCursesWidget_h