Viking Skull Lamp
V1.0.1
|
Menu Item Class. More...
#include <menu.hpp>
Public Types | |
enum | encoderState_t { NEXT , UP , DOWN } |
Used for actionFunc to pass the event as an argument. More... | |
enum | menuStyle_t { NORMAL , INVERTED } |
Describes the style of the item drawing. More... | |
Public Member Functions | |
menuItem (const char *name_p) | |
Constructor. More... | |
Public Attributes | |
menuItem * | up = NULL |
Pointer to the upper neighbor. More... | |
menuItem * | down = NULL |
Pointer to the lower neighbor. More... | |
menuItem * | next = NULL |
Pointer to the next neighbor. More... | |
bool | selectable = true |
If set, the item won't be selectable. More... | |
bool | selected = false |
If set, a filled circle will appear on the right side, next to the item name. More... | |
enum menuStyle_t | style = NORMAL |
Menu style variable. By default it is set to NORMAL. More... | |
void(* | actionFunc )(enum encoderState_t state) = NULL |
Function pointer to override the button action behaviour. More... | |
void(* | drawFunc )(ssd1306 *oled) = NULL |
Function pointer to override the drawing behaviour. More... | |
const char * | name = NULL |
It is a pointer to a string. More... | |
Menu Item Class.
This object describes an element in the menu. An element usually just a line of text. In the menu the elements are placed like a list. In normal case an element have an upper neighbor and a lower neighbor. If you scroll through the menu the selection system will use the neighborhood of the item to draw the upper and lower menus. Also there is a special neighbor called next. It will be selected when we press the button on the item. There are some other parameters but they will be described below.
Used for actionFunc to pass the event as an argument.
Enumerator | |
---|---|
NEXT | Encoder button pressed. |
UP | Encoder rotated up. |
DOWN | Encoder rotated down. |
menuItem::menuItem | ( | const char * | name_p | ) |
void(* menuItem::actionFunc) (enum encoderState_t state) = NULL |
menuItem* menuItem::down = NULL |
void(* menuItem::drawFunc) (ssd1306 *oled) = NULL |
const char* menuItem::name = NULL |
menuItem* menuItem::next = NULL |
bool menuItem::selectable = true |
bool menuItem::selected = false |
enum menuStyle_t menuItem::style = NORMAL |