|
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
|
Checkbox menu widget for lcdgfx. More...
#include <checkbox_menu.h>
Public Member Functions | |
| LcdGfxCheckboxMenu (const char **items, uint8_t count, const NanoRect &rect={}) | |
| Creates checkbox menu object. More... | |
| void | down () |
| Moves selection down by one item. More... | |
| void | up () |
| Moves selection up by one item. More... | |
| void | toggle () |
| Toggles the checkbox state of the currently selected item. | |
| bool | isChecked (uint8_t index) |
| Returns true if the item at the given index is checked. More... | |
| void | setChecked (uint8_t index, bool checked) |
| Sets the checkbox state of a specific item. More... | |
| uint16_t | checkedMask () |
| Returns the full checkbox state as a bitmask. More... | |
| uint8_t | selection () |
| Returns currently selected menu item index. | |
| void | setSelection (uint8_t s) |
| Sets the current selection index. More... | |
| void | setRect (const NanoRect &rect={}) |
| Sets rect area for the menu. More... | |
| uint8_t | size () |
| Returns total count of menu items. | |
| template<typename D > | |
| void | updateSize (D &d) |
| Updates size of the object if not set previously. | |
| template<typename D > | |
| void | show (D &d) |
| Shows the checkbox menu on the display. More... | |
Checkbox menu widget for lcdgfx.
Each menu item is displayed with a checkbox indicator (filled box = checked, empty box = unchecked). Navigate with up()/down() and toggle the current item's checkbox with toggle(). Supports up to 16 items.
Includes scroll indicators (arrows and scrollbar) when items overflow.
Definition at line 69 of file checkbox_menu.h.
| LcdGfxCheckboxMenu::LcdGfxCheckboxMenu | ( | const char ** | items, |
| uint8_t | count, | ||
| const NanoRect & | rect = {} |
||
| ) |
Creates checkbox menu object.
| items | array of null-terminated strings (in SRAM) |
| count | count of menu items (max 16) |
| rect | screen area for the menu (0,0 = auto-size to display) |
| uint16_t LcdGfxCheckboxMenu::checkedMask | ( | ) |
Returns the full checkbox state as a bitmask.
Bit 0 = item 0, bit 1 = item 1, etc.
| void LcdGfxCheckboxMenu::down | ( | ) |
Moves selection down by one item.
Wraps to first item.
| bool LcdGfxCheckboxMenu::isChecked | ( | uint8_t | index | ) |
Returns true if the item at the given index is checked.
| index | item index (0-based) |
| void LcdGfxCheckboxMenu::setChecked | ( | uint8_t | index, |
| bool | checked | ||
| ) |
Sets the checkbox state of a specific item.
| index | item index (0-based) |
| checked | true to check, false to uncheck |
| void LcdGfxCheckboxMenu::setRect | ( | const NanoRect & | rect = {} | ) |
Sets rect area for the menu.
| rect | rect area to use |
| void LcdGfxCheckboxMenu::setSelection | ( | uint8_t | s | ) |
Sets the current selection index.
| s | item index |
| void LcdGfxCheckboxMenu::show | ( | D & | d | ) |
Shows the checkbox menu on the display.
Includes scroll indicators when items overflow the visible area.
| d | display object |
Definition at line 276 of file checkbox_menu.h.
| void LcdGfxCheckboxMenu::up | ( | ) |
Moves selection up by one item.
Wraps to last item.