31 auto *it = static_cast<LVGLSelect *>(e->user_data);
34 LV_EVENT_REFRESH,
this);
35 auto lamb = [](lv_event_t *e) {
36 auto *self =
static_cast<LVGLSelect *
>(e->user_data);
39 lv_obj_add_event_cb(this->
widget_->
obj, lamb, LV_EVENT_VALUE_CHANGED,
this);
61 opt_ptrs.
init(opts.size());
62 for (
const auto &opt : opts) {
virtual ESPPreferenceObject make_preference(size_t length, uint32_t type, bool in_flash)=0
uint32_t get_preference_hash()
Get a unique hash for storing preferences/settings for this entity.
Fixed-capacity vector - allocates once at runtime, never reallocates This avoids std::vector template...
void push_back(const T &value)
Add element without bounds checking Caller must ensure sufficient capacity was allocated via init() S...
ESPPreferenceObject pref_
void control(size_t index) override
LVGLSelect(LvSelectable *widget, lv_anim_enable_t anim, bool restore)
const std::vector< std::string > & get_options()
virtual void set_selected_index(size_t index, lv_anim_enable_t anim)=0
virtual size_t get_selected_index()=0
Base-class for all selects.
void publish_state(const std::string &state)
void set_options(const std::initializer_list< const char * > &options)
lv_event_code_t lv_update_event
Providing packet encoding functions for exchanging data with a remote host.
ESPPreferences * global_preferences