refactor: scr -> screen, act->active, del->delete, remove in obj_clear_flag/state

This commit is contained in:
Gabor Kiss-Vamosi
2023-10-12 20:37:27 +02:00
parent 0ff2d1c2e4
commit 9ec5417dd3
468 changed files with 1330 additions and 1288 deletions

View File

@@ -17,16 +17,16 @@ void lv_example_button_1(void)
{
lv_obj_t * label;
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_screen_active());
lv_obj_add_event(btn1, event_handler, LV_EVENT_ALL, NULL);
lv_obj_align(btn1, LV_ALIGN_CENTER, 0, -40);
lv_obj_clear_flag(btn1, LV_OBJ_FLAG_PRESS_LOCK);
lv_obj_remove_flag(btn1, LV_OBJ_FLAG_PRESS_LOCK);
label = lv_label_create(btn1);
lv_label_set_text(label, "Button");
lv_obj_center(label);
lv_obj_t * btn2 = lv_button_create(lv_scr_act());
lv_obj_t * btn2 = lv_button_create(lv_screen_active());
lv_obj_add_event(btn2, event_handler, LV_EVENT_ALL, NULL);
lv_obj_align(btn2, LV_ALIGN_CENTER, 0, 40);
lv_obj_add_flag(btn2, LV_OBJ_FLAG_CHECKABLE);

View File

@@ -7,7 +7,7 @@ def event_handler(evt):
print("Value changed seen")
# create a simple button
button1 = lv.button(lv.scr_act())
button1 = lv.button(lv.screen_active())
# attach the callback
button1.add_event(event_handler,lv.EVENT.ALL, None)
@@ -17,7 +17,7 @@ label=lv.label(button1)
label.set_text("Button")
# create a toggle button
button2 = lv.button(lv.scr_act())
button2 = lv.button(lv.screen_active())
# attach the callback
#button2.add_event(event_handler,lv.EVENT.VALUE_CHANGED,None)

View File

@@ -51,7 +51,7 @@ void lv_example_button_2(void)
lv_style_set_transition(&style_pr, &trans);
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_screen_active());
lv_obj_remove_style_all(btn1); /*Remove the style coming from the theme*/
lv_obj_add_style(btn1, &style, 0);
lv_obj_add_style(btn1, &style_pr, LV_STATE_PRESSED);

View File

@@ -47,7 +47,7 @@ trans.init(props, lv.anim_t.path_linear, 300, 0, None)
style_pr.set_transition(trans)
button1 = lv.button(lv.scr_act())
button1 = lv.button(lv.screen_active())
button1.remove_style_all() # Remove the style coming from the theme
button1.add_style(style, 0)
button1.add_style(style_pr, lv.STATE.PRESSED)

View File

@@ -34,7 +34,7 @@ void lv_example_button_3(void)
lv_style_set_text_letter_space(&style_pr, 10);
lv_style_set_transition(&style_pr, &transition_dsc_pr);
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_screen_active());
lv_obj_align(btn1, LV_ALIGN_CENTER, 0, -80);
lv_obj_add_style(btn1, &style_pr, LV_STATE_PRESSED);
lv_obj_add_style(btn1, &style_def, 0);

View File

@@ -28,7 +28,7 @@ style_pr.set_transform_height(-10)
style_pr.set_text_letter_space(10)
style_pr.set_transition(transition_dsc_pr)
button1 = lv.button(lv.scr_act())
button1 = lv.button(lv.screen_active())
button1.align(lv.ALIGN.CENTER, 0, -80)
button1.add_style(style_pr, lv.STATE.PRESSED)
button1.add_style(style_def, 0)