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
 
- Public Member Functions inherited from modm::AbstractMenu
 AbstractMenu (modm::ViewStack *stack, uint8_t identifier)
 
- Public Member Functions inherited from modm::AbstractView
 AbstractView (modm::ViewStack *stack, uint8_t identifier)
 
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.
 
bool isAlive () const
 isAlive tells the ViewStack if it should remove this screen. More...
 
void remove ()
 remove the view from the screen. The viewStack handles the deletion.
 
uint8_t getIdentifier ()
 getIdentifier of the view.
 
modm::ColorGraphicDisplaydisplay ()
 
virtual void onRemove ()
 onRemove will be called right before the view gets deleted, can be reimplemented to reset external data.
 
modm::ViewStackgetViewStack ()
 

Protected Typedefs

typedef modm::DoublyLinkedList< ChoiceMenuEntryEntryList
 

Protected Attributes

EntryList entries
 

Additional Inherited Members

- Public Attributes inherited from modm::AbstractView
const uint8_t identifier
 
bool alive
 

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
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: