cmCursesOptionsWidget.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt 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 cmCursesMainForm;
  10. class cmCursesOptionsWidget : public cmCursesWidget
  11. {
  12. public:
  13. cmCursesOptionsWidget(int width, int height, int left, int top);
  14. cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
  15. cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
  16. // Description:
  17. // Handle user input. Called by the container of this widget
  18. // when this widget has focus. Returns true if the input was
  19. // handled.
  20. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override;
  21. void SetOption(const std::string&);
  22. void AddOption(std::string const&);
  23. void NextOption();
  24. void PreviousOption();
  25. protected:
  26. std::vector<std::string> Options;
  27. std::vector<std::string>::size_type CurrentOption;
  28. };