refactor(style): rename lv_indev_get_act to lv_indev_active
This commit is contained in:
@@ -8,7 +8,7 @@ static void ta_event_cb(lv_event_t * e)
|
||||
lv_obj_t * kb = lv_event_get_user_data(e);
|
||||
|
||||
if(code == LV_EVENT_FOCUSED) {
|
||||
if(lv_indev_get_type(lv_indev_get_act()) != LV_INDEV_TYPE_KEYPAD) {
|
||||
if(lv_indev_get_type(lv_indev_active()) != LV_INDEV_TYPE_KEYPAD) {
|
||||
lv_keyboard_set_textarea(kb, ta);
|
||||
lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ def ta_event_cb(e,kb):
|
||||
ta = e.get_target_obj()
|
||||
|
||||
if code == lv.EVENT.FOCUSED:
|
||||
if lv.indev_get_act() != None and lv.indev_get_act().get_type() != lv.INDEV_TYPE.KEYPAD :
|
||||
if lv.indev_active() != None and lv.indev_active().get_type() != lv.INDEV_TYPE.KEYPAD :
|
||||
kb.set_textarea(ta)
|
||||
kb.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
elif code == lv.EVENT.CANCEL:
|
||||
|
||||
@@ -8,7 +8,7 @@ static void ta_event_cb(lv_event_t * e)
|
||||
lv_obj_t * kb = lv_event_get_user_data(e);
|
||||
|
||||
if(code == LV_EVENT_FOCUSED) {
|
||||
if(lv_indev_get_type(lv_indev_get_act()) != LV_INDEV_TYPE_KEYPAD) {
|
||||
if(lv_indev_get_type(lv_indev_active()) != LV_INDEV_TYPE_KEYPAD) {
|
||||
lv_keyboard_set_textarea(kb, ta);
|
||||
lv_obj_remove_flag(kb, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ def ta_event_cb(e,kb):
|
||||
ta = e.get_target_obj()
|
||||
|
||||
if code == lv.EVENT.FOCUSED:
|
||||
if lv.indev_get_act() != None and lv.indev_get_act().get_type() != lv.INDEV_TYPE.KEYPAD :
|
||||
if lv.indev_active() != None and lv.indev_active().get_type() != lv.INDEV_TYPE.KEYPAD :
|
||||
kb.set_textarea(ta)
|
||||
kb.remove_flag(lv.obj.FLAG.HIDDEN)
|
||||
elif code == lv.EVENT.READY:
|
||||
|
||||
@@ -9,13 +9,13 @@ void lv_example_bar_7(void)
|
||||
lv_obj_t * label;
|
||||
|
||||
|
||||
lv_obj_t * bar_tob = lv_bar_create(lv_scr_act());
|
||||
lv_obj_t * bar_tob = lv_bar_create(lv_screen_active());
|
||||
lv_obj_set_size(bar_tob, 20, 200);
|
||||
lv_bar_set_range(bar_tob, 100, 0);
|
||||
lv_bar_set_value(bar_tob, 70, LV_ANIM_OFF);
|
||||
lv_obj_align(bar_tob, LV_ALIGN_CENTER, 0, -30);
|
||||
|
||||
label = lv_label_create(lv_scr_act());
|
||||
label = lv_label_create(lv_screen_active());
|
||||
lv_label_set_text(label, "From top to bottom");
|
||||
lv_obj_align_to(label, bar_tob, LV_ALIGN_OUT_TOP_MID, 0, -5);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ static void draw_event_cb(lv_event_t * e)
|
||||
void lv_example_chart_4(void)
|
||||
{
|
||||
/*Create a chart1*/
|
||||
lv_obj_t * chart = lv_chart_create(lv_scr_act());
|
||||
lv_obj_t * chart = lv_chart_create(lv_screen_active());
|
||||
lv_chart_set_type(chart, LV_CHART_TYPE_BAR);
|
||||
lv_chart_set_point_count(chart, 24);
|
||||
lv_obj_set_style_pad_column(chart, 2, 0);
|
||||
|
||||
@@ -5,7 +5,7 @@ static void drag_event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
|
||||
lv_indev_t * indev = lv_indev_get_act();
|
||||
lv_indev_t * indev = lv_indev_active();
|
||||
if(indev == NULL) return;
|
||||
|
||||
lv_point_t vect;
|
||||
|
||||
@@ -2,7 +2,7 @@ def drag_event_handler(e):
|
||||
|
||||
obj = e.get_target_obj()
|
||||
|
||||
indev = lv.indev_get_act()
|
||||
indev = lv.indev_active()
|
||||
|
||||
vect = lv.point_t()
|
||||
indev.get_vect(vect)
|
||||
|
||||
@@ -10,13 +10,13 @@ static lv_obj_t * slider_label;
|
||||
void lv_example_slider_4(void)
|
||||
{
|
||||
/*Create a slider in the center of the display*/
|
||||
lv_obj_t * slider = lv_slider_create(lv_scr_act());
|
||||
lv_obj_t * slider = lv_slider_create(lv_screen_active());
|
||||
lv_obj_center(slider);
|
||||
lv_obj_add_event(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
/*Reverse the direction of the slider*/
|
||||
lv_slider_set_range(slider, 100, 0);
|
||||
/*Create a label below the slider*/
|
||||
slider_label = lv_label_create(lv_scr_act());
|
||||
slider_label = lv_label_create(lv_screen_active());
|
||||
lv_label_set_text(slider_label, "0%");
|
||||
|
||||
lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
|
||||
|
||||
Reference in New Issue
Block a user