From 7a23be73ab53326b7cc1bc2de45463bc7e2f4a58 Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Sat, 30 Jul 2022 18:10:56 +0300 Subject: [PATCH] fix(examples) adjust constant names in Micropython examples (#3532) Due to spurious enums (https://github.com/lvgl/lv_binding_micropython/issues/199) wrong constant names were generated. Fix these constants. --- examples/anim/lv_example_anim_2.py | 6 +++--- examples/anim/lv_example_anim_3.py | 4 ++-- examples/get_started/lv_example_get_started_2.py | 2 +- examples/layouts/flex/lv_example_flex_1.py | 2 +- examples/layouts/flex/lv_example_flex_2.py | 2 +- examples/layouts/flex/lv_example_flex_5.py | 6 +++--- examples/layouts/flex/lv_example_flex_6.py | 2 +- examples/layouts/grid/lv_example_grid_1.py | 4 ++-- examples/layouts/grid/lv_example_grid_2.py | 14 +++++++------- examples/layouts/grid/lv_example_grid_3.py | 4 ++-- examples/layouts/grid/lv_example_grid_4.py | 4 ++-- examples/layouts/grid/lv_example_grid_5.py | 8 ++++---- examples/layouts/grid/lv_example_grid_6.py | 4 ++-- examples/scroll/lv_example_scroll_3.py | 2 +- examples/scroll/lv_example_scroll_6.py | 2 +- examples/styles/lv_example_style_1.py | 2 +- examples/styles/lv_example_style_11.py | 2 +- examples/widgets/animimg/lv_example_animimg_1.py | 2 +- examples/widgets/bar/lv_example_bar_3.py | 2 +- examples/widgets/bar/lv_example_bar_6.py | 2 +- examples/widgets/bar/test.py | 2 +- examples/widgets/btn/lv_example_btn_1.py | 2 +- examples/widgets/btn/lv_example_btn_2.py | 2 +- .../widgets/btnmatrix/lv_example_btnmatrix_2.py | 2 +- .../widgets/btnmatrix/lv_example_btnmatrix_3.py | 2 +- examples/widgets/chart/lv_example_chart_4.py | 2 +- examples/widgets/chart/lv_example_chart_5.py | 4 ++-- examples/widgets/chart/lv_example_chart_6.py | 2 +- examples/widgets/chart/lv_example_chart_9.py | 6 +++--- examples/widgets/img/lv_example_img_3.py | 4 ++-- examples/widgets/img/lv_example_img_4.py | 2 +- examples/widgets/menu/lv_example_menu_4.py | 2 +- examples/widgets/meter/lv_example_meter_1.py | 2 +- examples/widgets/meter/lv_example_meter_2.py | 6 +++--- examples/widgets/meter/lv_example_meter_3.py | 2 +- examples/widgets/slider/lv_example_slider_2.py | 6 +++--- examples/widgets/table/lv_example_table_2.py | 2 +- examples/widgets/tileview/lv_example_tileview_1.py | 2 +- 38 files changed, 64 insertions(+), 64 deletions(-) diff --git a/examples/anim/lv_example_anim_2.py b/examples/anim/lv_example_anim_2.py index 1b0356a5c2..1a06663d27 100644 --- a/examples/anim/lv_example_anim_2.py +++ b/examples/anim/lv_example_anim_2.py @@ -10,7 +10,7 @@ def anim_size_cb(obj, v): # obj = lv.obj(lv.scr_act()) obj.set_style_bg_color(lv.palette_main(lv.PALETTE.RED), 0) -obj.set_style_radius(lv.RADIUS.CIRCLE, 0) +obj.set_style_radius(lv.RADIUS_CIRCLE, 0) obj.align(lv.ALIGN.LEFT_MID, 10, 0) @@ -22,7 +22,7 @@ a1.set_time(1000) a1.set_playback_delay(100) a1.set_playback_time(300) a1.set_repeat_delay(500) -a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a1.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a1.set_path_cb(lv.anim_t.path_ease_in_out) a1.set_custom_exec_cb(lambda a1,val: anim_size_cb(obj,val)) lv.anim_t.start(a1) @@ -35,7 +35,7 @@ a2.set_time(1000) a2.set_playback_delay(100) a2.set_playback_time(300) a2.set_repeat_delay(500) -a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a2.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a2.set_path_cb(lv.anim_t.path_ease_in_out) a2.set_custom_exec_cb(lambda a1,val: anim_x_cb(obj,val)) lv.anim_t.start(a2) diff --git a/examples/anim/lv_example_anim_3.py b/examples/anim/lv_example_anim_3.py index 67194b35c5..6cb04d86dc 100644 --- a/examples/anim/lv_example_anim_3.py +++ b/examples/anim/lv_example_anim_3.py @@ -14,8 +14,8 @@ class LvExampleAnim_3(): # def __init__(self): # Create a container with grid - col_dsc = [lv.grid_fr(1), 200, lv.grid_fr(1), lv.GRID_TEMPLATE.LAST] - row_dsc = [30, 10, 10, lv.grid_fr(1),lv.GRID_TEMPLATE.LAST] + col_dsc = [lv.grid_fr(1), 200, lv.grid_fr(1), lv.GRID_TEMPLATE_LAST] + row_dsc = [30, 10, 10, lv.grid_fr(1),lv.GRID_TEMPLATE_LAST] self.p1 = 0 self.p2 = 0 diff --git a/examples/get_started/lv_example_get_started_2.py b/examples/get_started/lv_example_get_started_2.py index 431ba03eb8..c050200527 100644 --- a/examples/get_started/lv_example_get_started_2.py +++ b/examples/get_started/lv_example_get_started_2.py @@ -54,7 +54,7 @@ btn2.set_size(120, 50) # Set its size btn2.add_style(style_btn, 0) btn2.add_style(style_btn_red, 0) btn2.add_style(style_btn_pressed, lv.STATE.PRESSED) -btn2.set_style_radius(lv.RADIUS.CIRCLE, 0) # Add a local style +btn2.set_style_radius(lv.RADIUS_CIRCLE, 0) # Add a local style label = lv.label(btn2) # Add a label to the button label.set_text("Button 2") # Set the labels text diff --git a/examples/layouts/flex/lv_example_flex_1.py b/examples/layouts/flex/lv_example_flex_1.py index 8dc23851b9..ae41de8ecc 100644 --- a/examples/layouts/flex/lv_example_flex_1.py +++ b/examples/layouts/flex/lv_example_flex_1.py @@ -25,7 +25,7 @@ for i in range(10): # Add items to the column obj = lv.btn(cont_col) - obj.set_size(lv.pct(100), lv.SIZE.CONTENT) + obj.set_size(lv.pct(100), lv.SIZE_CONTENT) label = lv.label(obj) label.set_text("Item: {:d}".format(i)) diff --git a/examples/layouts/flex/lv_example_flex_2.py b/examples/layouts/flex/lv_example_flex_2.py index 7a8012c17a..07003c43e2 100644 --- a/examples/layouts/flex/lv_example_flex_2.py +++ b/examples/layouts/flex/lv_example_flex_2.py @@ -14,7 +14,7 @@ cont.add_style(style, 0) for i in range(8): obj = lv.obj(cont) - obj.set_size(70, lv.SIZE.CONTENT) + obj.set_size(70, lv.SIZE_CONTENT) label = lv.label(obj) label.set_text("{:d}".format(i)) diff --git a/examples/layouts/flex/lv_example_flex_5.py b/examples/layouts/flex/lv_example_flex_5.py index 11e11f969a..a98ec8f1e9 100644 --- a/examples/layouts/flex/lv_example_flex_5.py +++ b/examples/layouts/flex/lv_example_flex_5.py @@ -16,7 +16,7 @@ cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) for i in range(9): obj = lv.obj(cont) - obj.set_size(70, lv.SIZE.CONTENT) + obj.set_size(70, lv.SIZE_CONTENT) label = lv.label(obj) label.set_text(str(i)) @@ -26,7 +26,7 @@ a_row = lv.anim_t() a_row.init() a_row.set_var(cont) a_row.set_values(0, 10) -a_row.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a_row.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a_row.set_time(500) a_row.set_playback_time(500) @@ -37,7 +37,7 @@ a_col = lv.anim_t() a_col.init() a_col.set_var(cont) a_col.set_values(0, 10) -a_col.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a_col.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a_col.set_time(3000) a_col.set_playback_time(3000) diff --git a/examples/layouts/flex/lv_example_flex_6.py b/examples/layouts/flex/lv_example_flex_6.py index 1f50433da8..11d0160bd0 100644 --- a/examples/layouts/flex/lv_example_flex_6.py +++ b/examples/layouts/flex/lv_example_flex_6.py @@ -11,7 +11,7 @@ cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP) for i in range(20): obj = lv.obj(cont) - obj.set_size(70, lv.SIZE.CONTENT) + obj.set_size(70, lv.SIZE_CONTENT) label = lv.label(obj) label.set_text(str(i)) diff --git a/examples/layouts/grid/lv_example_grid_1.py b/examples/layouts/grid/lv_example_grid_1.py index 433ffc6761..a5006ca04a 100644 --- a/examples/layouts/grid/lv_example_grid_1.py +++ b/examples/layouts/grid/lv_example_grid_1.py @@ -2,8 +2,8 @@ # A simple grid # -col_dsc = [70, 70, 70, lv.GRID_TEMPLATE.LAST] -row_dsc = [50, 50, 50, lv.GRID_TEMPLATE.LAST] +col_dsc = [70, 70, 70, lv.GRID_TEMPLATE_LAST] +row_dsc = [50, 50, 50, lv.GRID_TEMPLATE_LAST] # Create a container with grid cont = lv.obj(lv.scr_act()) diff --git a/examples/layouts/grid/lv_example_grid_2.py b/examples/layouts/grid/lv_example_grid_2.py index c713406ae7..9e705ebd9e 100644 --- a/examples/layouts/grid/lv_example_grid_2.py +++ b/examples/layouts/grid/lv_example_grid_2.py @@ -2,8 +2,8 @@ # Demonstrate cell placement and span # -col_dsc = [70, 70, 70, lv.GRID_TEMPLATE.LAST] -row_dsc = [50, 50, 50, lv.GRID_TEMPLATE.LAST] +col_dsc = [70, 70, 70, lv.GRID_TEMPLATE_LAST] +row_dsc = [50, 50, 50, lv.GRID_TEMPLATE_LAST] # Create a container with grid cont = lv.obj(lv.scr_act()) @@ -13,7 +13,7 @@ cont.center() # Cell to 0;0 and align to the start (left/top) horizontally and vertically too obj = lv.obj(cont) -obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +obj.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) obj.set_grid_cell(lv.GRID_ALIGN.START, 0, 1, lv.GRID_ALIGN.START, 0, 1) label = lv.label(obj) @@ -21,7 +21,7 @@ label.set_text("c0, r0") # Cell to 1;0 and align to the start (left) horizontally and center vertically too obj = lv.obj(cont) -obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +obj.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) obj.set_grid_cell(lv.GRID_ALIGN.START, 1, 1, lv.GRID_ALIGN.CENTER, 0, 1) label = lv.label(obj) @@ -29,7 +29,7 @@ label.set_text("c1, r0") # Cell to 2;0 and align to the start (left) horizontally and end (bottom) vertically too obj = lv.obj(cont) -obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +obj.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) obj.set_grid_cell(lv.GRID_ALIGN.START, 2, 1, lv.GRID_ALIGN.END, 0, 1) label = lv.label(obj) @@ -37,7 +37,7 @@ label.set_text("c2, r0") # Cell to 1;1 but 2 column wide (span = 2).Set width and height to stretched. obj = lv.obj(cont) -obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +obj.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, 1, 2, lv.GRID_ALIGN.STRETCH, 1, 1) label = lv.label(obj) @@ -45,7 +45,7 @@ label.set_text("c1-2, r1") # Cell to 0;1 but 2 rows tall (span = 2).Set width and height to stretched. obj = lv.obj(cont) -obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +obj.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, 0, 1, lv.GRID_ALIGN.STRETCH, 1, 2) label = lv.label(obj) diff --git a/examples/layouts/grid/lv_example_grid_3.py b/examples/layouts/grid/lv_example_grid_3.py index e820bdacce..94f4ea2647 100644 --- a/examples/layouts/grid/lv_example_grid_3.py +++ b/examples/layouts/grid/lv_example_grid_3.py @@ -6,13 +6,13 @@ # Column 2: 1 unit from the remaining free space # Column 3: 2 unit from the remaining free space -col_dsc = [60, lv.grid_fr(1), lv.grid_fr(2), lv.GRID_TEMPLATE.LAST] +col_dsc = [60, lv.grid_fr(1), lv.grid_fr(2), lv.GRID_TEMPLATE_LAST] # Row 1: fix width 60 px # Row 2: 1 unit from the remaining free space # Row 3: fix width 60 px -row_dsc = [40, lv.grid_fr(1), 40, lv.GRID_TEMPLATE.LAST] +row_dsc = [40, lv.grid_fr(1), 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid cont = lv.obj(lv.scr_act()) diff --git a/examples/layouts/grid/lv_example_grid_4.py b/examples/layouts/grid/lv_example_grid_4.py index cc2185b7d0..8f8e0240b2 100644 --- a/examples/layouts/grid/lv_example_grid_4.py +++ b/examples/layouts/grid/lv_example_grid_4.py @@ -2,8 +2,8 @@ # Demonstrate track placement # -col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] -row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] +col_dsc = [60, 60, 60, lv.GRID_TEMPLATE_LAST] +row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Add space between the columns and move the rows to the bottom (end) diff --git a/examples/layouts/grid/lv_example_grid_5.py b/examples/layouts/grid/lv_example_grid_5.py index 83f500b8e9..07fa786d17 100644 --- a/examples/layouts/grid/lv_example_grid_5.py +++ b/examples/layouts/grid/lv_example_grid_5.py @@ -9,8 +9,8 @@ def column_gap_anim(obj, v): # # 60x60 cells -col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] -row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] +col_dsc = [60, 60, 60, lv.GRID_TEMPLATE_LAST] +row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid cont = lv.obj(lv.scr_act()) @@ -33,7 +33,7 @@ for i in range(9): a_row.init() a_row.set_var(cont) a_row.set_values(0, 10) - a_row.set_repeat_count(lv.ANIM_REPEAT.INFINITE) + a_row.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a_row.set_time(500) a_row.set_playback_time(500) a_row. set_custom_exec_cb(lambda a,val: row_gap_anim(cont,val)) @@ -43,7 +43,7 @@ for i in range(9): a_col.init() a_col.set_var(cont) a_col.set_values(0, 10) - a_col.set_repeat_count(lv.ANIM_REPEAT.INFINITE) + a_col.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a_col.set_time(500) a_col.set_playback_time(500) a_col. set_custom_exec_cb(lambda a,val: column_gap_anim(cont,val)) diff --git a/examples/layouts/grid/lv_example_grid_6.py b/examples/layouts/grid/lv_example_grid_6.py index 436c6e4c7c..682c9d2185 100644 --- a/examples/layouts/grid/lv_example_grid_6.py +++ b/examples/layouts/grid/lv_example_grid_6.py @@ -1,8 +1,8 @@ # # Demonstrate RTL direction on grid # -col_dsc = [60, 60, 60, lv.GRID_TEMPLATE.LAST] -row_dsc = [40, 40, 40, lv.GRID_TEMPLATE.LAST] +col_dsc = [60, 60, 60, lv.GRID_TEMPLATE_LAST] +row_dsc = [40, 40, 40, lv.GRID_TEMPLATE_LAST] # Create a container with grid cont = lv.obj(lv.scr_act()) diff --git a/examples/scroll/lv_example_scroll_3.py b/examples/scroll/lv_example_scroll_3.py index aae306e0a5..e367205e91 100644 --- a/examples/scroll/lv_example_scroll_3.py +++ b/examples/scroll/lv_example_scroll_3.py @@ -17,7 +17,7 @@ class ScrollExample_3(): float_btn.add_flag(lv.obj.FLAG.FLOATING) float_btn.align(lv.ALIGN.BOTTOM_RIGHT, 0, -list.get_style_pad_right(lv.PART.MAIN)) float_btn.add_event_cb(lambda evt: self.float_btn_event_cb(evt,list), lv.EVENT.ALL, None) - float_btn.set_style_radius(lv.RADIUS.CIRCLE, 0) + float_btn.set_style_radius(lv.RADIUS_CIRCLE, 0) float_btn.set_style_bg_img_src(lv.SYMBOL.PLUS, 0) float_btn.set_style_text_font(lv.theme_get_font_large(float_btn), 0) diff --git a/examples/scroll/lv_example_scroll_6.py b/examples/scroll/lv_example_scroll_6.py index 9b1e9b8646..0cf546fe6c 100644 --- a/examples/scroll/lv_example_scroll_6.py +++ b/examples/scroll/lv_example_scroll_6.py @@ -47,7 +47,7 @@ cont.set_size(200, 200) cont.center() cont.set_flex_flow(lv.FLEX_FLOW.COLUMN) cont.add_event_cb(scroll_event_cb, lv.EVENT.SCROLL, None) -cont.set_style_radius(lv.RADIUS.CIRCLE, 0) +cont.set_style_radius(lv.RADIUS_CIRCLE, 0) cont.set_style_clip_corner(True, 0) cont.set_scroll_dir(lv.DIR.VER) cont.set_scroll_snap_y(lv.SCROLL_SNAP.CENTER) diff --git a/examples/styles/lv_example_style_1.py b/examples/styles/lv_example_style_1.py index 803ce9a21f..a6228d9027 100644 --- a/examples/styles/lv_example_style_1.py +++ b/examples/styles/lv_example_style_1.py @@ -7,7 +7,7 @@ style.set_radius(5) # Make a gradient style.set_width(150) -style.set_height(lv.SIZE.CONTENT) +style.set_height(lv.SIZE_CONTENT) style.set_pad_ver(20) style.set_pad_left(5) diff --git a/examples/styles/lv_example_style_11.py b/examples/styles/lv_example_style_11.py index 68f3f11f00..d9a856c6c0 100644 --- a/examples/styles/lv_example_style_11.py +++ b/examples/styles/lv_example_style_11.py @@ -14,7 +14,7 @@ style_base.set_shadow_ofs_y(5) style_base.set_shadow_opa(lv.OPA._50) style_base.set_text_color(lv.color_white()) style_base.set_width(100) -style_base.set_height(lv.SIZE.CONTENT) +style_base.set_height(lv.SIZE_CONTENT) # Set only the properties that should be different style_warning = lv.style_t() diff --git a/examples/widgets/animimg/lv_example_animimg_1.py b/examples/widgets/animimg/lv_example_animimg_1.py index f3a31fd028..14ac078a04 100644 --- a/examples/widgets/animimg/lv_example_animimg_1.py +++ b/examples/widgets/animimg/lv_example_animimg_1.py @@ -47,7 +47,7 @@ animimg0 = lv.animimg(lv.scr_act()) animimg0.center() animimg0.set_src(anim_imgs, 3) animimg0.set_duration(1000) -animimg0.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +animimg0.set_repeat_count(lv.ANIM_REPEAT_INFINITE) animimg0.start() diff --git a/examples/widgets/bar/lv_example_bar_3.py b/examples/widgets/bar/lv_example_bar_3.py index c5f52f39f0..8ab4724af5 100644 --- a/examples/widgets/bar/lv_example_bar_3.py +++ b/examples/widgets/bar/lv_example_bar_3.py @@ -26,7 +26,7 @@ a.set_time(3000) a.set_playback_time(3000) a.set_var(bar) a.set_values(-20, 40) -a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a.set_custom_exec_cb(lambda a, val: set_temp(bar,val)) lv.anim_t.start(a) diff --git a/examples/widgets/bar/lv_example_bar_6.py b/examples/widgets/bar/lv_example_bar_6.py index 9d68a871ff..7cc7ae396b 100644 --- a/examples/widgets/bar/lv_example_bar_6.py +++ b/examples/widgets/bar/lv_example_bar_6.py @@ -49,6 +49,6 @@ a.set_values(0, 100) a.set_custom_exec_cb(lambda a,val: set_value(bar,val)) a.set_time(2000) a.set_playback_time(2000) -a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) lv.anim_t.start(a) diff --git a/examples/widgets/bar/test.py b/examples/widgets/bar/test.py index b784355822..00dd28d111 100644 --- a/examples/widgets/bar/test.py +++ b/examples/widgets/bar/test.py @@ -52,6 +52,6 @@ a.set_values(0, 100) a.set_custom_exec_cb(lambda a,val: set_value(bar,val)) a.set_time(2000) a.set_playback_time(2000) -a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) lv.anim_t.start(a) diff --git a/examples/widgets/btn/lv_example_btn_1.py b/examples/widgets/btn/lv_example_btn_1.py index 19fdba1df8..1d24d88ad2 100644 --- a/examples/widgets/btn/lv_example_btn_1.py +++ b/examples/widgets/btn/lv_example_btn_1.py @@ -25,7 +25,7 @@ btn2.add_event_cb(event_handler,lv.EVENT.ALL, None) btn2.align(lv.ALIGN.CENTER,0,40) btn2.add_flag(lv.obj.FLAG.CHECKABLE) -btn2.set_height(lv.SIZE.CONTENT) +btn2.set_height(lv.SIZE_CONTENT) label=lv.label(btn2) label.set_text("Toggle") diff --git a/examples/widgets/btn/lv_example_btn_2.py b/examples/widgets/btn/lv_example_btn_2.py index 38c09a1eda..a0a535468a 100644 --- a/examples/widgets/btn/lv_example_btn_2.py +++ b/examples/widgets/btn/lv_example_btn_2.py @@ -51,7 +51,7 @@ btn1 = lv.btn(lv.scr_act()) btn1.remove_style_all() # Remove the style coming from the theme btn1.add_style(style, 0) btn1.add_style(style_pr, lv.STATE.PRESSED) -btn1.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +btn1.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) btn1.center() label = lv.label(btn1) diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py index 21f7c71fac..052f7419d4 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py @@ -39,7 +39,7 @@ def event_cb(e): # Change the draw descriptor the 3rd button elif dsc.id == 2: - dsc.rect_dsc.radius = lv.RADIUS.CIRCLE + dsc.rect_dsc.radius = lv.RADIUS_CIRCLE if obj.get_selected_btn() == dsc.id: dsc.rect_dsc.bg_color = lv.palette_darken(lv.PALETTE.RED, 3) else: diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py index 01c233225a..1541c86675 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_3.py @@ -30,7 +30,7 @@ style_bg.init() style_bg.set_pad_all(0) style_bg.set_pad_gap(0) style_bg.set_clip_corner(True) -style_bg.set_radius(lv.RADIUS.CIRCLE) +style_bg.set_radius(lv.RADIUS_CIRCLE) style_bg.set_border_width(0) diff --git a/examples/widgets/chart/lv_example_chart_4.py b/examples/widgets/chart/lv_example_chart_4.py index 3b8d06338b..f1a759f476 100644 --- a/examples/widgets/chart/lv_example_chart_4.py +++ b/examples/widgets/chart/lv_example_chart_4.py @@ -10,7 +10,7 @@ def event_cb(e): elif code == lv.EVENT.DRAW_POST_END: id = lv.chart.get_pressed_point(chart) - if id == lv.CHART_POINT.NONE: + if id == lv.CHART_POINT_NONE: return # print("Selected point ", id) for i in range(len(series)): diff --git a/examples/widgets/chart/lv_example_chart_5.py b/examples/widgets/chart/lv_example_chart_5.py index bdbc346372..a175818c9d 100644 --- a/examples/widgets/chart/lv_example_chart_5.py +++ b/examples/widgets/chart/lv_example_chart_5.py @@ -76,13 +76,13 @@ chart.set_point_count(pcnt) chart.set_ext_y_array(ser, ecg_sample) slider = lv.slider(lv.scr_act()) -slider.set_range(lv.IMG_ZOOM.NONE, lv.IMG_ZOOM.NONE * 10) +slider.set_range(lv.IMG_ZOOM_NONE, lv.IMG_ZOOM_NONE * 10) slider.add_event_cb(slider_x_event_cb, lv.EVENT.VALUE_CHANGED, None) slider.set_size(200,10) slider.align_to(chart, lv.ALIGN.OUT_BOTTOM_MID, 0, 20) slider = lv.slider(lv.scr_act()) -slider.set_range(lv.IMG_ZOOM.NONE, lv.IMG_ZOOM.NONE * 10) +slider.set_range(lv.IMG_ZOOM_NONE, lv.IMG_ZOOM_NONE * 10) slider.add_event_cb(slider_y_event_cb, lv.EVENT.VALUE_CHANGED, None) slider.set_size(10, 150) slider.align_to(chart, lv.ALIGN.OUT_RIGHT_MID, 20, 0) diff --git a/examples/widgets/chart/lv_example_chart_6.py b/examples/widgets/chart/lv_example_chart_6.py index acc4e11c79..2d20af75b7 100644 --- a/examples/widgets/chart/lv_example_chart_6.py +++ b/examples/widgets/chart/lv_example_chart_6.py @@ -42,7 +42,7 @@ class ExampleChart_6(): if code == lv.EVENT.VALUE_CHANGED: # print("last_id: ",self.last_id) self.last_id = chart.get_pressed_point() - if self.last_id != lv.CHART_POINT.NONE: + if self.last_id != lv.CHART_POINT_NONE: p = lv.point_t() chart.get_point_pos_by_id(self.ser, self.last_id, p) chart.set_cursor_point(self.cursor, None, self.last_id) diff --git a/examples/widgets/chart/lv_example_chart_9.py b/examples/widgets/chart/lv_example_chart_9.py index 37b16b3940..ef546add8f 100644 --- a/examples/widgets/chart/lv_example_chart_9.py +++ b/examples/widgets/chart/lv_example_chart_9.py @@ -8,9 +8,9 @@ def add_data(t): s = chart.get_x_start_point(ser) a = chart.get_y_array(ser) - a[(s + 1) % p] = lv.CHART_POINT.NONE - a[(s + 2) % p] = lv.CHART_POINT.NONE - a[(s + 3) % p] = lv.CHART_POINT.NONE + a[(s + 1) % p] = lv.CHART_POINT_NONE + a[(s + 2) % p] = lv.CHART_POINT_NONE + a[(s + 3) % p] = lv.CHART_POINT_NONE chart.refresh() # diff --git a/examples/widgets/img/lv_example_img_3.py b/examples/widgets/img/lv_example_img_3.py index 07f222dc79..bb33a974b7 100644 --- a/examples/widgets/img/lv_example_img_3.py +++ b/examples/widgets/img/lv_example_img_3.py @@ -45,7 +45,7 @@ a1.set_var(img) a1.set_custom_exec_cb(lambda a,val: set_angle(img,val)) a1.set_values(0, 3600) a1.set_time(5000) -a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a1.set_repeat_count(lv.ANIM_REPEAT_INFINITE) lv.anim_t.start(a1) a2 = lv.anim_t() @@ -55,7 +55,7 @@ a2.set_custom_exec_cb(lambda a,val: set_zoom(img,val)) a2.set_values(128, 256) a2.set_time(5000) a2.set_playback_time(3000) -a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a2.set_repeat_count(lv.ANIM_REPEAT_INFINITE) lv.anim_t.start(a2) diff --git a/examples/widgets/img/lv_example_img_4.py b/examples/widgets/img/lv_example_img_4.py index 37b24a0beb..c6aefb823e 100644 --- a/examples/widgets/img/lv_example_img_4.py +++ b/examples/widgets/img/lv_example_img_4.py @@ -45,7 +45,7 @@ a.set_var(img) a.set_values(0, 100) a.set_time(3000) a.set_playback_time(500) -a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a.set_custom_exec_cb(lambda a,val: ofs_y_anim(img,val)) lv.anim_t.start(a) diff --git a/examples/widgets/menu/lv_example_menu_4.py b/examples/widgets/menu/lv_example_menu_4.py index 4bb190d052..ab700f98c2 100644 --- a/examples/widgets/menu/lv_example_menu_4.py +++ b/examples/widgets/menu/lv_example_menu_4.py @@ -42,6 +42,6 @@ float_btn.set_size(50, 50) float_btn.add_flag(lv.obj.FLAG.FLOATING) float_btn.align(lv.ALIGN.BOTTOM_RIGHT, -10, -10) float_btn.add_event_cb(float_btn_event_cb, lv.EVENT.CLICKED, None) -float_btn.set_style_radius(lv.RADIUS.CIRCLE, 0) +float_btn.set_style_radius(lv.RADIUS_CIRCLE, 0) float_btn.set_style_bg_img_src(lv.SYMBOL.PLUS, 0) float_btn.set_style_text_font(lv.theme_get_font_large(float_btn), 0) \ No newline at end of file diff --git a/examples/widgets/meter/lv_example_meter_1.py b/examples/widgets/meter/lv_example_meter_1.py index 6208e6a6e0..e46bf17d85 100644 --- a/examples/widgets/meter/lv_example_meter_1.py +++ b/examples/widgets/meter/lv_example_meter_1.py @@ -52,7 +52,7 @@ a.set_time(2000) a.set_repeat_delay(100) a.set_playback_time(500) a.set_playback_delay(100) -a.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a.set_custom_exec_cb(lambda a,val: set_value(indic,val)) lv.anim_t.start(a) diff --git a/examples/widgets/meter/lv_example_meter_2.py b/examples/widgets/meter/lv_example_meter_2.py index 2acc937e80..7eb05f970d 100644 --- a/examples/widgets/meter/lv_example_meter_2.py +++ b/examples/widgets/meter/lv_example_meter_2.py @@ -37,7 +37,7 @@ a1.set_repeat_delay(100) a1.set_playback_delay(100) a1.set_playback_time(500) a1.set_var(indic1) -a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a1.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a1.set_custom_exec_cb(lambda a,val: set_value(indic1,val)) lv.anim_t.start(a1) @@ -49,7 +49,7 @@ a2.set_repeat_delay(100) a2.set_playback_delay(100) a2.set_playback_time(1000) a2.set_var(indic2) -a2.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a2.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a2.set_custom_exec_cb(lambda a,val: set_value(indic2,val)) lv.anim_t.start(a2) @@ -61,7 +61,7 @@ a3.set_repeat_delay(100) a3.set_playback_delay(100) a3.set_playback_time(2000) a3.set_var(indic3) -a3.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a3.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a3.set_custom_exec_cb(lambda a,val: set_value(indic3,val)) lv.anim_t.start(a3) diff --git a/examples/widgets/meter/lv_example_meter_3.py b/examples/widgets/meter/lv_example_meter_3.py index 2d7c6daf4f..c7f921a683 100644 --- a/examples/widgets/meter/lv_example_meter_3.py +++ b/examples/widgets/meter/lv_example_meter_3.py @@ -67,7 +67,7 @@ indic_hour = meter.add_needle_img(scale_min, img_hand_hour_dsc, 5, 5) a1 = lv.anim_t() a1.init() a1.set_values(0, 60) -a1.set_repeat_count(lv.ANIM_REPEAT.INFINITE) +a1.set_repeat_count(lv.ANIM_REPEAT_INFINITE) a1.set_time(2000) # 2 sec for 1 turn of the minute hand (1 hour) a1.set_var(indic_min) a1.set_custom_exec_cb(lambda a1,val: set_value(indic_min,val)) diff --git a/examples/widgets/slider/lv_example_slider_2.py b/examples/widgets/slider/lv_example_slider_2.py index 1dd916a023..60bbc31000 100644 --- a/examples/widgets/slider/lv_example_slider_2.py +++ b/examples/widgets/slider/lv_example_slider_2.py @@ -13,13 +13,13 @@ style_pressed_color = lv.style_t() style_main.init() style_main.set_bg_opa(lv.OPA.COVER) style_main.set_bg_color(lv.color_hex3(0xbbb)) -style_main.set_radius(lv.RADIUS.CIRCLE) +style_main.set_radius(lv.RADIUS_CIRCLE) style_main.set_pad_ver(-2) # Makes the indicator larger style_indicator.init() style_indicator.set_bg_opa(lv.OPA.COVER) style_indicator.set_bg_color(lv.palette_main(lv.PALETTE.CYAN)) -style_indicator.set_radius(lv.RADIUS.CIRCLE) +style_indicator.set_radius(lv.RADIUS_CIRCLE) style_indicator.set_transition(transition_dsc) style_knob.init() @@ -27,7 +27,7 @@ style_knob.set_bg_opa(lv.OPA.COVER) style_knob.set_bg_color(lv.palette_main(lv.PALETTE.CYAN)) style_knob.set_border_color(lv.palette_darken(lv.PALETTE.CYAN, 3)) style_knob.set_border_width(2) -style_knob.set_radius(lv.RADIUS.CIRCLE) +style_knob.set_radius(lv.RADIUS_CIRCLE) style_knob.set_pad_all(6) # Makes the knob larger style_knob.set_transition(transition_dsc) diff --git a/examples/widgets/table/lv_example_table_2.py b/examples/widgets/table/lv_example_table_2.py index 2da2161305..c16abefa25 100644 --- a/examples/widgets/table/lv_example_table_2.py +++ b/examples/widgets/table/lv_example_table_2.py @@ -18,7 +18,7 @@ def draw_event_cb(e): else: rect_dsc.bg_color = lv.palette_lighten(lv.PALETTE.GREY, 2) - rect_dsc.radius = lv.RADIUS.CIRCLE + rect_dsc.radius = lv.RADIUS_CIRCLE sw_area = lv.area_t() sw_area.x1 = dsc.draw_area.x2 - 50 diff --git a/examples/widgets/tileview/lv_example_tileview_1.py b/examples/widgets/tileview/lv_example_tileview_1.py index 2e8b67c362..bed3cb63e9 100644 --- a/examples/widgets/tileview/lv_example_tileview_1.py +++ b/examples/widgets/tileview/lv_example_tileview_1.py @@ -19,7 +19,7 @@ btn = lv.btn(tile2) label = lv.label(btn) label.set_text("Scroll up or right") -btn.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) +btn.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT) btn.center() # Tile3: a list