|
| Menu (int x, int y, int width) |
| Construct a new Menu object. More...
|
|
| Menu (int width) |
| Construct a new Menu:: Menu object. More...
|
|
| Menu (const Menu &)=delete |
|
| Menu (Menu &&) |
|
void | addSelection (char c, const char *line) |
|
void | addSelection (char c, const char *line, updateFunction update) |
| This allows for menus with updater functions. More...
|
|
void | defaultSelection (int d) |
|
void | setRender (bool selected, renderFunction render) |
|
int | choose (Door &door) |
|
char | which (int d) |
|
| Panel (int x, int y, int width) |
|
| Panel (int width) |
|
| Panel (Panel &)=delete |
|
| Panel (Panel &&ref) |
|
void | set (int x, int y) |
| Set the panels X and Y screen position. More...
|
|
void | get (int &x, int &y) |
|
void | setTitle (std::unique_ptr< Line > T, int off=1) |
|
void | setStyle (BorderStyle bs) |
|
void | setColor (ANSIColor c) |
|
int | getWidth (void) |
|
int | getHeight (void) |
|
void | hide (void) |
|
void | show (void) |
|
void | addLine (std::unique_ptr< Line > l) |
|
bool | update (Door &d) |
| Updates a panel. More...
|
|
void | update (Door &d, int line) |
|
void | update (void) |
|
door::Goto | gotoEnd (void) |
|
std::unique_ptr< Line > | spacer_line (bool single) |
| Create a spacer line using block drawing characters. More...
|
|
void | lineSetBack (ANSIColor back) |
| Set background of all lines in the panel. More...
|
|
|
int | x |
|
int | y |
|
int | width |
|
BorderStyle | border_style |
|
ANSIColor | border_color |
|
std::vector< std::unique_ptr< Line > > | lines |
|
bool | hidden |
|
bool | shown_once |
|
std::unique_ptr< Line > | title |
|
int | offset |
|
◆ Menu() [1/2]
door::Menu::Menu |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width |
|
) |
| |
Construct a new Menu object.
Set the x, y screen location for the start of the menu, and the width. The location can be changed via Panel::set
- Parameters
-
◆ Menu() [2/2]
door::Menu::Menu |
( |
int |
width | ) |
|
Construct a new Menu:: Menu object.
This creates a panel with a default width. The location needs to be changed Panel::set
- Parameters
-
◆ addSelection()
void door::Menu::addSelection |
( |
char |
c, |
|
|
const char * |
line, |
|
|
updateFunction |
update |
|
) |
| |
This allows for menus with updater functions.
Note: The update function only needs to update just the line text. We wrap it with another updateFuntion to append the "[M] " part.
- Parameters
-
◆ choose()
int door::Menu::choose |
( |
Door & |
door | ) |
|
- Todo:
- Fix this, so it only updates the lines that have been changed when the user selects something. Also, add the "Up/Down Move" maybe to the bottom?
Needs timeout.
Should we return the index offset, or return the actual char? (Like in the case of Quit or Help?)
- Parameters
-
- Returns
- int
- Examples
- menu-example.cpp.
◆ makeRender()
make Render function for menus
[O] Menu Item Text
"[" and "]" are in c1, the "O" in c2
"Menu Item Text" upper case letters are in c3, everything else c4.
◆ defaultSelectedRender
◆ defaultUnselectedRender
The documentation for this class was generated from the following files: