ESPHome  2024.10.2
lcd_menu.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #include <forward_list>
7 #include <vector>
8 
9 namespace esphome {
10 namespace lcd_menu {
11 
16  public:
17  void set_display(lcd_base::LCDDisplay *display) { this->display_ = display; }
18  void set_dimensions(uint8_t columns, uint8_t rows) {
19  this->columns_ = columns;
20  set_rows(rows);
21  }
22  void set_mark_selected(uint8_t c) { this->mark_selected_ = c; }
23  void set_mark_editing(uint8_t c) { this->mark_editing_ = c; }
24  void set_mark_submenu(uint8_t c) { this->mark_submenu_ = c; }
25  void set_mark_back(uint8_t c) { this->mark_back_ = c; }
26 
27  void setup() override;
28  float get_setup_priority() const override;
29 
30  void dump_config() override;
31 
32  protected:
33  void draw_item(const display_menu_base::MenuItem *item, uint8_t row, bool selected) override;
34  void update() override { this->display_->update(); }
35 
37  uint8_t columns_;
41  char mark_back_;
42 };
43 
44 } // namespace lcd_menu
45 } // namespace esphome
void set_dimensions(uint8_t columns, uint8_t rows)
Definition: lcd_menu.h:18
Class to display a hierarchical menu.
Definition: lcd_menu.h:15
float get_setup_priority() const override
Definition: lcd_menu.cpp:19
void set_display(lcd_base::LCDDisplay *display)
Definition: lcd_menu.h:17
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void draw_item(const display_menu_base::MenuItem *item, uint8_t row, bool selected) override
Definition: lcd_menu.cpp:31
Class to display a hierarchical menu.