modm API documentation
|
The ChoiceMenu class provides a simmliar list like the Standard Menu. In the ChoiceMenu each entry is associated with a boolean variable, which can be changed by pressing the OK Button. More...
#include <modm/ui/menu/choice_menu.hpp>
Public Member Functions | |
ChoiceMenu (modm::ViewStack *stack, uint8_t identifier) | |
ChoiceMenu (modm::ViewStack *stack, uint8_t identifier, const char *title) | |
void | addEntry (const char *text, bool *valuePtr, bool defaultValue=true) |
addEntry a new entry to the ChoiceMenu More... | |
virtual void | initialise () |
initialise the ChoiceMenu, should be called right after contructing the instance of ChoiceMenu TODO this function should be called in the push function of viewStack automatically | |
void | setTitle (const char *text) |
setTitle set the title displayed on top of the entryList More... | |
virtual void | shortButtonPress (modm::MenuButtons::Button button) |
shortButtonPress handle the button press actions | |
virtual bool | hasChanged () |
hasChanged returns true if the screen needs to be drawn again | |
virtual void | draw () |
draw the screen | |
virtual void | openNextScreen () = 0 |
openNextScreen puts the next screen to be displayed on the stack | |
modm::ColorGraphicDisplay & | display () |
uint8_t | getIdentifier () |
getIdentifier of the view. | |
modm::ViewStack * | getViewStack () |
bool | isAlive () const |
isAlive tells the ViewStack if it should remove this screen. More... | |
virtual void | onRemove () |
onRemove will be called right before the view gets deleted, can be reimplemented to reset external data. | |
void | remove () |
remove the view from the screen. The viewStack handles the deletion. | |
virtual void | update () |
update The update function of the top most display gets called as often as possible. Only the update of the top view in each ViewStack gets called. | |
Public Attributes | |
bool | alive |
const uint8_t | identifier |
Protected Typedefs | |
typedef modm::DoublyLinkedList< ChoiceMenuEntry > | EntryList |
Protected Attributes | |
EntryList | entries |
The ChoiceMenu class provides a simmliar list like the Standard Menu. In the ChoiceMenu each entry is associated with a boolean variable, which can be changed by pressing the OK Button.
Controls: DOWN - select next entry UP - select previous entry OK - toogle boolean value of selected entry LEFT - remove screen from stack RIGHT - put next screen on stack
void modm::ChoiceMenu::addEntry | ( | const char * | text, |
bool * | valuePtr, | ||
bool | defaultValue = true |
||
) |
addEntry a new entry to the ChoiceMenu
text | to be displayed in the list |
valuePtr | pointer to the associated boolean variable |
defaultValue | default value of the boolean variable |
|
inherited |
void modm::ChoiceMenu::setTitle | ( | const char * | text | ) |
setTitle set the title displayed on top of the entryList
text |