refactor(event): add _cb postfix to lv_obj_add_event()
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
} while(0)
|
||||
|
||||
#define SPINBOX_EVENT_ATTACH(item) \
|
||||
lv_obj_add_event(ui->ctrl_pad.tab.layout.spinbox_##item, ctrl_pad_spinbox_event_handler, LV_EVENT_VALUE_CHANGED, ui);
|
||||
lv_obj_add_event_cb(ui->ctrl_pad.tab.layout.spinbox_##item, ctrl_pad_spinbox_event_handler, LV_EVENT_VALUE_CHANGED, ui);
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@@ -64,7 +64,7 @@ void ctrl_pad_attach(view_t * ui)
|
||||
SPINBOX_EVENT_ATTACH(pad_row);
|
||||
SPINBOX_EVENT_ATTACH(flex_grow);
|
||||
|
||||
lv_obj_add_event(
|
||||
lv_obj_add_event_cb(
|
||||
ui->ctrl_pad.tab.flex.checkbox_scrl,
|
||||
ctrl_pad_checkbox_event_handler,
|
||||
LV_EVENT_VALUE_CHANGED,
|
||||
@@ -150,14 +150,14 @@ static void ctrl_pad_checkbox_event_handler(lv_event_t * e)
|
||||
|
||||
static void ctrl_pad_btn_event_attach(view_t * ui)
|
||||
{
|
||||
lv_obj_add_event(
|
||||
lv_obj_add_event_cb(
|
||||
ui->ctrl_pad.btn.add,
|
||||
ctrl_pad_btn_add_event_handler,
|
||||
LV_EVENT_CLICKED,
|
||||
ui
|
||||
);
|
||||
|
||||
lv_obj_add_event(
|
||||
lv_obj_add_event_cb(
|
||||
ui->ctrl_pad.btn.remove,
|
||||
ctrl_pad_btn_remove_event_handler,
|
||||
LV_EVENT_CLICKED,
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
|
||||
#define FLEX_ALIGN_EVENT_ATTACH(item) \
|
||||
do { \
|
||||
lv_obj_add_event(ui->ctrl_pad.tab.align.ddlist_align_##item, \
|
||||
flex_align_##item##_event_handler, \
|
||||
LV_EVENT_VALUE_CHANGED, \
|
||||
ui \
|
||||
); \
|
||||
lv_obj_add_event_cb(ui->ctrl_pad.tab.align.ddlist_align_##item, \
|
||||
flex_align_##item##_event_handler, \
|
||||
LV_EVENT_VALUE_CHANGED, \
|
||||
ui \
|
||||
); \
|
||||
} while(0)
|
||||
|
||||
/**********************
|
||||
@@ -96,7 +96,7 @@ FLEX_ALIGN_EVENT_DEF(track)
|
||||
|
||||
void flex_loader_attach(view_t * ui)
|
||||
{
|
||||
lv_obj_add_event(
|
||||
lv_obj_add_event_cb(
|
||||
ui->ctrl_pad.tab.flex.ddlist_flow,
|
||||
flex_flow_event_handler,
|
||||
LV_EVENT_VALUE_CHANGED,
|
||||
|
||||
@@ -54,7 +54,7 @@ lv_obj_t * obj_child_node_create(lv_obj_t * par, view_t * ui)
|
||||
lv_obj_add_flag(label, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING);
|
||||
lv_obj_center(label);
|
||||
|
||||
lv_obj_add_event(obj, obj_child_node_event_handler, LV_EVENT_CLICKED, ui);
|
||||
lv_obj_add_event_cb(obj, obj_child_node_event_handler, LV_EVENT_CLICKED, ui);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -216,8 +216,8 @@ static lv_obj_t * spinbox_ctrl_create(lv_obj_t * par, lv_style_prop_t prop, lv_o
|
||||
lv_label_set_text(label, "+");
|
||||
lv_obj_center(label);
|
||||
|
||||
lv_obj_add_event(btn_inc, btn_inc_event_handler, LV_EVENT_ALL, spinbox);
|
||||
lv_obj_add_event(btn_dec, btn_dec_event_handler, LV_EVENT_ALL, spinbox);
|
||||
lv_obj_add_event_cb(btn_inc, btn_inc_event_handler, LV_EVENT_ALL, spinbox);
|
||||
lv_obj_add_event_cb(btn_dec, btn_dec_event_handler, LV_EVENT_ALL, spinbox);
|
||||
|
||||
return spinbox;
|
||||
}
|
||||
|
||||
@@ -156,15 +156,15 @@ static void text_input_create(lv_obj_t * parent)
|
||||
lv_obj_t * kb = lv_keyboard_create(lv_screen_active());
|
||||
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
lv_obj_add_event(ta1, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event(ta2, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(ta1, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(ta2, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
}
|
||||
|
||||
static void msgbox_create(void)
|
||||
{
|
||||
static const char * buttons[] = {"Ok", "Cancel", ""};
|
||||
lv_obj_t * mbox = lv_msgbox_create(NULL, "Hi", "Welcome to the keyboard and encoder demo", buttons, false);
|
||||
lv_obj_add_event(mbox, msgbox_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(mbox, msgbox_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_group_focus_obj(lv_msgbox_get_buttons(mbox));
|
||||
lv_obj_add_state(lv_msgbox_get_buttons(mbox), LV_STATE_FOCUS_KEY);
|
||||
lv_group_focus_freeze(g, true);
|
||||
|
||||
@@ -96,15 +96,15 @@ class KeyboardEncoder:
|
||||
self.kb = lv.keyboard(lv.screen_active())
|
||||
self.kb.add_flag(lv.obj.FLAG.HIDDEN)
|
||||
|
||||
ta1.add_event(self.ta_event_cb, lv.EVENT.ALL, None)
|
||||
ta2.add_event(self.ta_event_cb, lv.EVENT.ALL, None)
|
||||
ta1.add_event_cb(self.ta_event_cb, lv.EVENT.ALL, None)
|
||||
ta2.add_event_cb(self.ta_event_cb, lv.EVENT.ALL, None)
|
||||
|
||||
|
||||
def msgbox_create(self):
|
||||
|
||||
buttons = ["Ok", "Cancel", ""]
|
||||
mbox = lv.msgbox(None, "Hi", "Welcome to the keyboard and encoder demo", buttons, False)
|
||||
mbox.add_event(self.msgbox_event_cb, lv.EVENT.ALL, None)
|
||||
mbox.add_event_cb(self.msgbox_event_cb, lv.EVENT.ALL, None)
|
||||
lv.group_focus_obj(mbox.get_buttons())
|
||||
mbox.get_buttons().add_state(lv.STATE.FOCUS_KEY)
|
||||
self.g.focus_freeze(True)
|
||||
|
||||
@@ -295,7 +295,7 @@ static void card_create(lv_obj_t * parent, card_info_t * info)
|
||||
lv_obj_t * cont = lv_obj_create(parent);
|
||||
lv_obj_add_style(cont, &style_card_cont, 0);
|
||||
lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_CENTER);
|
||||
lv_obj_add_event(cont, scroll_event_cb, LV_EVENT_RELEASED, NULL);
|
||||
lv_obj_add_event_cb(cont, scroll_event_cb, LV_EVENT_RELEASED, NULL);
|
||||
lv_obj_remove_flag(cont, LV_OBJ_FLAG_SCROLL_ELASTIC);
|
||||
lv_obj_set_scrollbar_mode(cont, LV_SCROLLBAR_MODE_OFF);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent)
|
||||
|
||||
/*Create an empty transparent container*/
|
||||
list = lv_obj_create(parent);
|
||||
lv_obj_add_event(list, list_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_add_event_cb(list, list_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_remove_style_all(list);
|
||||
lv_obj_set_size(list, LV_HOR_RES, LV_VER_RES - LV_DEMO_MUSIC_HANDLE_SIZE);
|
||||
lv_obj_set_y(list, LV_DEMO_MUSIC_HANDLE_SIZE);
|
||||
@@ -191,7 +191,7 @@ static lv_obj_t * add_list_button(lv_obj_t * parent, uint32_t track_id)
|
||||
lv_obj_add_style(btn, &style_button_pr, LV_STATE_PRESSED);
|
||||
lv_obj_add_style(btn, &style_button_chk, LV_STATE_CHECKED);
|
||||
lv_obj_add_style(btn, &style_button_dis, LV_STATE_DISABLED);
|
||||
lv_obj_add_event(btn, btn_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(btn, btn_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
if(track_id >= 3) {
|
||||
lv_obj_add_state(btn, LV_STATE_DISABLED);
|
||||
|
||||
@@ -545,7 +545,7 @@ static lv_obj_t * create_spectrum_obj(lv_obj_t * parent)
|
||||
lv_obj_set_height(obj, 250);
|
||||
#endif
|
||||
lv_obj_remove_flag(obj, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_add_event(obj, spectrum_draw_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(obj, spectrum_draw_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_refresh_ext_draw_size(obj);
|
||||
album_image_obj = album_image_create(obj);
|
||||
return obj;
|
||||
@@ -585,7 +585,7 @@ static lv_obj_t * create_ctrl_box(lv_obj_t * parent)
|
||||
icon = lv_image_create(cont);
|
||||
lv_image_set_src(icon, &img_lv_demo_music_btn_prev);
|
||||
lv_obj_set_grid_cell(icon, LV_GRID_ALIGN_CENTER, 2, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
lv_obj_add_event(icon, prev_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(icon, prev_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
play_obj = lv_imgbtn_create(cont);
|
||||
lv_imgbtn_set_src(play_obj, LV_IMGBTN_STATE_RELEASED, NULL, &img_lv_demo_music_btn_play, NULL);
|
||||
@@ -593,14 +593,14 @@ static lv_obj_t * create_ctrl_box(lv_obj_t * parent)
|
||||
lv_obj_add_flag(play_obj, LV_OBJ_FLAG_CHECKABLE);
|
||||
lv_obj_set_grid_cell(play_obj, LV_GRID_ALIGN_CENTER, 3, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
|
||||
lv_obj_add_event(play_obj, play_event_click_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(play_obj, play_event_click_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_flag(play_obj, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_set_width(play_obj, img_lv_demo_music_btn_play.header.w);
|
||||
|
||||
icon = lv_image_create(cont);
|
||||
lv_image_set_src(icon, &img_lv_demo_music_btn_next);
|
||||
lv_obj_set_grid_cell(icon, LV_GRID_ALIGN_CENTER, 4, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
lv_obj_add_event(icon, next_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(icon, next_click_event_cb, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_flag(icon, LV_OBJ_FLAG_CLICKABLE);
|
||||
|
||||
LV_IMAGE_DECLARE(img_lv_demo_music_slider_knob);
|
||||
@@ -622,14 +622,14 @@ static lv_obj_t * create_ctrl_box(lv_obj_t * parent)
|
||||
lv_obj_set_style_bg_color(slider_obj, lv_color_hex(0x569af8), LV_PART_INDICATOR);
|
||||
lv_obj_set_style_bg_grad_color(slider_obj, lv_color_hex(0xa666f1), LV_PART_INDICATOR);
|
||||
lv_obj_set_style_outline_width(slider_obj, 0, 0);
|
||||
lv_obj_add_event(slider_obj, del_counter_timer_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_add_event_cb(slider_obj, del_counter_timer_cb, LV_EVENT_DELETE, NULL);
|
||||
|
||||
time_obj = lv_label_create(cont);
|
||||
lv_obj_set_style_text_font(time_obj, font_small, 0);
|
||||
lv_obj_set_style_text_color(time_obj, lv_color_hex(0x8a86b8), 0);
|
||||
lv_label_set_text(time_obj, "0:00");
|
||||
lv_obj_set_grid_cell(time_obj, LV_GRID_ALIGN_END, 5, 1, LV_GRID_ALIGN_CENTER, 1, 1);
|
||||
lv_obj_add_event(time_obj, del_counter_timer_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_add_event_cb(time_obj, del_counter_timer_cb, LV_EVENT_DELETE, NULL);
|
||||
|
||||
return cont;
|
||||
}
|
||||
@@ -959,7 +959,7 @@ static lv_obj_t * album_image_create(lv_obj_t * parent)
|
||||
}
|
||||
lv_image_set_antialias(img, false);
|
||||
lv_obj_align(img, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_add_event(img, album_gesture_event_cb, LV_EVENT_GESTURE, NULL);
|
||||
lv_obj_add_event_cb(img, album_gesture_event_cb, LV_EVENT_GESTURE, NULL);
|
||||
lv_obj_remove_flag(img, LV_OBJ_FLAG_GESTURE_BUBBLE);
|
||||
lv_obj_add_flag(img, LV_OBJ_FLAG_CLICKABLE);
|
||||
|
||||
|
||||
@@ -539,7 +539,7 @@ static lv_obj_t * triangle_obj_create(lv_obj_t * parent, int32_t col, int32_t ro
|
||||
lv_obj_set_size(obj, DEF_WIDTH, DEF_HEIGHT);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex3(0xff0), 0);
|
||||
lv_obj_set_style_opa(obj, opa_saved, 0);
|
||||
lv_obj_add_event(obj, triangle_draw_event_cb, LV_EVENT_DRAW_MAIN, p);
|
||||
lv_obj_add_event_cb(obj, triangle_draw_event_cb, LV_EVENT_DRAW_MAIN, p);
|
||||
add_to_cell(obj, col, row);
|
||||
|
||||
return obj;
|
||||
|
||||
@@ -87,7 +87,7 @@ static lv_obj_t * switch_create(lv_obj_t * parent, const char * title, lv_obj_fl
|
||||
lv_obj_set_flex_grow(label, 1);
|
||||
|
||||
lv_obj_t * sw = lv_switch_create(cont);
|
||||
lv_obj_add_event(sw, generic_switch_event_cb, LV_EVENT_VALUE_CHANGED, (void *)((lv_uintptr_t) flag));
|
||||
lv_obj_add_event_cb(sw, generic_switch_event_cb, LV_EVENT_VALUE_CHANGED, (void *)((lv_uintptr_t) flag));
|
||||
if(en) {
|
||||
lv_obj_add_state(sw, LV_STATE_CHECKED);
|
||||
lv_obj_add_flag(list, flag);
|
||||
|
||||
@@ -96,14 +96,14 @@ void lv_demo_transform(void)
|
||||
lv_obj_set_size(arc, disp_w - 20, disp_w - 20);
|
||||
lv_arc_set_range(arc, 0, 270);
|
||||
lv_arc_set_value(arc, 225);
|
||||
lv_obj_add_event(arc, arc_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_obj_add_event_cb(arc, arc_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_obj_add_flag(arc, LV_OBJ_FLAG_ADV_HITTEST);
|
||||
lv_obj_center(arc);
|
||||
|
||||
lv_obj_t * slider = lv_slider_create(lv_screen_active());
|
||||
lv_obj_set_width(slider, lv_pct(70));
|
||||
lv_obj_align(slider, LV_ALIGN_BOTTOM_MID, 0, -20);
|
||||
lv_obj_add_event(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_slider_set_range(slider, 128, 300);
|
||||
lv_slider_set_value(slider, 256, LV_ANIM_OFF);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void lv_demo_widgets(void)
|
||||
|
||||
tv = lv_tabview_create(lv_screen_active());
|
||||
lv_tabview_set_tab_bar_size(tv, tab_h);
|
||||
lv_obj_add_event(tv, tabview_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_add_event_cb(tv, tabview_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
|
||||
lv_obj_set_style_text_font(lv_screen_active(), font_normal, 0);
|
||||
|
||||
@@ -308,7 +308,7 @@ static void profile_create(lv_obj_t * parent)
|
||||
lv_obj_t * user_name = lv_textarea_create(panel2);
|
||||
lv_textarea_set_one_line(user_name, true);
|
||||
lv_textarea_set_placeholder_text(user_name, "Your name");
|
||||
lv_obj_add_event(user_name, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(user_name, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
|
||||
lv_obj_t * password_label = lv_label_create(panel2);
|
||||
lv_label_set_text(password_label, "Password");
|
||||
@@ -318,7 +318,7 @@ static void profile_create(lv_obj_t * parent)
|
||||
lv_textarea_set_one_line(password, true);
|
||||
lv_textarea_set_password_mode(password, true);
|
||||
lv_textarea_set_placeholder_text(password, "Min. 8 chars.");
|
||||
lv_obj_add_event(password, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(password, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
|
||||
lv_obj_t * gender_label = lv_label_create(panel2);
|
||||
lv_label_set_text(gender_label, "Gender");
|
||||
@@ -333,7 +333,7 @@ static void profile_create(lv_obj_t * parent)
|
||||
|
||||
lv_obj_t * birthdate = lv_textarea_create(panel2);
|
||||
lv_textarea_set_one_line(birthdate, true);
|
||||
lv_obj_add_event(birthdate, birthday_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(birthdate, birthday_event_cb, LV_EVENT_ALL, NULL);
|
||||
|
||||
/*Create the third panel*/
|
||||
lv_obj_t * panel3 = lv_obj_create(parent);
|
||||
@@ -347,7 +347,7 @@ static void profile_create(lv_obj_t * parent)
|
||||
|
||||
lv_obj_t * slider1 = lv_slider_create(panel3);
|
||||
lv_obj_set_width(slider1, LV_PCT(95));
|
||||
lv_obj_add_event(slider1, slider_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(slider1, slider_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_flag(slider1, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS);
|
||||
lv_obj_refresh_ext_draw_size(slider1);
|
||||
|
||||
@@ -597,7 +597,7 @@ static lv_obj_t * create_chart_with_scales(lv_obj_t * parent, const char * title
|
||||
lv_chart_set_point_count(chart, 12);
|
||||
lv_obj_set_grid_cell(chart, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_STRETCH, 0, 1);
|
||||
lv_obj_set_style_border_width(chart, 0, 0);
|
||||
lv_obj_add_event(chart, chart_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(chart, chart_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_set_width(chart, lv_pct(200));
|
||||
lv_obj_set_style_radius(chart, 0, 0);
|
||||
|
||||
@@ -774,7 +774,7 @@ static void analytics_create(lv_obj_t * parent)
|
||||
lv_obj_center(arc);
|
||||
|
||||
lv_timer_t * scale2_timer = lv_timer_create(scale2_timer_cb, 100, scale2);
|
||||
lv_obj_add_event(scale2, delete_timer_event_cb, LV_EVENT_DELETE, scale2_timer);
|
||||
lv_obj_add_event_cb(scale2, delete_timer_event_cb, LV_EVENT_DELETE, scale2_timer);
|
||||
|
||||
/*Scale 3*/
|
||||
lv_scale_set_range(scale3, 10, 60);
|
||||
@@ -820,7 +820,7 @@ static void analytics_create(lv_obj_t * parent)
|
||||
lv_style_set_line_width(&scale3_section3_tick_style, 4);
|
||||
lv_style_set_line_color(&scale3_section3_tick_style, lv_palette_darken(LV_PALETTE_GREEN, 2));
|
||||
|
||||
lv_obj_add_event(scale3, scale3_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
lv_obj_add_event_cb(scale3, scale3_delete_event_cb, LV_EVENT_DELETE, NULL);
|
||||
|
||||
lv_scale_section_t * section;
|
||||
section = lv_scale_add_section(scale3);
|
||||
@@ -896,7 +896,7 @@ void shop_create(lv_obj_t * parent)
|
||||
lv_chart_set_type(chart3, LV_CHART_TYPE_BAR);
|
||||
lv_chart_set_div_line_count(chart3, 6, 0);
|
||||
lv_chart_set_point_count(chart3, 7);
|
||||
lv_obj_add_event(chart3, shop_chart_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(chart3, shop_chart_event_cb, LV_EVENT_ALL, NULL);
|
||||
|
||||
ser4 = lv_chart_add_series(chart3, lv_theme_get_color_primary(chart3), LV_CHART_AXIS_PRIMARY_Y);
|
||||
lv_chart_set_next_value(chart3, ser4, lv_rand(60, 90));
|
||||
@@ -1068,7 +1068,7 @@ static void color_changer_create(lv_obj_t * parent)
|
||||
lv_obj_set_style_radius(c, LV_RADIUS_CIRCLE, 0);
|
||||
lv_obj_set_style_opa(c, LV_OPA_TRANSP, 0);
|
||||
lv_obj_set_size(c, 20, 20);
|
||||
lv_obj_add_event(c, color_event_cb, LV_EVENT_ALL, &palette[i]);
|
||||
lv_obj_add_event_cb(c, color_event_cb, LV_EVENT_ALL, &palette[i]);
|
||||
lv_obj_remove_flag(c, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
|
||||
}
|
||||
|
||||
@@ -1077,7 +1077,7 @@ static void color_changer_create(lv_obj_t * parent)
|
||||
lv_obj_set_style_bg_color(btn, lv_color_white(), LV_STATE_CHECKED);
|
||||
lv_obj_set_style_pad_all(btn, 10, 0);
|
||||
lv_obj_set_style_radius(btn, LV_RADIUS_CIRCLE, 0);
|
||||
lv_obj_add_event(btn, color_changer_event_cb, LV_EVENT_ALL, color_cont);
|
||||
lv_obj_add_event_cb(btn, color_changer_event_cb, LV_EVENT_ALL, color_cont);
|
||||
lv_obj_set_style_shadow_width(btn, 0, 0);
|
||||
lv_obj_set_style_bg_image_src(btn, LV_SYMBOL_TINT, 0);
|
||||
|
||||
@@ -1322,7 +1322,7 @@ static void birthday_event_cb(lv_event_t * e)
|
||||
else lv_obj_set_size(calendar, 300, 330);
|
||||
lv_calendar_set_showed_date(calendar, 1990, 01);
|
||||
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 30);
|
||||
lv_obj_add_event(calendar, calendar_event_cb, LV_EVENT_ALL, ta);
|
||||
lv_obj_add_event_cb(calendar, calendar_event_cb, LV_EVENT_ALL, ta);
|
||||
|
||||
lv_calendar_header_dropdown_create(calendar);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user