cmCursesOptionsWidget.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file LICENSE.rst or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <vector>
  7. #include "cmCursesStandardIncludes.h"
  8. #include "cmCursesWidget.h"
  9. class cmCursesOptionsWidget : public cmCursesWidget
  10. {
  11. public:
  12. cmCursesOptionsWidget(int width, int height, int left, int top);
  13. cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
  14. cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
  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) override;
  20. void SetOption(std::string const&);
  21. void AddOption(std::string const&);
  22. void NextOption();
  23. void PreviousOption();
  24. protected:
  25. std::vector<std::string> Options;
  26. std::vector<std::string>::size_type CurrentOption;
  27. };