nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
MenuItemTextlist.hpp
1#ifndef MENUITEMTEXTLIST_H_DEFINED
2#define MENUITEMTEXTLIST_H_DEFINED
3
4#include <Interface/Menu/MenuItem.hpp>
5
6#include <vector>
7#include <string>
8
10class MenuItemTextlist: public MenuItem
11{
12public:
13 MenuItemTextlist(std::string label, int id, std::vector<std::string> options, std::string initial);
14
15 virtual ~MenuItemTextlist() { };
16
17 void draw(Window* window, int x, int y, int width, bool hilite);
18 void handleInput();
19
20 void increase();
21 void decrease();
22 void reset();
23
24 std::string currentText();
25
26private:
27 std::vector<std::string> options;
28 int currentIndex;
29};
30
31#endif //MENUITEMTEXTLIST_H_DEFINED
32
void handleInput()
Makes the menu item react to input, as seen on the global InputManager.
void draw(Window *window, int x, int y, int width, bool hilite)
Shows this item at x, y with width.
A segment of the terminal screen (2D char matrix).
Definition Window.hpp:17
MenuItem(std::string label, int id)
Create a MenuItem, with user-defined id.
Definition MenuItem.cpp:6
std::string label
Text that will be shown on the screen.
Definition MenuItem.hpp:54