nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
src
Interface
Menu
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
Window
A segment of the terminal screen (2D char matrix).
Definition
Window.hpp:17
MenuItemCheckbox
A little box that can be checked or not.
Definition
MenuItemCheckbox.hpp:10
MenuItemCheckbox::handleInput
void handleInput()
Makes the menu item react to input, as seen on the global InputManager.
Definition
MenuItemCheckbox.cpp:49
MenuItemCheckbox::draw
void draw(Window *window, int x, int y, int width, bool hilite=false)
Shows this item at #x, #y with #width.
Definition
MenuItemCheckbox.cpp:12
MenuItem
Simplest type of item possible, with a label and user-defined id.
Definition
MenuItem.hpp:12
MenuItem::label
std::string label
Text that will be shown on the screen.
Definition
MenuItem.hpp:54
Generated on Thu Jul 20 2023 00:00:00 for nsnake by
1.12.0