cmCursesOptionsWidget.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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" // IWYU pragma: keep
  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. cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
  16. cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
  17. // Description:
  18. // Handle user input. Called by the container of this widget
  19. // when this widget has focus. Returns true if the input was
  20. // handled.
  21. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override;
  22. void SetOption(const std::string&);
  23. void AddOption(std::string const&);
  24. void NextOption();
  25. void PreviousOption();
  26. protected:
  27. std::vector<std::string> Options;
  28. std::vector<std::string>::size_type CurrentOption;
  29. };
  30. #endif // cmCursesOptionsWidget_h