nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
MenuItemCheckbox.hpp
1#ifndef MENUITEMCHECKBOX_H_DEFINED
2#define MENUITEMCHECKBOX_H_DEFINED
3
4#include <Interface/Menu/MenuItem.hpp>
5
9struct MenuItemCheckbox: public MenuItem
10{
11 MenuItemCheckbox(std::string label, int id, bool initial=false);
12
13 virtual ~MenuItemCheckbox() {};
14
15 void draw(Window* window, int x, int y, int width, bool hilite=false);
16
17 void handleInput();
18
19 void check(bool option);
20 void toggle();
21 bool isChecked();
22
23 bool checked;
24};
25
26#endif //MENUITEMCHECKBOX_H_DEFINED
27
A segment of the terminal screen (2D char matrix).
Definition Window.hpp:17
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=false)
Shows this item at x, y with width.
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