2021-04-08 13:07:48 +02:00
|
|
|
#include "../../lv_examples.h"
|
2021-02-14 14:56:34 +01:00
|
|
|
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
2021-02-08 09:53:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a drop down, up, left and right menus
|
|
|
|
*/
|
|
|
|
void lv_example_dropdown_2(void)
|
|
|
|
{
|
|
|
|
static const char * opts = "Apple\n"
|
|
|
|
"Banana\n"
|
|
|
|
"Orange\n"
|
|
|
|
"Melon\n"
|
|
|
|
"Grape\n"
|
|
|
|
"Raspberry";
|
|
|
|
|
|
|
|
lv_obj_t * dd;
|
2021-03-25 13:36:50 +01:00
|
|
|
dd = lv_dropdown_create(lv_scr_act());
|
2021-02-08 09:53:03 +01:00
|
|
|
lv_dropdown_set_options_static(dd, opts);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 10);
|
2021-02-08 09:53:03 +01:00
|
|
|
|
2021-03-25 13:36:50 +01:00
|
|
|
dd = lv_dropdown_create(lv_scr_act());
|
2021-02-08 09:53:03 +01:00
|
|
|
lv_dropdown_set_options_static(dd, opts);
|
|
|
|
lv_dropdown_set_dir(dd, LV_DIR_BOTTOM);
|
|
|
|
lv_dropdown_set_symbol(dd, LV_SYMBOL_UP);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_align(dd, LV_ALIGN_BOTTOM_MID, 0, -10);
|
2021-02-08 09:53:03 +01:00
|
|
|
|
2021-03-25 13:36:50 +01:00
|
|
|
dd = lv_dropdown_create(lv_scr_act());
|
2021-02-08 09:53:03 +01:00
|
|
|
lv_dropdown_set_options_static(dd, opts);
|
|
|
|
lv_dropdown_set_dir(dd, LV_DIR_RIGHT);
|
|
|
|
lv_dropdown_set_symbol(dd, LV_SYMBOL_RIGHT);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_align(dd, LV_ALIGN_LEFT_MID, 10, 0);
|
2021-02-08 09:53:03 +01:00
|
|
|
|
2021-03-25 13:36:50 +01:00
|
|
|
dd = lv_dropdown_create(lv_scr_act());
|
2021-02-08 09:53:03 +01:00
|
|
|
lv_dropdown_set_options_static(dd, opts);
|
|
|
|
lv_dropdown_set_dir(dd, LV_DIR_LEFT);
|
|
|
|
lv_dropdown_set_symbol(dd, LV_SYMBOL_LEFT);
|
2021-03-25 16:14:17 +01:00
|
|
|
lv_obj_align(dd, LV_ALIGN_RIGHT_MID, -10, 0);
|
2021-02-08 09:53:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|