nsnake
Classic snake game for the terminal
MenuItemCheckbox.hpp
1 #ifndef MENUITEMCHECKBOX_H_DEFINED
2 #define MENUITEMCHECKBOX_H_DEFINED
3 
4 #include <Interface/Menu/MenuItem.hpp>
5 
9 struct 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:16
void handleInput()
Makes the menu item react to input, as seen on the global InputManager.
Simplest type of item possible, with a label and user-defined id.
Definition: MenuItem.hpp:11
std::string label
Text that will be shown on the screen.
Definition: MenuItem.hpp:54
A little box that can be checked or not.
void draw(Window *window, int x, int y, int width, bool hilite=false)
Shows this item at #x, #y with #width.