nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
src
Interface
Menu
MenuItemTextbox.hpp
1
#ifndef MENUITEMTEXTBOX_H_DEFINED
2
#define MENUITEMTEXTBOX_H_DEFINED
3
4
#include <Interface/Menu/MenuItem.hpp>
5
9
struct
MenuItemTextbox
:
public
MenuItem
10
{
11
MenuItemTextbox
(std::string
label
,
int
id
,
int
width, std::string initial);
12
13
virtual
~MenuItemTextbox
() {};
14
15
void
draw
(
Window
* window,
int
x,
int
y,
int
width,
bool
hilite=
false
);
16
17
void
handleInput
();
18
19
std::string currentText;
20
int
width;
21
};
22
23
#endif
//MENUITEMTEXTBOX_H_DEFINED
24
Window
A segment of the terminal screen (2D char matrix).
Definition
Window.hpp:17
MenuItemTextbox
Place where you can input characters.
Definition
MenuItemTextbox.hpp:10
MenuItemTextbox::handleInput
void handleInput()
Makes the menu item react to input, as seen on the global InputManager.
Definition
MenuItemTextbox.cpp:42
MenuItemTextbox::draw
void draw(Window *window, int x, int y, int width, bool hilite=false)
Shows this item at #x, #y with width.
Definition
MenuItemTextbox.cpp:13
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