cmCursesOptionsWidget.h 1.0 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" // 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. CM_DISABLE_COPY(cmCursesOptionsWidget)
  14. public:
  15. cmCursesOptionsWidget(int width, int height, int left, int top);
  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. };
  29. #endif // cmCursesOptionsWidget_h