modm API documentation
modm::ChoiceMenu< Allocator > Class Template 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< Allocator >:
modm::AbstractMenu< Allocator > modm::AbstractView< Allocator > modm::IAbstractView

Public Member Functions

 ChoiceMenu (modm::ViewStack< Allocator > *stack, uint8_t identifier)
 
 ChoiceMenu (modm::ViewStack< Allocator > *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::GraphicDisplaydisplay ()
 
uint8_t getIdentifier ()
 getIdentifier of the view.
 
modm::ViewStack< Allocator > * 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.
 

Protected Typedefs

typedef modm::DoublyLinkedList< ChoiceMenuEntryEntryList
 

Protected Attributes

EntryList entries
 

Detailed Description

template<typename Allocator = std::allocator<IAbstractView>>
class modm::ChoiceMenu< Allocator >

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

template<typename Allocator = std::allocator<IAbstractView>>
void modm::ChoiceMenu< Allocator >::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::IAbstractView::isAlive ( ) const
inheritedinline

isAlive tells the ViewStack if it should remove this screen.

Returns
template<typename Allocator = std::allocator<IAbstractView>>
void modm::ChoiceMenu< Allocator >::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 file: