Home
last modified time | relevance | path

Searched refs:btn (Results 1 – 25 of 64) sorted by relevance

123

/lvgl-latest/examples/styles/
Dlv_example_style_15.c9 lv_obj_t * btn; in lv_example_style_15() local
13 btn = lv_button_create(lv_screen_active()); in lv_example_style_15()
14 lv_obj_set_size(btn, 100, 40); in lv_example_style_15()
15 lv_obj_align(btn, LV_ALIGN_CENTER, 0, -70); in lv_example_style_15()
17 label = lv_label_create(btn); in lv_example_style_15()
23 btn = lv_button_create(lv_screen_active()); in lv_example_style_15()
24 lv_obj_set_size(btn, 100, 40); in lv_example_style_15()
25 lv_obj_set_style_opa(btn, LV_OPA_50, 0); in lv_example_style_15()
26 lv_obj_align(btn, LV_ALIGN_CENTER, 0, 0); in lv_example_style_15()
28 label = lv_label_create(btn); in lv_example_style_15()
[all …]
Dlv_example_style_18.c38 lv_obj_t * btn; in lv_example_style_18() local
42 btn = lv_button_create(lv_screen_active()); in lv_example_style_18()
43 lv_obj_set_style_bg_color(btn, grad_colors[0], 0); in lv_example_style_18()
44 lv_obj_set_style_bg_grad_color(btn, grad_colors[1], 0); in lv_example_style_18()
45 lv_obj_set_style_bg_grad_dir(btn, LV_GRAD_DIR_HOR, 0); in lv_example_style_18()
46 lv_obj_set_size(btn, 150, 50); in lv_example_style_18()
47 lv_obj_align(btn, LV_ALIGN_CENTER, 0, -100); in lv_example_style_18()
49 label = lv_label_create(btn); in lv_example_style_18()
54 btn = lv_button_create(lv_screen_active()); in lv_example_style_18()
55 lv_obj_set_style_bg_color(btn, grad_colors[0], 0); in lv_example_style_18()
[all …]
Dlv_example_style_14.c44 lv_obj_t * btn; in lv_example_style_14() local
47 btn = lv_button_create(lv_screen_active()); in lv_example_style_14()
48 lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 20); in lv_example_style_14()
50 label = lv_label_create(btn); in lv_example_style_14()
55 btn = lv_button_create(lv_screen_active()); in lv_example_style_14()
56 lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -20); in lv_example_style_14()
58 label = lv_label_create(btn); in lv_example_style_14()
/lvgl-latest/examples/widgets/list/
Dlv_example_list_1.c22 lv_obj_t * btn; in lv_example_list_1() local
24 btn = lv_list_add_button(list1, LV_SYMBOL_FILE, "New"); in lv_example_list_1()
25 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_list_1()
26 btn = lv_list_add_button(list1, LV_SYMBOL_DIRECTORY, "Open"); in lv_example_list_1()
27 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_list_1()
28 btn = lv_list_add_button(list1, LV_SYMBOL_SAVE, "Save"); in lv_example_list_1()
29 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_list_1()
30 btn = lv_list_add_button(list1, LV_SYMBOL_CLOSE, "Delete"); in lv_example_list_1()
31 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_list_1()
32 btn = lv_list_add_button(list1, LV_SYMBOL_EDIT, "Edit"); in lv_example_list_1()
[all …]
Dlv_example_list_2.c120 lv_obj_t * btn; in lv_example_list_2() local
123 btn = lv_button_create(list1); in lv_example_list_2()
124 lv_obj_set_width(btn, lv_pct(50)); in lv_example_list_2()
125 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_list_2()
127 lv_obj_t * lab = lv_label_create(btn); in lv_example_list_2()
141 btn = lv_list_add_button(list2, NULL, "Top"); in lv_example_list_2()
142 lv_obj_add_event_cb(btn, event_handler_top, LV_EVENT_ALL, NULL); in lv_example_list_2()
143 lv_group_remove_obj(btn); in lv_example_list_2()
145 btn = lv_list_add_button(list2, LV_SYMBOL_UP, "Up"); in lv_example_list_2()
146 lv_obj_add_event_cb(btn, event_handler_up, LV_EVENT_ALL, NULL); in lv_example_list_2()
[all …]
/lvgl-latest/tests/src/test_cases/xml/
Dtest_xml_general.c215 lv_obj_t * btn = lv_xml_create(lv_screen_active(), "my_btn", NULL); in test_xml_component_styles() local
216 lv_obj_set_pos(btn, 0, 100); in test_xml_component_styles()
217 lv_obj_add_state(btn, LV_STATE_CHECKED); in test_xml_component_styles()
247 lv_obj_t * btn = lv_xml_create(lv_screen_active(), "my_btn", NULL); in test_xml_error_resilience_syntax_ok() local
248 if(btn) lv_obj_set_pos(btn, 0, 100); in test_xml_error_resilience_syntax_ok()
276 lv_obj_t * btn; in test_xml_image_and_font() local
277 btn = lv_xml_create(lv_screen_active(), "btn", NULL); in test_xml_image_and_font()
279 btn = lv_xml_create(lv_screen_active(), "btn", NULL); in test_xml_image_and_font()
280 lv_obj_set_pos(btn, 0, 100); in test_xml_image_and_font()
281 lv_obj_add_state(btn, LV_STATE_CHECKED); in test_xml_image_and_font()
[all …]
/lvgl-latest/examples/event/
Dlv_example_event_streak.c16 lv_obj_t * btn = lv_event_get_target(e); in streak_event_cb() local
17 lv_obj_t * label = lv_obj_get_child(btn, 0); in streak_event_cb()
27 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_event_streak() local
28 lv_obj_set_size(btn, 100, 50); in lv_example_event_streak()
29 lv_obj_center(btn); in lv_example_event_streak()
30 lv_obj_add_event_cb(btn, short_click_event_cb, LV_EVENT_SHORT_CLICKED, info_label); in lv_example_event_streak()
31 lv_obj_add_event_cb(btn, streak_event_cb, LV_EVENT_SINGLE_CLICKED, "Single clicked"); in lv_example_event_streak()
32 lv_obj_add_event_cb(btn, streak_event_cb, LV_EVENT_DOUBLE_CLICKED, "Double clicked"); in lv_example_event_streak()
33 lv_obj_add_event_cb(btn, streak_event_cb, LV_EVENT_TRIPLE_CLICKED, "Triple clicked"); in lv_example_event_streak()
35 lv_obj_t * label = lv_label_create(btn); in lv_example_event_streak()
Dlv_example_event_click.c9 lv_obj_t * btn = lv_event_get_target(e); in event_cb() local
10 lv_obj_t * label = lv_obj_get_child(btn, 0); in event_cb()
20 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_event_click() local
21 lv_obj_set_size(btn, 100, 50); in lv_example_event_click()
22 lv_obj_center(btn); in lv_example_event_click()
23 lv_obj_add_event_cb(btn, event_cb, LV_EVENT_CLICKED, NULL); in lv_example_event_click()
25 lv_obj_t * label = lv_label_create(btn); in lv_example_event_click()
Dlv_example_event_button.c32 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_event_button() local
33 lv_obj_set_size(btn, 100, 50); in lv_example_event_button()
34 lv_obj_center(btn); in lv_example_event_button()
36 lv_obj_t * btn_label = lv_label_create(btn); in lv_example_event_button()
43 lv_obj_add_event_cb(btn, event_cb, LV_EVENT_ALL, info_label); in lv_example_event_button()
/lvgl-latest/examples/others/gridnav/
Dlv_example_gridnav_3.c36 lv_obj_t * btn; in lv_example_gridnav_3() local
39 btn = lv_button_create(cont_main); in lv_example_gridnav_3()
40 lv_group_remove_obj(btn); in lv_example_gridnav_3()
41 label = lv_label_create(btn); in lv_example_gridnav_3()
44 btn = lv_button_create(cont_main); in lv_example_gridnav_3()
45 lv_group_remove_obj(btn); in lv_example_gridnav_3()
46 label = lv_label_create(btn); in lv_example_gridnav_3()
85 btn = lv_button_create(cont_sub2); in lv_example_gridnav_3()
86 lv_group_remove_obj(btn); in lv_example_gridnav_3()
87 label = lv_label_create(btn); in lv_example_gridnav_3()
[all …]
/lvgl-latest/examples/widgets/spinbox/
Dlv_example_spinbox_1.c33 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_spinbox_1() local
34 lv_obj_set_size(btn, h, h); in lv_example_spinbox_1()
35 lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_RIGHT_MID, 5, 0); in lv_example_spinbox_1()
36 lv_obj_set_style_bg_image_src(btn, LV_SYMBOL_PLUS, 0); in lv_example_spinbox_1()
37 lv_obj_add_event_cb(btn, lv_spinbox_increment_event_cb, LV_EVENT_ALL, NULL); in lv_example_spinbox_1()
39 btn = lv_button_create(lv_screen_active()); in lv_example_spinbox_1()
40 lv_obj_set_size(btn, h, h); in lv_example_spinbox_1()
41 lv_obj_align_to(btn, spinbox, LV_ALIGN_OUT_LEFT_MID, -5, 0); in lv_example_spinbox_1()
42 lv_obj_set_style_bg_image_src(btn, LV_SYMBOL_MINUS, 0); in lv_example_spinbox_1()
43 lv_obj_add_event_cb(btn, lv_spinbox_decrement_event_cb, LV_EVENT_ALL, NULL); in lv_example_spinbox_1()
/lvgl-latest/demos/music/
Dlv_demo_music_list.c156 lv_obj_t * btn = lv_obj_get_child(list, track_id); in lv_demo_music_list_button_check() local
157 lv_obj_t * icon = lv_obj_get_child(btn, 0); in lv_demo_music_list_button_check()
160 lv_obj_add_state(btn, LV_STATE_CHECKED); in lv_demo_music_list_button_check()
162 lv_obj_scroll_to_view(btn, LV_ANIM_ON); in lv_demo_music_list_button_check()
165 lv_obj_remove_state(btn, LV_STATE_CHECKED); in lv_demo_music_list_button_check()
182 lv_obj_t * btn = lv_obj_create(parent); in add_list_button() local
183 lv_obj_remove_style_all(btn); in add_list_button()
185 lv_obj_set_size(btn, lv_pct(100), 110); in add_list_button()
187 lv_obj_set_size(btn, lv_pct(100), 60); in add_list_button()
190 lv_obj_add_style(btn, &style_btn, 0); in add_list_button()
[all …]
/lvgl-latest/examples/others/observer/
Dlv_example_observer_2.c109 lv_obj_t * btn; in ui_init() local
113 btn = lv_button_create(lv_screen_active()); in ui_init()
114 lv_obj_set_pos(btn, 220, 10); in ui_init()
115 lv_obj_add_event_cb(btn, log_out_click_event_cb, LV_EVENT_CLICKED, NULL); in ui_init()
116 lv_obj_bind_state_if_not_eq(btn, &auth_state_subject, LV_STATE_DISABLED, LOGGED_IN); in ui_init()
118 label = lv_label_create(btn); in ui_init()
127 btn = lv_button_create(lv_screen_active()); in ui_init()
128 lv_obj_set_pos(btn, 10, 80); in ui_init()
129 lv_obj_add_flag(btn, LV_OBJ_FLAG_CHECKABLE); in ui_init()
130 lv_obj_bind_state_if_not_eq(btn, &auth_state_subject, LV_STATE_DISABLED, LOGGED_IN); in ui_init()
[all …]
Dlv_example_observer_5.c36 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_observer_5() local
37 lv_obj_add_event_cb(btn, fw_update_btn_clicked_event_cb, LV_EVENT_CLICKED, NULL); in lv_example_observer_5()
38 lv_obj_center(btn); in lv_example_observer_5()
39 lv_obj_t * label = lv_label_create(btn); in lv_example_observer_5()
55 lv_obj_t * btn = lv_win_add_button(win, LV_SYMBOL_CLOSE, 40); in fw_update_btn_clicked_event_cb() local
56 lv_obj_add_event_cb(btn, fw_update_close_event_cb, LV_EVENT_CLICKED, NULL); in fw_update_btn_clicked_event_cb()
111 lv_obj_t * btn = lv_button_create(cont); in fw_update_win_observer_cb() local
112 lv_obj_align(btn, LV_ALIGN_CENTER, 0, 20); in fw_update_win_observer_cb()
113 lv_obj_add_event_cb(btn, restart_btn_click_event_cb, LV_EVENT_CLICKED, win); in fw_update_win_observer_cb()
115 label = lv_label_create(btn); in fw_update_win_observer_cb()
Dlv_example_observer_4.c154 lv_obj_t * btn = lv_button_create(parent); in btn_create() local
155 lv_obj_set_flex_grow(btn, 1); in btn_create()
156 lv_obj_set_height(btn, lv_pct(100)); in btn_create()
157 lv_obj_set_style_radius(btn, 0, 0); in btn_create()
158 lv_subject_add_observer_obj(&current_tab_subject, btn_observer_cb, btn, NULL); in btn_create()
159 lv_obj_add_event_cb(btn, btn_click_event_cb, LV_EVENT_CLICKED, NULL); in btn_create()
161 lv_obj_t * label = lv_label_create(btn); in btn_create()
168 lv_obj_t * btn = lv_event_get_target(e); in btn_click_event_cb() local
169 uint32_t idx = lv_obj_get_index(btn); in btn_click_event_cb()
178 lv_obj_t * btn = lv_observer_get_target(observer); in btn_observer_cb() local
[all …]
/lvgl-latest/examples/get_started/
Dlv_example_get_started_2.c7 lv_obj_t * btn = lv_event_get_target(e); in btn_event_cb() local
13 lv_obj_t * label = lv_obj_get_child(btn, 0); in btn_event_cb()
23 lv_obj_t * btn = lv_button_create(lv_screen_active()); /*Add a button the current screen*/ in lv_example_get_started_2() local
24 lv_obj_set_pos(btn, 10, 10); /*Set its position*/ in lv_example_get_started_2()
25 lv_obj_set_size(btn, 120, 50); /*Set its size*/ in lv_example_get_started_2()
26 …lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_ALL, NULL); /*Assign a callback to the b… in lv_example_get_started_2()
28 lv_obj_t * label = lv_label_create(btn); /*Add a label to the button*/ in lv_example_get_started_2()
Dlv_example_get_started_3.c53 lv_obj_t * btn = lv_button_create(lv_screen_active()); in lv_example_get_started_3() local
57 lv_obj_remove_style_all(btn); in lv_example_get_started_3()
58 lv_obj_set_pos(btn, 10, 10); in lv_example_get_started_3()
59 lv_obj_set_size(btn, 120, 50); in lv_example_get_started_3()
60 lv_obj_add_style(btn, &style_btn, 0); in lv_example_get_started_3()
61 lv_obj_add_style(btn, &style_button_pressed, LV_STATE_PRESSED); in lv_example_get_started_3()
64 lv_obj_t * label = lv_label_create(btn); in lv_example_get_started_3()
/lvgl-latest/examples/widgets/msgbox/
Dlv_example_msgbox_1.c6 lv_obj_t * btn = lv_event_get_target(e); in event_cb() local
7 lv_obj_t * label = lv_obj_get_child(btn, 0); in event_cb()
21 lv_obj_t * btn; in lv_example_msgbox_1() local
22 btn = lv_msgbox_add_footer_button(mbox1, "Apply"); in lv_example_msgbox_1()
23 lv_obj_add_event_cb(btn, event_cb, LV_EVENT_CLICKED, NULL); in lv_example_msgbox_1()
24 btn = lv_msgbox_add_footer_button(mbox1, "Cancel"); in lv_example_msgbox_1()
25 lv_obj_add_event_cb(btn, event_cb, LV_EVENT_CLICKED, NULL); in lv_example_msgbox_1()
/lvgl-latest/tests/src/test_cases/widgets/
Dtest_win.c106 lv_obj_t * btn = lv_obj_get_child(header, 0); in test_win_add_button() local
107 TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn)); in test_win_add_button()
108 TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn)); in test_win_add_button()
116 lv_obj_t * btn; in test_win_add_multiple_elements() local
138 btn = lv_obj_get_child(header, 0); in test_win_add_multiple_elements()
139 TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn)); in test_win_add_multiple_elements()
140 TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn)); in test_win_add_multiple_elements()
148 btn = lv_obj_get_child(header, 2); in test_win_add_multiple_elements()
149 TEST_ASSERT_EQUAL(1, lv_obj_get_child_count(btn)); in test_win_add_multiple_elements()
150 TEST_ASSERT_EQUAL(win_button_width, lv_obj_get_width(btn)); in test_win_add_multiple_elements()
[all …]
Dtest_btn.c21 lv_obj_t * btn; in test_button_creation() local
22 btn = lv_button_create(active_screen); in test_button_creation()
23 TEST_ASSERT_NOT_NULL(btn); in test_button_creation()
25 TEST_ASSERT_TRUE(lv_obj_has_flag(btn, LV_OBJ_FLAG_SCROLL_ON_FOCUS)); in test_button_creation()
26 TEST_ASSERT_FALSE(lv_obj_has_flag(btn, LV_OBJ_FLAG_SCROLLABLE)); in test_button_creation()
/lvgl-latest/examples/widgets/win/
Dlv_example_win_1.c14 lv_obj_t * btn; in lv_example_win_1() local
15 btn = lv_win_add_button(win, LV_SYMBOL_LEFT, 40); in lv_example_win_1()
16 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_win_1()
20 btn = lv_win_add_button(win, LV_SYMBOL_RIGHT, 40); in lv_example_win_1()
21 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_win_1()
23 btn = lv_win_add_button(win, LV_SYMBOL_CLOSE, 60); in lv_example_win_1()
24 lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL); in lv_example_win_1()
/lvgl-latest/tests/src/test_cases/
Dtest_hover.c68 lv_obj_t * btn = lv_button_create(lv_screen_active()); in test_hover_basic() local
69 lv_obj_set_pos(btn, 64, 100); in test_hover_basic()
70 lv_obj_set_size(btn, 128, 48); in test_hover_basic()
71 lv_obj_set_style_bg_opa(btn, 128, LV_PART_MAIN | LV_STATE_HOVERED); in test_hover_basic()
74 lv_obj_stringify_id(btn, btn_hovered.id, sizeof(btn_hovered.id)); in test_hover_basic()
76 lv_obj_add_event_cb(btn, hovered_event_cb, LV_EVENT_HOVER_OVER, &btn_hovered); in test_hover_basic()
85 lv_obj_t * btn = lv_button_create(lv_screen_active()); in test_hover_delete() local
86 lv_obj_set_size(btn, 200, 100); in test_hover_delete()
91 lv_obj_delete(btn); /*No crash while deleting the hovered button*/ in test_hover_delete()
/lvgl-latest/demos/flex_layout/
Dlv_demo_flex_layout_view.c100 ui->ctrl_pad.btn.cont = obj; in view_create()
101 ui->ctrl_pad.btn.add = btn_create(obj, "Add", lv_palette_main(LV_PALETTE_BLUE_GREY)); in view_create()
102 ui->ctrl_pad.btn.remove = btn_create(obj, "Remove", lv_palette_main(LV_PALETTE_RED)); in view_create()
117 lv_obj_t * btn = lv_button_create(par); in btn_create() local
118 lv_obj_set_width(btn, lv_pct(30)); in btn_create()
119 lv_obj_set_height(btn, 30); in btn_create()
120 lv_obj_set_style_border_width(btn, 0, LV_PART_MAIN); in btn_create()
121 lv_obj_set_style_bg_color(btn, color, LV_PART_MAIN); in btn_create()
122 lv_obj_set_style_radius(btn, 5, LV_PART_MAIN); in btn_create()
124 lv_obj_t * label = lv_label_create(btn); in btn_create()
[all …]
/lvgl-latest/src/widgets/msgbox/
Dlv_msgbox.c173 lv_obj_t * btn = lv_obj_class_create_obj(&lv_msgbox_header_button_class, mbox->header); in lv_msgbox_add_header_button() local
175 if(btn == NULL) return NULL; in lv_msgbox_add_header_button()
176 lv_obj_class_init_obj(btn); in lv_msgbox_add_header_button()
177 lv_obj_remove_flag(btn, LV_OBJ_FLAG_SCROLLABLE); in lv_msgbox_add_header_button()
180 lv_obj_t * img = lv_image_create(btn); in lv_msgbox_add_header_button()
185 return btn; in lv_msgbox_add_header_button()
213 lv_obj_t * btn = lv_obj_class_create_obj(&lv_msgbox_footer_button_class, mbox->footer); in lv_msgbox_add_footer_button() local
215 if(btn == NULL) return NULL; in lv_msgbox_add_footer_button()
216 lv_obj_class_init_obj(btn); in lv_msgbox_add_footer_button()
217 lv_obj_remove_flag(btn, LV_OBJ_FLAG_SCROLLABLE); in lv_msgbox_add_footer_button()
[all …]
/lvgl-latest/examples/others/file_explorer/
Dlv_example_file_explorer_2.c26 lv_obj_t * btn = lv_event_get_target(e); in btn_event_handler() local
30 if(lv_obj_has_state(btn, LV_STATE_CHECKED)) in btn_event_handler()
121 lv_obj_t * btn = lv_button_create(fe_header_obj); in lv_example_file_explorer_2() local
122 lv_obj_set_style_radius(btn, 2, 0); in lv_example_file_explorer_2()
123 lv_obj_set_style_pad_all(btn, 4, 0); in lv_example_file_explorer_2()
124 lv_obj_align(btn, LV_ALIGN_LEFT_MID, 0, 0); in lv_example_file_explorer_2()
125 lv_obj_add_flag(btn, LV_OBJ_FLAG_CHECKABLE); in lv_example_file_explorer_2()
127 lv_obj_t * label = lv_label_create(btn); in lv_example_file_explorer_2()
131 lv_obj_add_event_cb(btn, btn_event_handler, LV_EVENT_VALUE_CHANGED, fe_quick_access_obj); in lv_example_file_explorer_2()

123