cmCursesOptionsWidget.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCursesOptionsWidget_h
  4. #define cmCursesOptionsWidget_h
  5. #include <cmConfigure.h>
  6. #include "cmCursesStandardIncludes.h"
  7. #include "cmCursesWidget.h"
  8. #include <string>
  9. #include <vector>
  10. class cmCursesMainForm;
  11. class cmCursesOptionsWidget : public cmCursesWidget
  12. {
  13. public:
  14. cmCursesOptionsWidget(int width, int height, int left, int top);
  15. // Description:
  16. // Handle user input. Called by the container of this widget
  17. // when this widget has focus. Returns true if the input was
  18. // handled.
  19. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) CM_OVERRIDE;
  20. void SetOption(const std::string&);
  21. void AddOption(std::string const&);
  22. void NextOption();
  23. void PreviousOption();
  24. protected:
  25. cmCursesOptionsWidget(const cmCursesOptionsWidget& from);
  26. void operator=(const cmCursesOptionsWidget&);
  27. std::vector<std::string> Options;
  28. std::vector<std::string>::size_type CurrentOption;
  29. };
  30. #endif // cmCursesOptionsWidget_h