1 #include "../../lv_examples.h"
2 #if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
3
4 /**
5 * Create a drop down, up, left and right menus
6 */
lv_example_dropdown_2(void)7 void lv_example_dropdown_2(void)
8 {
9 static const char * opts = "Apple\n"
10 "Banana\n"
11 "Orange\n"
12 "Melon";
13
14 lv_obj_t * dd;
15 dd = lv_dropdown_create(lv_scr_act());
16 lv_dropdown_set_options_static(dd, opts);
17 lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 10);
18
19 dd = lv_dropdown_create(lv_scr_act());
20 lv_dropdown_set_options_static(dd, opts);
21 lv_dropdown_set_dir(dd, LV_DIR_BOTTOM);
22 lv_dropdown_set_symbol(dd, LV_SYMBOL_UP);
23 lv_obj_align(dd, LV_ALIGN_BOTTOM_MID, 0, -10);
24
25 dd = lv_dropdown_create(lv_scr_act());
26 lv_dropdown_set_options_static(dd, opts);
27 lv_dropdown_set_dir(dd, LV_DIR_RIGHT);
28 lv_dropdown_set_symbol(dd, LV_SYMBOL_RIGHT);
29 lv_obj_align(dd, LV_ALIGN_LEFT_MID, 10, 0);
30
31 dd = lv_dropdown_create(lv_scr_act());
32 lv_dropdown_set_options_static(dd, opts);
33 lv_dropdown_set_dir(dd, LV_DIR_LEFT);
34 lv_dropdown_set_symbol(dd, LV_SYMBOL_LEFT);
35 lv_obj_align(dd, LV_ALIGN_RIGHT_MID, -10, 0);
36 }
37
38 #endif
39