cmCursesOptionsWidget.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 "cmCursesWidget.h"
  13. class cmCursesMainForm;
  14. class cmCursesOptionsWidget : public cmCursesWidget
  15. {
  16. public:
  17. cmCursesOptionsWidget(int width, int height, int left, int top);
  18. // Description:
  19. // Handle user input. Called by the container of this widget
  20. // when this widget has focus. Returns true if the input was
  21. // handled.
  22. virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
  23. void SetOption(const std::string&);
  24. void AddOption(std::string const &);
  25. void NextOption();
  26. void PreviousOption();
  27. protected:
  28. cmCursesOptionsWidget(const cmCursesOptionsWidget& from);
  29. void operator=(const cmCursesOptionsWidget&);
  30. std::vector<std::string> Options;
  31. std::vector<std::string>::size_type CurrentOption;
  32. };
  33. #endif // __cmCursesOptionsWidget_h