cmCursesOptionsWidget.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCursesOptionsWidget_h
  11. #define cmCursesOptionsWidget_h
  12. #include <cmConfigure.h>
  13. #include "cmCursesStandardIncludes.h"
  14. #include "cmCursesWidget.h"
  15. #include <string>
  16. #include <vector>
  17. class cmCursesMainForm;
  18. class cmCursesOptionsWidget : public cmCursesWidget
  19. {
  20. public:
  21. cmCursesOptionsWidget(int width, int height, int left, int top);
  22. // Description:
  23. // Handle user input. Called by the container of this widget
  24. // when this widget has focus. Returns true if the input was
  25. // handled.
  26. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) CM_OVERRIDE;
  27. void SetOption(const std::string&);
  28. void AddOption(std::string const&);
  29. void NextOption();
  30. void PreviousOption();
  31. protected:
  32. cmCursesOptionsWidget(const cmCursesOptionsWidget& from);
  33. void operator=(const cmCursesOptionsWidget&);
  34. std::vector<std::string> Options;
  35. std::vector<std::string>::size_type CurrentOption;
  36. };
  37. #endif // cmCursesOptionsWidget_h