Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CursesDialog/cmCursesOptionsWidget.h
4998 views
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
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <string>
8
#include <vector>
9
10
#include "cmCursesStandardIncludes.h"
11
#include "cmCursesWidget.h"
12
13
class cmCursesOptionsWidget : public cmCursesWidget
14
{
15
public:
16
cmCursesOptionsWidget(int width, int height, int left, int top);
17
18
cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
19
cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
20
21
// Description:
22
// Handle user input. Called by the container of this widget
23
// when this widget has focus. Returns true if the input was
24
// handled.
25
bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override;
26
void SetOption(std::string const&);
27
void AddOption(std::string const&);
28
void NextOption();
29
void PreviousOption();
30
31
protected:
32
std::vector<std::string> Options;
33
std::vector<std::string>::size_type CurrentOption;
34
};
35
36