cmCursesStringWidget.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __cmCursesStringWidget_h
  2. #define __cmCursesStringWidget_h
  3. #include "cmCursesWidget.h"
  4. class cmCursesStringWidget : public cmCursesWidget
  5. {
  6. public:
  7. cmCursesStringWidget(int width, int height, int left, int top);
  8. // Description:
  9. // Handle user input. Called by the container of this widget
  10. // when this widget has focus. Returns true if the input was
  11. // handled.
  12. virtual bool HandleInput(int& key, FORM* form, WINDOW* w);
  13. // Description:
  14. // Set/Get the string.
  15. void SetString(const char* value);
  16. const char* GetString();
  17. virtual const char* GetValue();
  18. // Description:
  19. // Set/Get InEdit flag. Can be used to tell the widget to leave
  20. // edit mode (in case of a resize for example).
  21. void SetInEdit(bool inedit)
  22. { m_InEdit = inedit; }
  23. bool GetInEdit()
  24. { return m_InEdit; }
  25. protected:
  26. cmCursesStringWidget(const cmCursesStringWidget& from);
  27. void operator=(const cmCursesStringWidget&);
  28. // true if the widget is in edit mode
  29. bool m_InEdit;
  30. };
  31. #endif // __cmCursesStringWidget_h