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