nsnake
Classic snake game for the terminal
|
A list of selectable text. More...
#include <MenuItemTextlist.hpp>
Public Member Functions | |
MenuItemTextlist (std::string label, int id, std::vector< std::string > options, std::string initial) | |
void | draw (Window *window, int x, int y, int width, bool hilite) |
Shows this item at #x, #y with #width. More... | |
void | handleInput () |
Makes the menu item react to input, as seen on the global InputManager. More... | |
void | increase () |
void | decrease () |
void | reset () |
std::string | currentText () |
![]() | |
MenuItem (std::string label, int id) | |
Create a MenuItem, with user-defined id. More... | |
Additional Inherited Members | |
![]() | |
enum | MenuItemType { ITEM, LABEL, CHECKBOX, NUMBERBOX, TEXTBOX, TEXTLIST } |
All possible item types. More... | |
![]() | |
MenuItemType | type |
Specific type of this widget. More... | |
std::string | label |
Text that will be shown on the screen. | |
int | id |
User-defined id to identify this item. | |
A list of selectable text.
Definition at line 10 of file MenuItemTextlist.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 26 of file MenuItemTextlist.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 66 of file MenuItemTextlist.cpp.