Home
last modified time | relevance | path

Searched refs:lv (Results 1 – 25 of 142) sorted by relevance

123456

/lvgl-3.5.0/demos/widgets/
Dlv_demo_widgets.py2 import lvgl as lv namespace
5 lv.init()
8 LV_THEME_DEFAULT_COLOR_PRIMARY=lv.color_hex(0x01a2b1)
9 LV_THEME_DEFAULT_COLOR_SECONDARY=lv.color_hex(0x44d1b6)
21 disp_buf1 = lv.disp_buf_t()
24 disp_drv = lv.disp_drv_t()
34 indev_drv = lv.indev_drv_t()
36 indev_drv.type = lv.INDEV_TYPE.POINTER
42 scr=lv.obj()
43 lv.scr_load(scr)
[all …]
/lvgl-3.5.0/examples/layouts/grid/
Dlv_example_grid_2.py5 col_dsc = [70, 70, 70, lv.GRID_TEMPLATE.LAST]
6 row_dsc = [50, 50, 50, lv.GRID_TEMPLATE.LAST]
9 cont = lv.obj(lv.scr_act())
15 obj = lv.obj(cont)
16 obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT)
17 obj.set_grid_cell(lv.GRID_ALIGN.START, 0, 1,
18 lv.GRID_ALIGN.START, 0, 1)
19 label = lv.label(obj)
23 obj = lv.obj(cont)
24 obj.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT)
[all …]
/lvgl-3.5.0/examples/widgets/btn/
Dlv_example_btn_2.py6 style = lv.style_t()
11 style.set_bg_opa(lv.OPA.COVER)
12 style.set_bg_color(lv.palette_main(lv.PALETTE.BLUE))
13 style.set_bg_grad_color(lv.palette_darken(lv.PALETTE.BLUE, 2))
14 style.set_bg_grad_dir(lv.GRAD_DIR.VER)
16 style.set_border_opa(lv.OPA._40)
18 style.set_border_color(lv.palette_main(lv.PALETTE.GREY))
21 style.set_shadow_color(lv.palette_main(lv.PALETTE.GREY))
24 style.set_outline_opa(lv.OPA.COVER)
25 style.set_outline_color(lv.palette_main(lv.PALETTE.BLUE))
[all …]
/lvgl-3.5.0/examples/widgets/img/
Dlv_example_img_2.py3 import lvgl as lv namespace
8 decoder = lv.img.decoder_create()
20 img_cogwheel_argb = lv.img_dsc_t({
26 slider = lv.slider(lv.scr_act())
29 slider.set_style_bg_color(color, lv.PART.KNOB)
30 slider.set_style_bg_color(color.color_darken(lv.OPA._40), lv.PART.INDICATOR)
31 slider.add_event_cb(slider_event_cb, lv.EVENT.VALUE_CHANGED, None)
36 … color = lv.color_make(red_slider.get_value(), green_slider.get_value(), blue_slider.get_value())
45 red_slider = create_slider(lv.palette_main(lv.PALETTE.RED))
46 green_slider = create_slider(lv.palette_main(lv.PALETTE.GREEN))
[all …]
/lvgl-3.5.0/examples/widgets/slider/
Dlv_example_slider_2.py5 props = [lv.STYLE.BG_COLOR, 0]
6 transition_dsc = lv.style_transition_dsc_t()
7 transition_dsc.init(props, lv.anim_t.path_linear, 300, 0, None)
9 style_main = lv.style_t()
10 style_indicator = lv.style_t()
11 style_knob = lv.style_t()
12 style_pressed_color = lv.style_t()
14 style_main.set_bg_opa(lv.OPA.COVER)
15 style_main.set_bg_color(lv.color_hex3(0xbbb))
16 style_main.set_radius(lv.RADIUS.CIRCLE)
[all …]
/lvgl-3.5.0/examples/widgets/switch/
Dlv_example_switch_1.py4 if code == lv.EVENT.VALUE_CHANGED:
5 if obj.has_state(lv.STATE.CHECKED):
11 lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN)
12 lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER)
14 sw = lv.switch(lv.scr_act())
15 sw.add_event_cb(event_handler,lv.EVENT.ALL, None)
17 sw = lv.switch(lv.scr_act())
18 sw.add_state(lv.STATE.CHECKED)
19 sw.add_event_cb(event_handler, lv.EVENT.ALL, None)
21 sw = lv.switch(lv.scr_act())
[all …]
/lvgl-3.5.0/examples/get_started/
Dlv_example_get_started_2.py4 style_btn = lv.style_t()
5 style_btn_red = lv.style_t()
6 style_btn_pressed = lv.style_t()
11 style_btn.set_bg_opa(lv.OPA.COVER)
12 style_btn.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
13 style_btn.set_bg_grad_color(lv.palette_main(lv.PALETTE.GREY))
14 style_btn.set_bg_grad_dir(lv.GRAD_DIR.VER)
17 style_btn.set_border_color(lv.color_white())
18 style_btn.set_border_opa(lv.OPA._70)
22 style_btn.set_text_color(lv.color_white())
[all …]
/lvgl-3.5.0/examples/widgets/list/
Dlv_example_list_2.py10 if code == lv.EVENT.CLICKED:
19 child.add_state(lv.STATE.CHECKED)
21 child.clear_state(lv.STATE.CHECKED)
27 if code == lv.EVENT.CLICKED:
31 currentButton.scroll_to_view( lv.ANIM.ON)
37 if code == lv.EVENT.CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT:
44 currentButton.scroll_to_view(lv.ANIM.ON)
50 if code == lv.EVENT.CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT:
56 currentButton.scroll_to_view(lv.ANIM.ON)
62 if code == lv.EVENT.CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT:
[all …]
Dtest.py2 import lvgl as lv namespace
7 if code == lv.EVENT.CLICKED:
11 list1 = lv.list(lv.scr_act())
17 btn_new = list1.add_btn(lv.SYMBOL.FILE, "New")
18 btn_new.add_event_cb(event_handler,lv.EVENT.ALL, None)
19 btn_open = list1.add_btn(lv.SYMBOL.DIRECTORY, "Open")
20 btn_open.add_event_cb(event_handler,lv.EVENT.ALL, None)
21 btn_save = list1.add_btn(lv.SYMBOL.SAVE, "Save")
22 btn_save.add_event_cb(event_handler,lv.EVENT.ALL, None)
23 btn_delete = list1.add_btn(lv.SYMBOL.CLOSE, "Delete")
[all …]
Dlv_example_list_1.py4 if code == lv.EVENT.CLICKED:
8 list1 = lv.list(lv.scr_act())
14 btn_new = list1.add_btn(lv.SYMBOL.FILE, "New")
15 btn_new.add_event_cb(event_handler,lv.EVENT.ALL, None)
16 btn_open = list1.add_btn(lv.SYMBOL.DIRECTORY, "Open")
17 btn_open.add_event_cb(event_handler,lv.EVENT.ALL, None)
18 btn_save = list1.add_btn(lv.SYMBOL.SAVE, "Save")
19 btn_save.add_event_cb(event_handler,lv.EVENT.ALL, None)
20 btn_delete = list1.add_btn(lv.SYMBOL.CLOSE, "Delete")
21 btn_delete.add_event_cb(event_handler,lv.EVENT.ALL, None)
[all …]
/lvgl-3.5.0/examples/anim/
Dlv_example_anim_3.py17 col_dsc = [lv.grid_fr(1), 200, lv.grid_fr(1), lv.GRID_TEMPLATE.LAST]
18 row_dsc = [30, 10, 10, lv.grid_fr(1),lv.GRID_TEMPLATE.LAST]
22 self.cont = lv.obj(lv.scr_act())
23 self.cont.set_style_pad_all(2, lv.PART.MAIN)
24 self.cont.set_style_pad_column(10, lv.PART.MAIN)
25 self.cont.set_style_pad_row(10, lv.PART.MAIN)
31 self.a = lv.anim_t()
34 … end = self.cont.get_style_width(lv.PART.MAIN) - self.anim_obj.get_style_width(lv.PART.MAIN) - 10
42 self.anim_obj = lv.obj(par)
44 self.anim_obj.set_align(lv.ALIGN.TOP_LEFT)
[all …]
/lvgl-3.5.0/examples/widgets/checkbox/
Dlv_example_checkbox_1.py4 if code == lv.EVENT.VALUE_CHANGED:
6 if obj.get_state() & lv.STATE.CHECKED:
13 lv.scr_act().set_flex_flow(lv.FLEX_FLOW.COLUMN)
14 lv.scr_act().set_flex_align(lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START, lv.FLEX_ALIGN.CENTER)
16 cb = lv.checkbox(lv.scr_act())
18 cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
20 cb = lv.checkbox(lv.scr_act())
22 cb.add_state(lv.STATE.CHECKED)
23 cb.add_event_cb(event_handler, lv.EVENT.ALL, None)
25 cb = lv.checkbox(lv.scr_act())
[all …]
/lvgl-3.5.0/examples/widgets/roller/
Dlv_example_roller_2.py7 if code == lv.EVENT.VALUE_CHANGED:
17 style_sel = lv.style_t()
21 style_sel.set_text_font(lv.font_montserrat_22)
23 fs_drv = lv.fs_drv_t()
26 font_montserrat_22 = lv.font_load("S:" + "../../assets/font/montserrat-22.fnt")
32 roller = lv.roller(lv.scr_act())
33 roller.set_options(opts, lv.roller.MODE.NORMAL)
36 roller.add_style(style_sel, lv.PART.SELECTED)
37 roller.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0)
38 roller.align(lv.ALIGN.LEFT_MID, 10, 0)
[all …]
Dlv_example_roller_3.py13 style = lv.style_t()
15 style.set_bg_color(lv.color_black())
16 style.set_text_color(lv.color_white())
18 lv.scr_act().add_style(style, 0)
20 roller1 = lv.roller(lv.scr_act())
24 roller1.set_style_bg_opa(lv.OPA.TRANSP, lv.PART.SELECTED)
30 roller1.set_style_text_font(lv.font_montserrat_22,lv.PART.SELECTED)
32 fs_drv = lv.fs_drv_t()
35 font_montserrat_22 = lv.font_load("S:" + "../../assets/font/montserrat-22.fnt")
36 roller1.set_style_text_font(font_montserrat_22,lv.PART.SELECTED)
[all …]
/lvgl-3.5.0/examples/widgets/chart/
Dlv_example_chart_2.py6 dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
7 if dsc.part != lv.PART.ITEMS:
13 line_mask_param = lv.draw_mask_line_param_t()
14 … line_mask_param.points_init(dsc.p1.x, dsc.p1.y, dsc.p2.x, dsc.p2.y, lv.DRAW_MASK_LINE_SIDE.BOTTOM)
16 line_mask_id = lv.draw_mask_add(line_mask_param, None)
19 fade_mask_param = lv.draw_mask_fade_param_t()
20 coords = lv.area_t()
22 fade_mask_param.init(coords, lv.OPA.COVER, coords.y1 + h // 8, lv.OPA.TRANSP,coords.y2)
23 fade_mask_id = lv.draw_mask_add(fade_mask_param,None)
26 draw_rect_dsc = lv.draw_rect_dsc_t()
[all …]
Dlv_example_chart_6.py9 chart = lv.chart(lv.scr_act())
11 chart.align(lv.ALIGN.CENTER, 0, -10)
13 chart.set_axis_tick(lv.chart.AXIS.PRIMARY_Y, 10, 5, 6, 5, True, 40)
14 chart.set_axis_tick(lv.chart.AXIS.PRIMARY_X, 10, 5, 10, 1, True, 30)
16 chart.add_event_cb(self.event_cb, lv.EVENT.ALL, None)
19 … self.cursor = chart.add_cursor(lv.palette_main(lv.PALETTE.BLUE), lv.DIR.LEFT | lv.DIR.BOTTOM)
21 self.ser = chart.add_series(lv.palette_main(lv.PALETTE.RED), lv.chart.AXIS.PRIMARY_Y)
25 self.ser_p.append(lv.rand(10,90))
32 label = lv.label(lv.scr_act())
34 label.align_to(chart, lv.ALIGN.OUT_TOP_MID, 0, -5)
[all …]
Dlv_example_chart_7.py3 import lvgl as lv namespace
8 if dsc.part == lv.PART.ITEMS:
14 dsc.rect_dsc.bg_opa = (lv.OPA.COVER * dsc.id) // (cnt - 1)
24 x_opa = (x_array[p_act] * lv.OPA._50) // 200
25 y_opa = (y_array[p_act] * lv.OPA._50) // 1000
27 dsc.rect_dsc.bg_color = lv.palette_main(lv.PALETTE.RED).color_mix(
28 lv.palette_main(lv.PALETTE.BLUE),
33 x = lv.rand(0,200)
34 y = lv.rand(0,1000)
46 chart = lv.chart(lv.scr_act())
[all …]
Dlv_example_chart_4.py5 if code == lv.EVENT.VALUE_CHANGED:
8 if code == lv.EVENT.REFR_EXT_DRAW_SIZE:
11 elif code == lv.EVENT.DRAW_POST_END:
12 id = lv.chart.get_pressed_point(chart)
13 if id == lv.CHART_POINT.NONE:
17 p = lv.point_t()
20 buf = lv.SYMBOL.DUMMY + "$" + str(value)
22 draw_rect_dsc = lv.draw_rect_dsc_t()
24 draw_rect_dsc.bg_color = lv.color_black()
25 draw_rect_dsc.bg_opa = lv.OPA._50
[all …]
/lvgl-3.5.0/examples/styles/
Dlv_example_style_11.py6 style_base = lv.style_t()
8 style_base.set_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE))
9 style_base.set_border_color(lv.palette_darken(lv.PALETTE.LIGHT_BLUE, 3))
14 style_base.set_shadow_opa(lv.OPA._50)
15 style_base.set_text_color(lv.color_white())
17 style_base.set_height(lv.SIZE.CONTENT)
20 style_warning = lv.style_t()
22 style_warning.set_bg_color(lv.palette_main(lv.PALETTE.YELLOW))
23 style_warning.set_border_color(lv.palette_darken(lv.PALETTE.YELLOW, 3))
24 style_warning.set_text_color(lv.palette_darken(lv.PALETTE.YELLOW, 4))
[all …]
/lvgl-3.5.0/examples/widgets/tabview/
Dlv_example_tabview_2.py4 if e.get_code() == lv.EVENT.SCROLL_BEGIN:
5 a = lv.anim_t.__cast__(e.get_param())
10 tabview = lv.tabview(lv.scr_act(), lv.DIR.LEFT, 80)
11 tabview.get_content().add_event_cb(scroll_begin_event, lv.EVENT.SCROLL_BEGIN, None)
13 tabview.set_style_bg_color(lv.palette_lighten(lv.PALETTE.RED, 2), 0)
16 tab_btns.set_style_bg_color(lv.palette_darken(lv.PALETTE.GREY, 3), 0)
17 tab_btns.set_style_text_color(lv.palette_lighten(lv.PALETTE.GREY, 5), 0)
18 tab_btns.set_style_border_side(lv.BORDER_SIDE.RIGHT, lv.PART.ITEMS | lv.STATE.CHECKED)
28 tab2.set_style_bg_color(lv.palette_lighten(lv.PALETTE.AMBER, 3), 0)
29 tab2.set_style_bg_opa(lv.OPA.COVER, 0)
[all …]
/lvgl-3.5.0/examples/scroll/
Dlv_example_scroll_4.py4 obj = lv.obj(lv.scr_act())
8 label = lv.label(obj)
29 obj.remove_style(None, lv.PART.SCROLLBAR | lv.STATE.ANY)
32 props = [lv.STYLE.BG_OPA, lv.STYLE.WIDTH, 0]
33 trans = lv.style_transition_dsc_t()
34 trans.init(props, lv.anim_t.path_linear, 200, 0, None)
37 style = lv.style_t()
44 style.set_bg_opa(lv.OPA._70)
45 style.set_bg_color(lv.palette_main(lv.PALETTE.BLUE))
46 style.set_border_color(lv.palette_darken(lv.PALETTE.BLUE, 3))
[all …]
/lvgl-3.5.0/examples/others/snapshot/
Dlv_example_snapshot_1.py2 import lvgl as lv namespace
6 decoder = lv.img.decoder_create()
15 label = lv.label(lv.scr_act())
16 label.align(lv.ALIGN.BOTTOM_MID, 0, -10)
27 img_star = lv.img_dsc_t({
39 dsc = lv.snapshot_take(img.get_parent(), lv.img.CF.TRUE_COLOR_ALPHA)
46 root = lv.scr_act()
47 root.set_style_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE), 0)
50 snapshot_obj = lv.img(root)
51 snapshot_obj.set_style_bg_color(lv.palette_main(lv.PALETTE.PURPLE), 0)
[all …]
/lvgl-3.5.0/examples/widgets/canvas/
Dlv_example_canvas_1.py5 rect_dsc = lv.draw_rect_dsc_t()
8 rect_dsc.bg_opa = lv.OPA.COVER
9 rect_dsc.bg_grad.dir = lv.GRAD_DIR.HOR
10 rect_dsc.bg_grad.stops[0].color = lv.palette_main(lv.PALETTE.RED)
11 rect_dsc.bg_grad.stops[1].color = lv.palette_main(lv.PALETTE.BLUE)
13 rect_dsc.border_opa = lv.OPA._90
14 rect_dsc.border_color = lv.color_white()
19 label_dsc = lv.draw_label_dsc_t()
21 label_dsc.color = lv.palette_main(lv.PALETTE.YELLOW)
25 canvas = lv.canvas(lv.scr_act())
[all …]
/lvgl-3.5.0/examples/widgets/meter/
Dlv_example_meter_1.py3 import lvgl as lv namespace
12 meter = lv.meter(lv.scr_act())
18 meter.set_scale_ticks(scale, 51, 2, 10, lv.palette_main(lv.PALETTE.GREY))
19 meter.set_scale_major_ticks(scale, 10, 4, 15, lv.color_black(), 10)
21 indic = lv.meter_indicator_t()
24 indic = meter.add_arc(scale, 3, lv.palette_main(lv.PALETTE.BLUE), 0)
29 indic = meter.add_scale_lines(scale, lv.palette_main(lv.PALETTE.BLUE), lv.palette_main(lv.PALETTE.B…
34 indic = meter.add_arc(scale, 3, lv.palette_main(lv.PALETTE.RED), 0)
39 indic = meter.add_scale_lines(scale, lv.palette_main(lv.PALETTE.RED), lv.palette_main(lv.PALETTE.RE…
44 indic = meter.add_needle_line(scale, 4, lv.palette_main(lv.PALETTE.GREY), -10)
[all …]
/lvgl-3.5.0/examples/widgets/dropdown/
Dlv_example_dropdown_2.py13 dd = lv.dropdown(lv.scr_act())
15 dd.align(lv.ALIGN.TOP_MID, 0, 10)
16 dd = lv.dropdown(lv.scr_act())
18 dd.set_dir(lv.DIR.BOTTOM)
19 dd.set_symbol(lv.SYMBOL.UP)
20 dd.align(lv.ALIGN.BOTTOM_MID, 0, -10)
22 dd = lv.dropdown(lv.scr_act())
24 dd.set_dir(lv.DIR.RIGHT)
25 dd.set_symbol(lv.SYMBOL.RIGHT)
26 dd.align(lv.ALIGN.LEFT_MID, 10, 0)
[all …]

123456