lv_dropdown.h

API reference for lv_dropdown.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_dropdown_private.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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a drop-down list object
textconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a drop-down list object
textconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to drop-down list object
optionsconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to drop-down list object
optionsconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to drop-down list object
sel_optuint32_tid 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a drop-down list object
dirlv_dir_tLV_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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to drop-down list object
symbolconst 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)
Parameters
NameTypeDescription
objlv_obj_t *pointer to drop-down list object
enbooltrue: highlight enabled; false: disabled

Enums

_lv_property_dropdown_id_t

NameValue
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 0xFFFF

Variables

lv_dropdown_class

 
const lv_obj_class_t lv_dropdown_class

lv_dropdownlist_class

 
const lv_obj_class_t lv_dropdownlist_class

Dependencies

How is this guide?

Last updated on

On this page