|
LCDGFX LCD display driver
1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
|
Class implements menu objects for lcdgfx library. More...
#include <menu.h>
Public Member Functions | |
| LcdGfxMenu (const char **items, uint8_t count, const NanoRect &rect={}) | |
| Creates menu object with the provided list of menu items. More... | |
| void | down () |
| Moves selection pointer down by 1 item. More... | |
| void | up () |
| Moves selection pointer up by 1 item. More... | |
| uint8_t | selection () |
| Returns currently selected menu item. More... | |
| void | setSelection (uint8_t s) |
| void | setRect (const NanoRect &rect={}) |
| Sets rect area for the menu. More... | |
| uint8_t | size () |
| Returns total count of menu items in menu. | |
| template<typename D > | |
| void | updateSize (D &d) |
| Updates size of the object, if it was not set previously. | |
| template<typename D > | |
| void | show (D &d) |
| Shows menu items on the display. More... | |
| LcdGfxMenu::LcdGfxMenu | ( | const char ** | items, |
| uint8_t | count, | ||
| const NanoRect & | rect = {} |
||
| ) |
Creates menu object with the provided list of menu items.
List of menu items (strings) must exist all until menu object is no longer needed. Selection is set to the first item by default.
| items | array of null-termintated strings (located in SRAM) |
| count | count of menu items in the array |
| rect | screen area to use for menu |
| void LcdGfxMenu::down | ( | ) |
Moves selection pointer down by 1 item.
If there are no items below, it will set selection pointer to the first item. Use show() to refresh menu state on the display.
| uint8_t LcdGfxMenu::selection | ( | ) |
Returns currently selected menu item.
First item has zero-index.
| void LcdGfxMenu::setRect | ( | const NanoRect & | rect = {} | ) |
Sets rect area for the menu.
| rect | rect area to use for menu |
| void LcdGfxMenu::show | ( | D & | d | ) |
| void LcdGfxMenu::up | ( | ) |
Moves selection pointer up by 1 item.
If selected item is the first one, then selection pointer will set to the last item in menu list. Use show() to refresh menu state on the display.