lv_dropdown.h
API reference for lv_dropdown.h
Functions
lv_dropdown_set_text
Set text of the drop-down list's button. If set to NULL the selected option's text will be displayed on the button. If set to a specific text then that text will be shown regardless of the selected option.
void lv_dropdown_set_text(lv_obj_t *obj, const char *text)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a drop-down list object |
text | const char * | the text as a string (Copy is saved) |
lv_dropdown_set_text_static
Set text of the drop-down list's button. If set to NULL the selected option's text will be displayed on the button. If set to a specific text then that text will be shown regardless of the selected option.
void lv_dropdown_set_text_static(lv_obj_t *obj, const char *text)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a drop-down list object |
text | const char * | the text as a string (Only its pointer is saved) |
lv_dropdown_set_options
Set the options in a drop-down list from a string. The options will be copied and saved in the object so the options can be destroyed after calling this function
void lv_dropdown_set_options(lv_obj_t *obj, const char *options)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to drop-down list object |
options | const char * | a string with '<br/> ' separated options. E.g. "One\nTwo\nThree" |
lv_dropdown_set_options_static
Set the options in a drop-down list from a static string (global, static or dynamically allocated). Only the pointer of the option string will be saved.
void lv_dropdown_set_options_static(lv_obj_t *obj, const char *options)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to drop-down list object |
options | const char * | a static string with '<br/> ' separated options. E.g. "One\nTwo\nThree" |
lv_dropdown_set_selected
Set the selected option
void lv_dropdown_set_selected(lv_obj_t *obj, uint32_t sel_opt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to drop-down list object |
sel_opt | uint32_t | id of the selected option (0 ... number of option - 1); |
lv_dropdown_set_dir
Set the direction of the a drop-down list
void lv_dropdown_set_dir(lv_obj_t *obj, lv_dir_t dir)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a drop-down list object |
dir | lv_dir_t | LV_DIR_LEFT/RIGHT/TOP/BOTTOM |
lv_dropdown_set_symbol
Set an arrow or other symbol to display when on drop-down list's button. Typically a down caret or arrow.
void lv_dropdown_set_symbol(lv_obj_t *obj, const void *symbol)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to drop-down list object |
symbol | const void * | a text like LV_SYMBOL_DOWN, an image (pointer or path) or NULL to not draw symbol icon |
angle and zoom transformation can be applied if the symbol is an image. E.g. when drop down is checked (opened) rotate the symbol by 180 degree
lv_dropdown_set_selected_highlight
Set whether the selected option in the list should be highlighted or not
void lv_dropdown_set_selected_highlight(lv_obj_t *obj, bool en)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to drop-down list object |
en | bool | true: highlight enabled; false: disabled |
Enums
_lv_property_dropdown_id_t
| Name | Value |
|---|---|
LV_PROPERTY_DROPDOWN_TEXT | (LV_PROPERTY_DROPDOWN_START + ((int) 0 )) | (( 7 ) << 28 ) |
LV_PROPERTY_DROPDOWN_OPTIONS | (LV_PROPERTY_DROPDOWN_START + ((int) 1 )) | (( 7 ) << 28 ) |
LV_PROPERTY_DROPDOWN_OPTION_COUNT | (LV_PROPERTY_DROPDOWN_START + ((int) 2 )) | (( 1 ) << 28 ) |
LV_PROPERTY_DROPDOWN_SELECTED | (LV_PROPERTY_DROPDOWN_START + ((int) 3 )) | (( 1 ) << 28 ) |
LV_PROPERTY_DROPDOWN_DIR | (LV_PROPERTY_DROPDOWN_START + ((int) 5 )) | (( 1 ) << 28 ) |
LV_PROPERTY_DROPDOWN_SYMBOL | (LV_PROPERTY_DROPDOWN_START + ((int) 6 )) | (( 6 ) << 28 ) |
LV_PROPERTY_DROPDOWN_SELECTED_HIGHLIGHT | (LV_PROPERTY_DROPDOWN_START + ((int) 7 )) | (( 1 ) << 28 ) |
LV_PROPERTY_DROPDOWN_LIST | (LV_PROPERTY_DROPDOWN_START + ((int) 8 )) | (( 8 ) << 28 ) |
LV_PROPERTY_DROPDOWN_IS_OPEN | (LV_PROPERTY_DROPDOWN_START + ((int) 9 )) | (( 11 ) << 28 ) |
LV_PROPERTY_DROPDOWN_END |
Macros
LV_DROPDOWN_POS_LAST
#define LV_DROPDOWN_POS_LAST 0xFFFFVariables
lv_dropdown_class
const lv_obj_class_t lv_dropdown_classlv_dropdownlist_class
const lv_obj_class_t lv_dropdownlist_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_kconfig.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_ll.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_observer.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_style_properties.hlv_symbol_def.hlv_text.hlv_tick.hlv_timer.hlv_types.h
How is this guide?
Last updated on