nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
MenuItemNumberbox.hpp
1#ifndef MENUITEMNUMBERBOX_H_DEFINED
2#define MENUITEMNUMBERBOX_H_DEFINED
3
4#include <Interface/Menu/MenuItem.hpp>
5
18{
28 MenuItemNumberbox(std::string label, int id, int min, int max, int initial, int jump=1);
29 virtual ~MenuItemNumberbox() { };
30
31 void draw(Window* window, int x, int y, int width, bool hilite=false);
32
33 void handleInput();
34
35 void increase();
36 void decrease();
37 void set(int value);
38 void reset();
39
40 int min;
41 int max;
42 int initial;
43 int current;
44 int jump;
45
46private:
48 void cap();
49};
50
51#endif //MENUITEMNUMBERBOX_H_DEFINED
52
A segment of the terminal screen (2D char matrix).
Definition Window.hpp:17
Allows to select a number, kinda like a slider.
void draw(Window *window, int x, int y, int width, bool hilite=false)
Shows this item at #x, #y with #width.
void handleInput()
Makes the menu item react to input, as seen on the global InputManager.
MenuItemNumberbox(std::string label, int id, int min, int max, int initial, int jump=1)
Create a new number box.
Simplest type of item possible, with a label and user-defined id.
Definition MenuItem.hpp:12
std::string label
Text that will be shown on the screen.
Definition MenuItem.hpp:54