nsnake
Classic snake game for the terminal
|
Place where you can input characters. More...
#include <MenuItemTextbox.hpp>
Public Member Functions | |
MenuItemTextbox (std::string label, int id, int width, std::string initial) | |
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. | |
![]() | |
MenuItem (std::string label, int id) | |
Create a MenuItem, with user-defined id. | |
Public Attributes | |
std::string | currentText |
int | width |
![]() | |
MenuItemType | type |
Specific type of this widget. | |
std::string | label |
Text that will be shown on the screen. | |
int | id |
User-defined id to identify this item. | |
Additional Inherited Members | |
![]() | |
enum | MenuItemType { ITEM , LABEL , CHECKBOX , NUMBERBOX , TEXTBOX , TEXTLIST } |
All possible item types. More... | |
Place where you can input characters.
For more info, check out MenuItem.
Definition at line 9 of file MenuItemTextbox.hpp.
MenuItemTextbox::MenuItemTextbox | ( | std::string | label, |
int | id, | ||
int | width, | ||
std::string | initial ) |
Definition at line 6 of file MenuItemTextbox.cpp.
|
inlinevirtual |
Definition at line 13 of file MenuItemTextbox.hpp.
|
virtual |
Shows this item at #x, #y with width.
If this is the current item, send #hilite as true.
Reimplemented from MenuItem.
Definition at line 13 of file MenuItemTextbox.cpp.
|
virtual |
Makes the menu item react to input, as seen on the global InputManager.
Each type of MenuItem might react to input differently. A text box might want to show printable characters, a check box might want to check if space bar was pressed, whatever.
When inheriting this, make sure to implement it.
Reimplemented from MenuItem.
Definition at line 42 of file MenuItemTextbox.cpp.
std::string MenuItemTextbox::currentText |
Definition at line 19 of file MenuItemTextbox.hpp.
int MenuItemTextbox::width |
Definition at line 20 of file MenuItemTextbox.hpp.