modm API documentation
modm::ChoiceMenu Class Referenceabstract

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>

Inheritance diagram for modm::ChoiceMenu:
modm::AbstractMenu modm::AbstractView

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::ColorGraphicDisplaydisplay ()
 
uint8_t getIdentifier ()
 getIdentifier of the view.
 
modm::ViewStackgetViewStack ()
 
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< ChoiceMenuEntryEntryList
 

Protected Attributes

EntryList entries
 

Detailed Description

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

Author
Thorsten Lajewski

Member Function Documentation

void modm::ChoiceMenu::addEntry ( const char *  text,
bool *  valuePtr,
bool  defaultValue = true 
)

addEntry a new entry to the ChoiceMenu

Parameters
textto be displayed in the list
valuePtrpointer to the associated boolean variable
defaultValuedefault value of the boolean variable
bool modm::AbstractView::isAlive ( ) const
inherited

isAlive tells the ViewStack if it should remove this screen.

Returns
void modm::ChoiceMenu::setTitle ( const char *  text)

setTitle set the title displayed on top of the entryList

Parameters
text

The documentation for this class was generated from the following files: