cmCursesBoolWidget.h 871 B

12345678910111213141516171819202122232425262728
  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 "cmCursesStandardIncludes.h"
  6. #include "cmCursesWidget.h"
  7. class cmCursesBoolWidget : public cmCursesWidget
  8. {
  9. public:
  10. cmCursesBoolWidget(int width, int height, int left, int top);
  11. cmCursesBoolWidget(cmCursesBoolWidget const&) = delete;
  12. cmCursesBoolWidget& operator=(cmCursesBoolWidget const&) = delete;
  13. // Description:
  14. // Handle user input. Called by the container of this widget
  15. // when this widget has focus. Returns true if the input was
  16. // handled.
  17. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override;
  18. // Description:
  19. // Set/Get the value (on/off).
  20. void SetValueAsBool(bool value);
  21. bool GetValueAsBool();
  22. };