Viking Skull Lamp  V1.0.1
Loading...
Searching...
No Matches
menu Class Reference

Menu Controller Class. More...

#include <menu.hpp>

Collaboration diagram for menu:
[legend]

Public Member Functions

 menu (ssd1306 *oled_p, menuItem *selectedItem_p)
 Constructor. More...
 
void draw ()
 Redraw the menu to the display. More...
 
void up ()
 Step te menu upwards if possible. More...
 
void down ()
 Step te menu downwards if possible. More...
 
void next ()
 Enter to the next menu if possible. More...
 

Private Attributes

menuItemselectedItem = NULL
 Pointer to the selected menu item. More...
 
ssd1306oled = NULL
 Pointer to the display controller object. More...
 
bool changed = true
 Flag that shows if the content of the display is changed. More...
 

Detailed Description

Menu Controller Class.

This class handles the menu drawing, item scrolling, behaviour overrides and lot more.

Definition at line 121 of file menu.hpp.

Constructor & Destructor Documentation

◆ menu()

menu::menu ( ssd1306 oled_p,
menuItem selectedItem_p 
)

Constructor.

Parameters
oled_pPointer to a display controller object.
selectedItem_pPointer to the default selected item. This item will be selected after startup.

Definition at line 106 of file menu.cpp.

Member Function Documentation

◆ down()

void menu::down ( )

Step te menu downwards if possible.

Definition at line 304 of file menu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ draw()

void menu::draw ( )

Redraw the menu to the display.

Note
It will only redraw the content of the display when something actually changes.

Definition at line 114 of file menu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ next()

void menu::next ( )

Enter to the next menu if possible.

Definition at line 337 of file menu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ up()

void menu::up ( )

Step te menu upwards if possible.

Definition at line 271 of file menu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ changed

bool menu::changed = true
private

Flag that shows if the content of the display is changed.

Definition at line 152 of file menu.hpp.

◆ oled

ssd1306* menu::oled = NULL
private

Pointer to the display controller object.

Definition at line 149 of file menu.hpp.

◆ selectedItem

menuItem* menu::selectedItem = NULL
private

Pointer to the selected menu item.

Definition at line 146 of file menu.hpp.