cmCursesBoolWidget.h 886 B

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