refactor(btn, img): rename btn to button and img to image

This commit is contained in:
Gabor Kiss-Vamosi
2023-09-14 20:12:31 +02:00
parent e91786ce49
commit 09c12d0f9c
366 changed files with 3271 additions and 3222 deletions

View File

@@ -26,7 +26,7 @@ struct {
static int32_t anim_path_bezier3_cb(const lv_anim_t * a);
static void refer_chart_cubic_bezier(void);
static void run_btn_event_handler(lv_event_t * e);
static void run_button_event_handler(lv_event_t * e);
static void slider_event_cb(lv_event_t * e);
static void page_obj_init(lv_obj_t * par);
static void anim_x_cb(void * var, int32_t v);
@@ -88,7 +88,7 @@ static void anim_x_cb(void * var, int32_t v)
lv_obj_set_style_translate_x(var, v, LV_PART_MAIN);
}
static void run_btn_event_handler(lv_event_t * e)
static void run_button_event_handler(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
if(code == LV_EVENT_CLICKED) {
@@ -144,8 +144,8 @@ static void page_obj_init(lv_obj_t * par)
lv_obj_set_grid_cell(ginfo.p1_slider, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_START, 1, 1);
lv_obj_set_grid_cell(ginfo.p2_slider, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_START, 2, 1);
ginfo.run_btn = lv_btn_create(par);
lv_obj_add_event(ginfo.run_btn, run_btn_event_handler, LV_EVENT_CLICKED, NULL);
ginfo.run_btn = lv_button_create(par);
lv_obj_add_event(ginfo.run_btn, run_button_event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_t * btn_label = lv_label_create(ginfo.run_btn);
lv_label_set_text(btn_label, LV_SYMBOL_PLAY);
lv_obj_center(btn_label);

View File

@@ -64,12 +64,12 @@ class LvExampleAnim_3():
self.p1_slider.set_grid_cell(lv.GRID_ALIGN.STRETCH, 1, 1,lv.GRID_ALIGN.START, 1, 1)
self.p2_slider.set_grid_cell(lv.GRID_ALIGN.STRETCH, 1, 1,lv.GRID_ALIGN.START, 2, 1)
self.run_btn = lv.btn(par)
self.run_btn.add_event(self.run_btn_event_handler, lv.EVENT.CLICKED, None)
btn_label = lv.label(self.run_btn)
btn_label.set_text(lv.SYMBOL.PLAY)
btn_label.center()
self.run_btn.set_grid_cell(lv.GRID_ALIGN.STRETCH, 2, 1,lv.GRID_ALIGN.STRETCH, 1, 2)
self.run_button = lv.button(par)
self.run_button.add_event(self.run_button_event_handler, lv.EVENT.CLICKED, None)
button_label = lv.label(self.run_button)
button_label.set_text(lv.SYMBOL.PLAY)
button_label.center()
self.run_button.set_grid_cell(lv.GRID_ALIGN.STRETCH, 2, 1,lv.GRID_ALIGN.STRETCH, 1, 2)
self.chart = lv.chart(par)
self.chart.set_style_pad_all(0, lv.PART.MAIN)
@@ -103,7 +103,7 @@ class LvExampleAnim_3():
self.refer_chart_cubic_bezier()
def run_btn_event_handler(self,e):
def run_button_event_handler(self,e):
code = e.get_code()
if code == lv.EVENT.CLICKED:

View File

@@ -141,7 +141,7 @@ void lv_example_anim_timeline_1(void)
lv_obj_set_flex_align(par, LV_FLEX_ALIGN_SPACE_AROUND, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
/* create btn_start */
lv_obj_t * btn_start = lv_btn_create(par);
lv_obj_t * btn_start = lv_button_create(par);
lv_obj_add_event(btn_start, btn_start_event_handler, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_add_flag(btn_start, LV_OBJ_FLAG_IGNORE_LAYOUT);
lv_obj_add_flag(btn_start, LV_OBJ_FLAG_CHECKABLE);
@@ -152,7 +152,7 @@ void lv_example_anim_timeline_1(void)
lv_obj_center(label_start);
/* create btn_del */
lv_obj_t * btn_del = lv_btn_create(par);
lv_obj_t * btn_del = lv_button_create(par);
lv_obj_add_event(btn_del, btn_del_event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_add_flag(btn_del, LV_OBJ_FLAG_IGNORE_LAYOUT);
lv_obj_align(btn_del, LV_ALIGN_TOP_MID, 0, 20);
@@ -162,7 +162,7 @@ void lv_example_anim_timeline_1(void)
lv_obj_center(label_del);
/* create btn_stop */
lv_obj_t * btn_stop = lv_btn_create(par);
lv_obj_t * btn_stop = lv_button_create(par);
lv_obj_add_event(btn_stop, btn_stop_event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_add_flag(btn_stop, LV_OBJ_FLAG_IGNORE_LAYOUT);
lv_obj_align(btn_stop, LV_ALIGN_TOP_MID, 100, 20);

View File

@@ -11,22 +11,22 @@ class LV_ExampleAnimTimeline_1(object):
self.par.set_flex_flow(lv.FLEX_FLOW.ROW)
self.par.set_flex_align(lv.FLEX_ALIGN.SPACE_AROUND, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.CENTER)
self.btn_run = lv.btn(self.par)
self.btn_run.add_event(self.btn_run_event_handler, lv.EVENT.VALUE_CHANGED, None)
self.btn_run.add_flag(lv.obj.FLAG.IGNORE_LAYOUT)
self.btn_run.add_flag(lv.obj.FLAG.CHECKABLE)
self.btn_run.align(lv.ALIGN.TOP_MID, -50, 20)
self.button_run = lv.button(self.par)
self.button_run.add_event(self.button_run_event_handler, lv.EVENT.VALUE_CHANGED, None)
self.button_run.add_flag(lv.obj.FLAG.IGNORE_LAYOUT)
self.button_run.add_flag(lv.obj.FLAG.CHECKABLE)
self.button_run.align(lv.ALIGN.TOP_MID, -50, 20)
self.label_run = lv.label(self.btn_run)
self.label_run = lv.label(self.button_run)
self.label_run.set_text("Run")
self.label_run.center()
self.btn_del = lv.btn(self.par)
self.btn_del.add_event(self.btn_del_event_handler, lv.EVENT.CLICKED, None)
self.btn_del.add_flag(lv.obj.FLAG.IGNORE_LAYOUT)
self.btn_del.align(lv.ALIGN.TOP_MID, 50, 20)
self.button_del = lv.button(self.par)
self.button_del.add_event(self.button_del_event_handler, lv.EVENT.CLICKED, None)
self.button_del.add_flag(lv.obj.FLAG.IGNORE_LAYOUT)
self.button_del.align(lv.ALIGN.TOP_MID, 50, 20)
self.label_del = lv.label(self.btn_del)
self.label_del = lv.label(self.button_del)
self.label_del.set_text("Stop")
self.label_del.center()
@@ -125,16 +125,16 @@ class LV_ExampleAnimTimeline_1(object):
self.anim_timeline.set_progress(progress)
def btn_run_event_handler(self,e):
btn = e.get_target_obj()
def button_run_event_handler(self,e):
button = e.get_target_obj()
if not self.anim_timeline:
self.anim_timeline_create()
reverse = btn.has_state(lv.STATE.CHECKED)
reverse = button.has_state(lv.STATE.CHECKED)
self.anim_timeline.set_reverse(reverse)
self.anim_timeline.start()
def btn_del_event_handler(self,e):
def button_del_event_handler(self,e):
if self.anim_timeline:
self.anim_timeline._del()
self.anim_timeline = None

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_ANIMIMG001
#define LV_ATTRIBUTE_IMG_ANIMIMG001
#ifndef LV_ATTRIBUTE_IMAGE_ANIMIMG001
#define LV_ATTRIBUTE_IMAGE_ANIMIMG001
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG001 uint8_t animimg001_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_ANIMIMG001 uint8_t animimg001_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -532,7 +532,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG00
#endif
};
const lv_img_dsc_t animimg001 = {
const lv_image_dsc_t animimg001 = {
.header.always_zero = 0,
.header.w = 130,
.header.h = 170,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_ANIMIMG002
#define LV_ATTRIBUTE_IMG_ANIMIMG002
#ifndef LV_ATTRIBUTE_IMAGE_ANIMIMG002
#define LV_ATTRIBUTE_IMAGE_ANIMIMG002
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG002 uint8_t animimg002_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_ANIMIMG002 uint8_t animimg002_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -532,7 +532,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG00
#endif
};
const lv_img_dsc_t animimg002 = {
const lv_image_dsc_t animimg002 = {
.header.always_zero = 0,
.header.w = 130,
.header.h = 170,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_ANIMIMG003
#define LV_ATTRIBUTE_IMG_ANIMIMG003
#ifndef LV_ATTRIBUTE_IMAGE_ANIMIMG003
#define LV_ATTRIBUTE_IMAGE_ANIMIMG003
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG003 uint8_t animimg003_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_ANIMIMG003 uint8_t animimg003_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -532,7 +532,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_ANIMIMG00
#endif
};
const lv_img_dsc_t animimg003 = {
const lv_image_dsc_t animimg003 = {
.header.always_zero = 0,
.header.w = 130,
.header.h = 170,

View File

@@ -7,10 +7,10 @@
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_1F617
#define LV_ATTRIBUTE_IMG_1F617
#ifndef LV_ATTRIBUTE_IMAGE_1F617
#define LV_ATTRIBUTE_IMAGE_1F617
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_1F617 uint8_t emoji_F617_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_1F617 uint8_t emoji_F617_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1,
@@ -238,7 +238,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_1F617 uint8_t emoji_F617_map[] = {
#endif
};
const lv_img_dsc_t emoji_F617 = {
const lv_image_dsc_t emoji_F617 = {
.header.cf = LV_COLOR_FORMAT_NATIVE,
.header.always_zero = 0,
.header.w = 72,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_CARET_DOWN
#define LV_ATTRIBUTE_IMG_IMG_CARET_DOWN
#ifndef LV_ATTRIBUTE_IMAGE_IMG_CARET_DOWN
#define LV_ATTRIBUTE_IMAGE_IMG_CARET_DOWN
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_CARET_DOWN uint8_t img_caret_down_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMG_CARET_DOWN uint8_t img_caret_down_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x49, 0x00, 0x49, 0x04, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x25, 0x08, 0x49, 0x08, 0x92, 0x00,
@@ -46,7 +46,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_CARET
#endif
};
const lv_img_dsc_t img_caret_down = {
const lv_image_dsc_t img_caret_down = {
.header.always_zero = 0,
.header.w = 13,
.header.h = 8,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_COGWHEEL_ARGB
#define LV_ATTRIBUTE_IMG_IMG_COGWHEEL_ARGB
#ifndef LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_ARGB
#define LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_ARGB
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_ARGB uint8_t img_cogwheel_argb_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_ARGB uint8_t img_cogwheel_argb_map[] = {
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xfb, 0xfa, 0xf9, 0x08, 0xad, 0x9b, 0x8f, 0xff, 0x95, 0x7e, 0x6d, 0xff, 0x90, 0x7a, 0x67, 0xff, 0x92, 0x7c, 0x69, 0xff, 0x91, 0x7b, 0x69, 0xff, 0x8c, 0x75, 0x63, 0xff, 0x97, 0x83, 0x72, 0xff, 0xd1, 0xc8, 0xc0, 0x6c, 0xfe, 0xfe, 0xfe, 0x03, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xf4, 0xf2, 0xf1, 0x10, 0x9e, 0x8a, 0x79, 0xff, 0x8f, 0x78, 0x65, 0xff, 0x90, 0x79, 0x66, 0xff, 0x91, 0x7a, 0x67, 0xff, 0x8f, 0x79, 0x66, 0xff, 0x8c, 0x75, 0x63, 0xff, 0x8c, 0x76, 0x64, 0xff, 0x9f, 0x8c, 0x7d, 0xff, 0xf8, 0xf7, 0xf6, 0x08, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xfc, 0xfb, 0x08, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,
@@ -114,7 +114,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_ARGB uint8_t img_cogw
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x03, 0xfe, 0xfe, 0xfe, 0x08, 0xfc, 0xfc, 0xfc, 0x0c, 0xfc, 0xfc, 0xfc, 0x0c, 0xfc, 0xfc, 0xfc, 0x0b, 0xfb, 0xfb, 0xfb, 0x10, 0xfa, 0xf9, 0xf9, 0x18, 0xfb, 0xfa, 0xfa, 0x13, 0xfd, 0xfd, 0xfd, 0x0b, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,
};
const lv_img_dsc_t img_cogwheel_argb = {
const lv_image_dsc_t img_cogwheel_argb = {
.header.always_zero = 0,
.header.w = 100,
.header.h = 100,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_COGWHEEL_INDEXED16
#define LV_ATTRIBUTE_IMG_IMG_COGWHEEL_INDEXED16
#ifndef LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_INDEXED16
#define LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_INDEXED16
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_INDEXED16 uint8_t img_cogwheel_indexed16_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_INDEXED16 uint8_t img_cogwheel_indexed16_map[] = {
0x00, 0x00, 0x00, 0x00, /*Color of index 0*/
0x6c, 0x5e, 0x4a, 0xff, /*Color of index 1*/
0x72, 0x64, 0x50, 0xff, /*Color of index 2*/
@@ -130,7 +130,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_INDEXED16 uint8_t img
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
const lv_img_dsc_t img_cogwheel_indexed16 = {
const lv_image_dsc_t img_cogwheel_indexed16 = {
.header.always_zero = 0,
.header.w = 100,
.header.h = 100,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_COGWHEEL_RGB
#define LV_ATTRIBUTE_IMG_IMG_COGWHEEL_RGB
#ifndef LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_RGB
#define LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_RGB
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_RGB uint8_t img_cogwheel_rgb_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_COGWHEEL_RGB uint8_t img_cogwheel_rgb_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x97, 0x72, 0x72, 0x72, 0x72, 0x72, 0x92, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -425,7 +425,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_COGWHEEL_RGB uint8_t img_cogwh
#endif
};
const lv_img_dsc_t img_cogwheel_rgb = {
const lv_image_dsc_t img_cogwheel_rgb = {
.header.always_zero = 0,
.header.w = 100,
.header.h = 100,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_HAND
#define LV_ATTRIBUTE_IMG_IMG_HAND
#ifndef LV_ATTRIBUTE_IMAGE_IMG_HAND
#define LV_ATTRIBUTE_IMAGE_IMG_HAND
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_HAND uint8_t img_hand_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_HAND uint8_t img_hand_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x04, 0x6e, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x47, 0x00, 0x57, 0x25, 0x57, 0x49, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -48,7 +48,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_IMG_HAND uint8_t img_hand_map[] =
#endif
};
const lv_img_dsc_t img_hand = {
const lv_image_dsc_t img_hand = {
.header.always_zero = 0,
.header.w = 100,
.header.h = 9,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_SKEW_STRIP
#define LV_ATTRIBUTE_IMG_IMG_SKEW_STRIP
#ifndef LV_ATTRIBUTE_IMAGE_IMG_SKEW_STRIP
#define LV_ATTRIBUTE_IMAGE_IMG_SKEW_STRIP
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_SKEW_STRIP uint8_t img_skew_strip_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMG_SKEW_STRIP uint8_t img_skew_strip_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
@@ -82,7 +82,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_SKEW_
#endif
};
const lv_img_dsc_t img_skew_strip = {
const lv_image_dsc_t img_skew_strip = {
.header.always_zero = 0,
.header.w = 80,
.header.h = 20,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMG_STAR
#define LV_ATTRIBUTE_IMG_IMG_STAR
#ifndef LV_ATTRIBUTE_IMAGE_IMG_STAR
#define LV_ATTRIBUTE_IMAGE_IMG_STAR
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_STAR uint8_t img_star_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMG_STAR uint8_t img_star_map[] = {
/*Pixel format: Blue: 8 bit, Green: 8 bit, Red: 8 bit, Alpha: 8 bit*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xd2, 0xff, 0x54, 0x43, 0xd9, 0xff, 0x23, 0x00, 0x00, 0x00, 0x00, 0x4d, 0xdb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xce, 0xff, 0xc7, 0x4c, 0xdb, 0xff, 0xac, 0x31, 0xd6, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -43,7 +43,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMG_STAR
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0xd7, 0xff, 0x4b, 0x40, 0xd9, 0xff, 0x70, 0x3a, 0xd8, 0xff, 0x10, 0x43, 0xda, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0xdb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xff, 0x00, 0x00, 0xcc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xcc, 0xff, 0x00, 0x00, 0xca, 0xff, 0x10, 0x0c, 0xce, 0xff, 0x90, 0x20, 0xd3, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
const lv_img_dsc_t img_star = {
const lv_image_dsc_t img_star = {
.header.always_zero = 0,
.header.w = 30,
.header.h = 29,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMGBTN_LEFT
#define LV_ATTRIBUTE_IMG_IMGBTN_LEFT
#ifndef LV_ATTRIBUTE_IMAGE_IMGBTN_LEFT
#define LV_ATTRIBUTE_IMAGE_IMGBTN_LEFT
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_LEFT uint8_t imgbtn_left_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMGBTN_LEFT uint8_t imgbtn_left_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x68, 0x03, 0x68, 0x14, 0x68, 0x23,
@@ -172,7 +172,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_LE
#endif
};
const lv_img_dsc_t imgbtn_left = {
const lv_image_dsc_t imgbtn_left = {
.header.always_zero = 0,
.header.w = 8,
.header.h = 50,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMGBTN_MID
#define LV_ATTRIBUTE_IMG_IMGBTN_MID
#ifndef LV_ATTRIBUTE_IMAGE_IMGBTN_MID
#define LV_ATTRIBUTE_IMAGE_IMGBTN_MID
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_MID uint8_t imgbtn_mid_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMGBTN_MID uint8_t imgbtn_mid_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x68, 0x27, 0x68, 0x27, 0x68, 0x27, 0x68, 0x27, 0x68, 0x27,
@@ -169,7 +169,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_MI
#endif
};
const lv_img_dsc_t imgbtn_mid = {
const lv_image_dsc_t imgbtn_mid = {
.header.always_zero = 0,
.header.w = 5,
.header.h = 49,

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_IMGBTN_RIGHT
#define LV_ATTRIBUTE_IMG_IMGBTN_RIGHT
#ifndef LV_ATTRIBUTE_IMAGE_IMGBTN_RIGHT
#define LV_ATTRIBUTE_IMAGE_IMGBTN_RIGHT
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_RIGHT uint8_t imgbtn_right_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_IMGBTN_RIGHT uint8_t imgbtn_right_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Blue: 2 bit, Green: 3 bit, Red: 3 bit, Alpha 8 bit */
0x68, 0x23, 0x68, 0x14, 0x68, 0x04, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -172,7 +172,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_IMGBTN_RI
#endif
};
const lv_img_dsc_t imgbtn_right = {
const lv_image_dsc_t imgbtn_right = {
.header.always_zero = 0,
.header.w = 8,
.header.h = 50,

View File

@@ -17,7 +17,7 @@ static void event_cb(lv_event_t * e)
*/
void lv_example_event_1(void)
{
lv_obj_t * btn = lv_btn_create(lv_scr_act());
lv_obj_t * btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 50);
lv_obj_center(btn);
lv_obj_add_event(btn, event_cb, LV_EVENT_CLICKED, NULL);

View File

@@ -5,20 +5,20 @@ class Event_1():
# Add click event to a button
#
btn = lv.btn(lv.scr_act())
btn.set_size(100, 50)
btn.center()
btn.add_event(self.event_cb, lv.EVENT.CLICKED, None)
button = lv.button(lv.scr_act())
button.set_size(100, 50)
button.center()
button.add_event(self.event_cb, lv.EVENT.CLICKED, None)
label = lv.label(btn)
label = lv.label(button)
label.set_text("Click me!")
label.center()
def event_cb(self,e):
print("Clicked")
btn = e.get_target_obj()
label = btn.get_child(0)
button = e.get_target_obj()
label = button.get_child(0)
label.set_text(str(self.cnt))
self.cnt += 1

View File

@@ -29,7 +29,7 @@ static void event_cb(lv_event_t * e)
*/
void lv_example_event_2(void)
{
lv_obj_t * btn = lv_btn_create(lv_scr_act());
lv_obj_t * btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 50);
lv_obj_center(btn);

View File

@@ -8,15 +8,15 @@ def event_cb(e,label):
label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED")
elif code == lv.EVENT.LONG_PRESSED_REPEAT:
label.set_text("The last button event:\nLV_EVENT_LONG_PRESSED_REPEAT")
btn = lv.btn(lv.scr_act())
btn.set_size(100, 50)
btn.center()
button = lv.button(lv.scr_act())
button.set_size(100, 50)
button.center()
btn_label = lv.label(btn)
btn_label.set_text("Click me!")
btn_label.center()
button_label = lv.label(button)
button_label.set_text("Click me!")
button_label.center()
info_label = lv.label(lv.scr_act())
info_label.set_text("The last button event:\nNone")
btn.add_event(lambda e: event_cb(e,info_label), lv.EVENT.ALL, None)
button.add_event(lambda e: event_cb(e,info_label), lv.EVENT.ALL, None)

View File

@@ -29,7 +29,7 @@ void lv_example_event_3(void)
uint32_t i;
for(i = 0; i < 30; i++) {
lv_obj_t * btn = lv_btn_create(cont);
lv_obj_t * btn = lv_button_create(cont);
lv_obj_set_size(btn, 70, 50);
lv_obj_add_flag(btn, LV_OBJ_FLAG_EVENT_BUBBLE);

View File

@@ -23,11 +23,11 @@ cont.center()
cont.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
for i in range(30):
btn = lv.btn(cont)
btn.set_size(70, 50)
btn.add_flag(lv.obj.FLAG.EVENT_BUBBLE)
button = lv.button(cont)
button.set_size(70, 50)
button.add_flag(lv.obj.FLAG.EVENT_BUBBLE)
label = lv.label(btn)
label = lv.label(button)
label.set_text("{:d}".format(i))
label.center()

View File

@@ -20,7 +20,7 @@ static void btn_event_cb(lv_event_t * e)
*/
void lv_example_get_started_2(void)
{
lv_obj_t * btn = lv_btn_create(lv_scr_act()); /*Add a button the current screen*/
lv_obj_t * btn = lv_button_create(lv_scr_act()); /*Add a button the current screen*/
lv_obj_set_pos(btn, 10, 10); /*Set its position*/
lv_obj_set_size(btn, 120, 50); /*Set its size*/
lv_obj_add_event(btn, btn_event_cb, LV_EVENT_ALL, NULL); /*Assign a callback to the button*/

View File

@@ -5,23 +5,23 @@ class CounterBtn():
# Create a button with a label and react on click event.
#
btn = lv.btn(lv.scr_act()) # Add a button the current screen
btn.set_pos(10, 10) # Set its position
btn.set_size(120, 50) # Set its size
btn.align(lv.ALIGN.CENTER,0,0)
btn.add_event(self.btn_event_cb, lv.EVENT.ALL, None) # Assign a callback to the button
label = lv.label(btn) # Add a label to the button
button = lv.button(lv.scr_act()) # Add a button the current screen
button.set_pos(10, 10) # Set its position
button.set_size(120, 50) # Set its size
button.align(lv.ALIGN.CENTER,0,0)
button.add_event(self.button_event_cb, lv.EVENT.ALL, None) # Assign a callback to the button
label = lv.label(button) # Add a label to the button
label.set_text("Button") # Set the labels text
label.center()
def btn_event_cb(self,e):
def button_event_cb(self,e):
code = e.get_code()
btn = e.get_target_obj()
button = e.get_target_obj()
if code == lv.EVENT.CLICKED:
self.cnt += 1
# Get the first child of the button which is the label and change its text
label = btn.get_child(0)
label = button.get_child(0)
label.set_text("Button: " + str(self.cnt))

View File

@@ -2,8 +2,8 @@
#if LV_USE_BTN && LV_BUILD_EXAMPLES
static lv_style_t style_btn;
static lv_style_t style_btn_pressed;
static lv_style_t style_btn_red;
static lv_style_t style_button_pressed;
static lv_style_t style_button_red;
static lv_color_t darken(const lv_color_filter_dsc_t * dsc, lv_color_t color, lv_opa_t opa)
{
@@ -31,14 +31,14 @@ static void style_init(void)
*Use a color filter to simply modify all colors in this state*/
static lv_color_filter_dsc_t color_filter;
lv_color_filter_dsc_init(&color_filter, darken);
lv_style_init(&style_btn_pressed);
lv_style_set_color_filter_dsc(&style_btn_pressed, &color_filter);
lv_style_set_color_filter_opa(&style_btn_pressed, LV_OPA_20);
lv_style_init(&style_button_pressed);
lv_style_set_color_filter_dsc(&style_button_pressed, &color_filter);
lv_style_set_color_filter_opa(&style_button_pressed, LV_OPA_20);
/*Create a red style. Change only some colors.*/
lv_style_init(&style_btn_red);
lv_style_set_bg_color(&style_btn_red, lv_palette_main(LV_PALETTE_RED));
lv_style_set_bg_grad_color(&style_btn_red, lv_palette_lighten(LV_PALETTE_RED, 3));
lv_style_init(&style_button_red);
lv_style_set_bg_color(&style_button_red, lv_palette_main(LV_PALETTE_RED));
lv_style_set_bg_grad_color(&style_button_red, lv_palette_lighten(LV_PALETTE_RED, 3));
}
/**
@@ -50,7 +50,7 @@ void lv_example_get_started_3(void)
style_init();
/*Create a button and use the new styles*/
lv_obj_t * btn = lv_btn_create(lv_scr_act());
lv_obj_t * btn = lv_button_create(lv_scr_act());
/* Remove the styles coming from the theme
* Note that size and position are also stored as style properties
* so lv_obj_remove_style_all will remove the set size and position too */
@@ -58,7 +58,7 @@ void lv_example_get_started_3(void)
lv_obj_set_pos(btn, 10, 10);
lv_obj_set_size(btn, 120, 50);
lv_obj_add_style(btn, &style_btn, 0);
lv_obj_add_style(btn, &style_btn_pressed, LV_STATE_PRESSED);
lv_obj_add_style(btn, &style_button_pressed, LV_STATE_PRESSED);
/*Add a label to the button*/
lv_obj_t * label = lv_label_create(btn);
@@ -66,13 +66,13 @@ void lv_example_get_started_3(void)
lv_obj_center(label);
/*Create another button and use the red style too*/
lv_obj_t * btn2 = lv_btn_create(lv_scr_act());
lv_obj_t * btn2 = lv_button_create(lv_scr_act());
lv_obj_remove_style_all(btn2); /*Remove the styles coming from the theme*/
lv_obj_set_pos(btn2, 10, 80);
lv_obj_set_size(btn2, 120, 50);
lv_obj_add_style(btn2, &style_btn, 0);
lv_obj_add_style(btn2, &style_btn_red, 0);
lv_obj_add_style(btn2, &style_btn_pressed, LV_STATE_PRESSED);
lv_obj_add_style(btn2, &style_button_red, 0);
lv_obj_add_style(btn2, &style_button_pressed, LV_STATE_PRESSED);
lv_obj_set_style_radius(btn2, LV_RADIUS_CIRCLE, 0); /*Add a local style too*/
label = lv_label_create(btn2);

View File

@@ -1,48 +1,48 @@
#
# Create styles from scratch for buttons.
#
style_btn = lv.style_t()
style_btn_red = lv.style_t()
style_btn_pressed = lv.style_t()
style_button = lv.style_t()
style_button_red = lv.style_t()
style_button_pressed = lv.style_t()
# Create a simple button style
style_btn.init()
style_btn.set_radius(10)
style_btn.set_bg_opa(lv.OPA.COVER)
style_btn.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
style_btn.set_bg_grad_color(lv.palette_main(lv.PALETTE.GREY))
style_btn.set_bg_grad_dir(lv.GRAD_DIR.VER)
style_button.init()
style_button.set_radius(10)
style_button.set_bg_opa(lv.OPA.COVER)
style_button.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
style_button.set_bg_grad_color(lv.palette_main(lv.PALETTE.GREY))
style_button.set_bg_grad_dir(lv.GRAD_DIR.VER)
# Add a border
style_btn.set_border_color(lv.color_white())
style_btn.set_border_opa(lv.OPA._70)
style_btn.set_border_width(2)
style_button.set_border_color(lv.color_white())
style_button.set_border_opa(lv.OPA._70)
style_button.set_border_width(2)
# Set the text style
style_btn.set_text_color(lv.color_white())
style_button.set_text_color(lv.color_white())
# Create a red style. Change only some colors.
style_btn_red.init()
style_btn_red.set_bg_color(lv.palette_main(lv.PALETTE.RED))
style_btn_red.set_bg_grad_color(lv.palette_lighten(lv.PALETTE.RED, 2))
style_button_red.init()
style_button_red.set_bg_color(lv.palette_main(lv.PALETTE.RED))
style_button_red.set_bg_grad_color(lv.palette_lighten(lv.PALETTE.RED, 2))
# Create a style for the pressed state.
style_btn_pressed.init()
style_btn_pressed.set_bg_color(lv.palette_main(lv.PALETTE.BLUE))
style_btn_pressed.set_bg_grad_color(lv.palette_darken(lv.PALETTE.RED, 3))
style_button_pressed.init()
style_button_pressed.set_bg_color(lv.palette_main(lv.PALETTE.BLUE))
style_button_pressed.set_bg_grad_color(lv.palette_darken(lv.PALETTE.RED, 3))
# Create a button and use the new styles
btn = lv.btn(lv.scr_act()) # Add a button the current screen
button = lv.button(lv.scr_act()) # Add a button the current screen
# Remove the styles coming from the theme
# Note that size and position are also stored as style properties
# so lv_obj_remove_style_all will remove the set size and position too
btn.remove_style_all() # Remove the styles coming from the theme
btn.set_pos(10, 10) # Set its position
btn.set_size(120, 50) # Set its size
btn.add_style(style_btn, 0)
btn.add_style(style_btn_pressed, lv.STATE.PRESSED)
button.remove_style_all() # Remove the styles coming from the theme
button.set_pos(10, 10) # Set its position
button.set_size(120, 50) # Set its size
button.add_style(style_button, 0)
button.add_style(style_button_pressed, lv.STATE.PRESSED)
label = lv.label(btn) # Add a label to the button
label = lv.label(button) # Add a label to the button
label.set_text("Button") # Set the labels text
label.center()
@@ -52,16 +52,16 @@ slider.set_width(200) # Set the wid
slider.center() # Align to the center of the parent (screen)
# Create another button and use the red style too
btn2 = lv.btn(lv.scr_act())
btn2.remove_style_all() # Remove the styles coming from the theme
btn2.set_pos(10, 80) # Set its position
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
button2 = lv.button(lv.scr_act())
button2.remove_style_all() # Remove the styles coming from the theme
button2.set_pos(10, 80) # Set its position
button2.set_size(120, 50) # Set its size
button2.add_style(style_button, 0)
button2.add_style(style_button_red, 0)
button2.add_style(style_button_pressed, lv.STATE.PRESSED)
button2.set_style_radius(lv.RADIUS_CIRCLE, 0) # Add a local style
label = lv.label(btn2) # Add a label to the button
label = lv.label(button2) # Add a label to the button
label.set_text("Button 2") # Set the labels text
label.center()

View File

@@ -24,7 +24,7 @@ void lv_example_flex_1(void)
lv_obj_t * label;
/*Add items to the row*/
obj = lv_btn_create(cont_row);
obj = lv_button_create(cont_row);
lv_obj_set_size(obj, 100, LV_PCT(100));
label = lv_label_create(obj);
@@ -32,7 +32,7 @@ void lv_example_flex_1(void)
lv_obj_center(label);
/*Add items to the column*/
obj = lv_btn_create(cont_col);
obj = lv_button_create(cont_col);
lv_obj_set_size(obj, LV_PCT(100), LV_SIZE_CONTENT);
label = lv_label_create(obj);

View File

@@ -16,7 +16,7 @@ cont_col.set_flex_flow(lv.FLEX_FLOW.COLUMN)
for i in range(10):
# Add items to the row
obj = lv.btn(cont_row)
obj = lv.button(cont_row)
obj.set_size(100, lv.pct(100))
label = lv.label(obj)
@@ -24,7 +24,7 @@ for i in range(10):
label.center()
# Add items to the column
obj = lv.btn(cont_col)
obj = lv.button(cont_col)
obj.set_size(lv.pct(100), lv.SIZE_CONTENT)
label = lv.label(obj)

View File

@@ -25,7 +25,7 @@ void lv_example_grid_1(void)
uint8_t col = i % 3;
uint8_t row = i / 3;
obj = lv_btn_create(cont);
obj = lv_button_create(cont);
/*Stretch the cell horizontally and vertically too
*Set span to 1 to make the cell 1 column/row sized*/
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_STRETCH, col, 1,

View File

@@ -17,7 +17,7 @@ for i in range(9):
col = i % 3
row = i // 3
obj = lv.btn(cont)
obj = lv.button(cont)
# Stretch the cell horizontally and vertically too
# Set span to 1 to make the cell 1 column/row sized
obj.set_grid_cell(lv.GRID_ALIGN.STRETCH, col, 1,

View File

@@ -6,10 +6,10 @@
*/
void lv_example_bmp_1(void)
{
lv_obj_t * img = lv_img_create(lv_scr_act());
lv_obj_t * img = lv_image_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp");
lv_image_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp");
lv_obj_center(img);
}

View File

@@ -8,8 +8,8 @@
*/
void lv_example_ffmpeg_1(void)
{
lv_obj_t * img = lv_img_create(lv_scr_act());
lv_img_set_src(img, "./lvgl/examples/libs/ffmpeg/ffmpeg.png");
lv_obj_t * img = lv_image_create(lv_scr_act());
lv_image_set_src(img, "./lvgl/examples/libs/ffmpeg/ffmpeg.png");
lv_obj_center(img);
}

View File

@@ -7,9 +7,9 @@ try:
#
# Open an image from a file
#
img = lv.img(lv.scr_act())
img.set_src("ffmpeg.png")
img.center()
image = lv.image(lv.scr_act())
image.set_src("ffmpeg.png")
image.center()
except Exception as e:
print(e)
# TODO

View File

@@ -5,11 +5,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_BULB_GIF
#define LV_ATTRIBUTE_IMG_BULB_GIF
#ifndef LV_ATTRIBUTE_IMAGE_BULB_GIF
#define LV_ATTRIBUTE_IMAGE_BULB_GIF
#endif
static const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BULB_GIF uint8_t img_blub_gif_map[] = {
static const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_BULB_GIF uint8_t img_blub_gif_map[] = {
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x3c, 0x00, 0x50, 0x00, 0xf7, 0x00, 0x00, 0xfa, 0xfb, 0xfb,
0xfd, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0xd9, 0xec, 0xfe, 0x1e, 0x93, 0xfe, 0x23, 0x95, 0xfd, 0x5f,
0xb2, 0xff, 0x52, 0xac, 0xfe, 0xb1, 0xd8, 0xff, 0xce, 0xe7, 0xff, 0xa3, 0xd2, 0xff, 0x80, 0xc0,
@@ -1118,7 +1118,7 @@ static const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_BU
0x34, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x84, 0x0b, 0x00, 0x3b,
};
const lv_img_dsc_t img_bulb_gif = {
const lv_image_dsc_t img_bulb_gif = {
.header.always_zero = 0,
.header.w = 0,
.header.h = 0,

View File

@@ -6,7 +6,7 @@
*/
void lv_example_gif_1(void)
{
LV_IMG_DECLARE(img_bulb_gif);
LV_IMAGE_DECLARE(img_bulb_gif);
lv_obj_t * img;
img = lv_gif_create(lv_scr_act());

View File

@@ -9,19 +9,19 @@ fs_driver.fs_register(fs_drv, 'S')
#
# Open a GIF image from a file and a variable
#
img_bulb_gif = lv.img_dsc_t(
image_bulb_gif = lv.image_dsc_t(
{
"header": {"always_zero": 0, "w": 0, "h": 0, "cf": lv.COLOR_FORMAT.RAW},
"data_size": 0,
"data": img_bulb_gif_map,
}
)
img1 = lv.gif(lv.scr_act())
img1.set_src(img_bulb_gif)
img1.align(lv.ALIGN.RIGHT_MID, -150, 0)
image1 = lv.gif(lv.scr_act())
image1.set_src(image_bulb_gif)
image1.align(lv.ALIGN.RIGHT_MID, -150, 0)
img2 = lv.gif(lv.scr_act())
image2 = lv.gif(lv.scr_act())
# The File system is attached to letter 'S'
img2.set_src("S:bulb.gif")
img2.align(lv.ALIGN.RIGHT_MID, -250, 0)
image2.set_src("S:bulb.gif")
image2.align(lv.ALIGN.RIGHT_MID, -250, 0)

View File

@@ -6,11 +6,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_PNG_DECODER_TEST
#define LV_ATTRIBUTE_IMG_PNG_DECODER_TEST
#ifndef LV_ATTRIBUTE_IMAGE_PNG_DECODER_TEST
#define LV_ATTRIBUTE_IMAGE_PNG_DECODER_TEST
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_PNG_DECODER_TEST uint8_t img_wink_png_map[] = {
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_PNG_DECODER_TEST uint8_t img_wink_png_map[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x32, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1e, 0x3f, 0x88,
0xb1, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,
@@ -336,7 +336,7 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_PNG_DECOD
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const lv_img_dsc_t img_wink_png = {
const lv_image_dsc_t img_wink_png = {
.header.always_zero = 0,
.header.w = 50,
.header.h = 50,

View File

@@ -325,13 +325,13 @@ img_wink_png_map = bytes([
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
])
'''
const lv_img_dsc_t img_wink_png = {
const lv_image_dsc_t image_wink_png = {
.header.always_zero = 0,
.header.w = 50,
.header.h = 50,
.data_size = 5158,
.header.cf = LV_IMG_CF_RAW_ALPHA,
.data = img_wink_png_map,
.header.cf = LV_IMAGE_CF_RAW_ALPHA,
.data = image_wink_png_map,
};
'''

View File

@@ -6,17 +6,17 @@
*/
void lv_example_png_1(void)
{
LV_IMG_DECLARE(img_wink_png);
LV_IMAGE_DECLARE(img_wink_png);
lv_obj_t * img;
img = lv_img_create(lv_scr_act());
lv_img_set_src(img, &img_wink_png);
img = lv_image_create(lv_scr_act());
lv_image_set_src(img, &img_wink_png);
lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0);
img = lv_img_create(lv_scr_act());
img = lv_image_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_img_set_src(img, "A:lvgl/examples/libs/png/wink.png");
lv_image_set_src(img, "A:lvgl/examples/libs/png/wink.png");
lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0);
}

View File

@@ -3,16 +3,16 @@ import lvgl as lv
import display_driver
from img_wink_png import img_wink_png_map
img_wink_png = lv.img_dsc_t(
image_wink_png = lv.image_dsc_t(
{
"header": {"always_zero": 0, "w": 50, "h": 50, "cf": lv.COLOR_FORMAT.RAW_ALPHA},
"data_size": 5158,
"data": img_wink_png_map,
}
)
img1 = lv.img(lv.scr_act())
img1.set_src(img_wink_png)
img1.align(lv.ALIGN.RIGHT_MID, -250, 0)
image1 = lv.image(lv.scr_act())
image1.set_src(image_wink_png)
image1.align(lv.ALIGN.RIGHT_MID, -250, 0)
# Create an image from the png file
try:
@@ -22,11 +22,11 @@ except:
print("Could not find wink.png")
sys.exit()
wink_argb = lv.img_dsc_t({
wink_argb = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
img2 = lv.img(lv.scr_act())
img2.set_src(wink_argb)
img2.align(lv.ALIGN.RIGHT_MID, -150, 0)
image2 = lv.image(lv.scr_act())
image2.set_src(wink_argb)
image2.align(lv.ALIGN.RIGHT_MID, -150, 0)

View File

@@ -8,10 +8,10 @@ void lv_example_sjpg_1(void)
{
lv_obj_t * wp;
wp = lv_img_create(lv_scr_act());
wp = lv_image_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_img_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg");
lv_image_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg");
}
#endif

View File

@@ -6,7 +6,7 @@ import fs_driver
fs_drv = lv.fs_drv_t()
fs_driver.fs_register(fs_drv, 'S')
wp = lv.img(lv.scr_act())
wp = lv.image(lv.scr_act())
# The File system is attached to letter 'S'
wp.set_src("S:small_image.sjpg")

View File

@@ -113,7 +113,7 @@ void lv_example_file_explorer_2(void)
/*Quick access status control button*/
lv_obj_t * fe_quick_access_obj = lv_file_explorer_get_quick_access_area(file_explorer);
lv_obj_t * fe_header_obj = lv_file_explorer_get_header(file_explorer);
lv_obj_t * btn = lv_btn_create(fe_header_obj);
lv_obj_t * btn = lv_button_create(fe_header_obj);
lv_obj_set_style_radius(btn, 2, 0);
lv_obj_set_style_pad_all(btn, 4, 0);
lv_obj_align(btn, LV_ALIGN_LEFT_MID, 0, 0);

View File

@@ -14,14 +14,14 @@ def file_explorer_event_handler(e):
sel_fn = obj.explorer_get_selected_file_name()
print(str(cur_path) + str(sel_fn))
def btn_event_handler(e,fe_quick_access_obj):
def button_event_handler(e,fe_quick_access_obj):
code = e.get_code()
btn = e.get_target_obj()
button = e.get_target_obj()
# lv_obj_t * file_explorer = lv_event_get_user_data(e);
if code == lv.EVENT.VALUE_CHANGED :
if btn.has_state(lv.STATE.CHECKED) :
if button.has_state(lv.STATE.CHECKED) :
fe_quick_access_obj.add_flag(lv.obj.FLAG.HIDDEN)
else :
fe_quick_access_obj.clear_flag(lv.obj.FLAG.HIDDEN)
@@ -73,18 +73,18 @@ file_explorer.add_event(file_explorer_event_handler, lv.EVENT.ALL, None)
# Quick access status control button
fe_quick_access_obj = file_explorer.explorer_get_quick_access_area()
fe_header_obj = file_explorer.explorer_get_header()
btn = lv.btn(fe_header_obj)
btn.set_style_radius(2, 0)
btn.set_style_pad_all(4, 0)
btn.align(lv.ALIGN.LEFT_MID, 0, 0)
btn.add_flag(lv.obj.FLAG.CHECKABLE)
button = lv.button(fe_header_obj)
button.set_style_radius(2, 0)
button.set_style_pad_all(4, 0)
button.align(lv.ALIGN.LEFT_MID, 0, 0)
button.add_flag(lv.obj.FLAG.CHECKABLE)
label = lv.label(btn)
label = lv.label(button)
label.set_text(lv.SYMBOL.LIST)
label.center()
btn.add_event(lambda evt: btn_event_handler(evt,fe_quick_access_obj), lv.EVENT.VALUE_CHANGED, None)
#btn.add_event(lambda evt: btn_event_handler(evt,file_explorer), lv.EVENT.VALUE_CHANGED, None)
button.add_event(lambda evt: button_event_handler(evt,fe_quick_access_obj), lv.EVENT.VALUE_CHANGED, None)
#button.add_event(lambda evt: button_event_handler(evt,file_explorer), lv.EVENT.VALUE_CHANGED, None)
# Sort control
opts = "NONE\nKIND"
@@ -95,7 +95,7 @@ dd.set_style_pad_all(0, 0)
dd.set_size(lv.pct(30), lv.SIZE_CONTENT)
dd.set_options_static(opts)
dd.align(lv.ALIGN.RIGHT_MID, 0, 0)
# lv_obj_align_to(dd, btn, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
# lv_obj_align_to(dd, button, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
dd.add_event(lambda evt: dd_event_handler(evt,file_explorer), lv.EVENT.VALUE_CHANGED, None)
#dd.add_event(lambda evt: dd_event_handler(evt,fe_quick_access_obj), lv.EVENT.VALUE_CHANGED, None)

View File

@@ -45,11 +45,11 @@ void lv_example_fragment_2(void)
lv_obj_remove_style_all(container);
lv_obj_set_grid_cell(container, LV_GRID_ALIGN_STRETCH, 0, 2, LV_GRID_ALIGN_STRETCH, 0, 1);
lv_obj_t * push_btn = lv_btn_create(root);
lv_obj_t * push_btn = lv_button_create(root);
lv_obj_t * push_label = lv_label_create(push_btn);
lv_label_set_text(push_label, "Push");
lv_obj_t * pop_btn = lv_btn_create(root);
lv_obj_t * pop_btn = lv_button_create(root);
lv_obj_t * pop_label = lv_label_create(pop_btn);
lv_label_set_text(pop_label, "Pop");
lv_obj_set_grid_cell(push_btn, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_CENTER, 1, 1);
@@ -89,7 +89,7 @@ static lv_obj_t * sample_fragment_create_obj(lv_fragment_t * self, lv_obj_t * pa
fragment->label = label;
lv_label_set_text_fmt(label, "The button has been pressed %d times", fragment->counter);
lv_obj_t * inc_btn = lv_btn_create(content);
lv_obj_t * inc_btn = lv_button_create(content);
lv_obj_t * inc_label = lv_label_create(inc_btn);
lv_label_set_text(inc_label, "+1");
lv_obj_add_event(inc_btn, sample_fragment_inc_click, LV_EVENT_CLICKED, fragment);

View File

@@ -25,7 +25,7 @@ void lv_example_gridnav_1(void)
uint32_t i;
for(i = 0; i < 10; i++) {
lv_obj_t * obj = lv_btn_create(cont1);
lv_obj_t * obj = lv_button_create(cont1);
lv_obj_set_size(obj, 70, LV_SIZE_CONTENT);
lv_obj_add_flag(obj, LV_OBJ_FLAG_CHECKABLE);
lv_group_remove_obj(obj); /*Not needed, we use the gridnav instead*/

View File

@@ -19,7 +19,7 @@ label = lv.label(cont1)
label.set_text("No rollover")
for i in range(10):
obj = lv.btn(cont1)
obj = lv.button(cont1)
obj.set_size(70, lv.SIZE_CONTENT)
obj.add_flag(lv.obj.FLAG.CHECKABLE)
lv.group_remove_obj(obj) # Not needed, we use the gridnav instead

View File

@@ -21,7 +21,7 @@ void lv_example_gridnav_2(void)
uint32_t i;
for(i = 0; i < 15; i++) {
lv_snprintf(buf, sizeof(buf), "File %d", i + 1);
lv_obj_t * item = lv_list_add_btn(list1, LV_SYMBOL_FILE, buf);
lv_obj_t * item = lv_list_add_button(list1, LV_SYMBOL_FILE, buf);
lv_obj_set_style_bg_opa(item, 0, 0);
lv_group_remove_obj(item); /*Not needed, we use the gridnav instead*/
}
@@ -35,7 +35,7 @@ void lv_example_gridnav_2(void)
for(i = 0; i < 15; i++) {
lv_snprintf(buf, sizeof(buf), "Folder %d", i + 1);
lv_obj_t * item = lv_list_add_btn(list2, LV_SYMBOL_DIRECTORY, buf);
lv_obj_t * item = lv_list_add_button(list2, LV_SYMBOL_DIRECTORY, buf);
lv_obj_set_style_bg_opa(item, 0, 0);
lv_group_remove_obj(item);
}

View File

@@ -13,7 +13,7 @@ lv.group_get_default().add_obj(list1)
for i in range(15):
item_text = "File {:d}".format(i)
item = list1.add_btn(lv.SYMBOL.FILE, item_text)
item = list1.add_button(lv.SYMBOL.FILE, item_text)
item.set_style_bg_opa(0, 0)
lv.group_remove_obj(item) # Not needed, we use the gridnav instead
@@ -26,7 +26,7 @@ lv.group_get_default().add_obj(list2)
for i in range(15):
item_text = "Folder {:d}".format(i)
item = list2.add_btn(lv.SYMBOL.DIRECTORY, item_text)
item = list2.add_button(lv.SYMBOL.DIRECTORY, item_text)
item.set_style_bg_opa(0, 0)
lv.group_remove_obj(item)

View File

@@ -36,12 +36,12 @@ void lv_example_gridnav_3(void)
lv_obj_t * btn;
lv_obj_t * label;
btn = lv_btn_create(cont_main);
btn = lv_button_create(cont_main);
lv_group_remove_obj(btn);
label = lv_label_create(btn);
lv_label_set_text(label, "Button 1");
btn = lv_btn_create(cont_main);
btn = lv_button_create(cont_main);
lv_group_remove_obj(btn);
label = lv_label_create(btn);
lv_label_set_text(label, "Button 2");
@@ -83,12 +83,12 @@ void lv_example_gridnav_3(void)
lv_label_set_text(label, "Use ENTER/ESC to focus/defocus this container");
lv_obj_set_width(label, lv_pct(100));
btn = lv_btn_create(cont_sub2);
btn = lv_button_create(cont_sub2);
lv_group_remove_obj(btn);
label = lv_label_create(btn);
lv_label_set_text(label, "Button 3");
btn = lv_btn_create(cont_sub2);
btn = lv_button_create(cont_sub2);
lv_group_remove_obj(btn);
label = lv_label_create(btn);
lv_label_set_text(label, "Button 4");

View File

@@ -24,14 +24,14 @@ cont_main.set_flex_flow(lv.FLEX_FLOW.ROW_WRAP)
cont_main.set_style_bg_color(lv.palette_lighten(lv.PALETTE.BLUE, 5), lv.STATE.FOCUSED)
cont_main.set_size(lv.pct(80), lv.SIZE_CONTENT)
btn = lv.btn(cont_main)
lv.group_remove_obj(btn)
label = lv.label(btn)
button = lv.button(cont_main)
lv.group_remove_obj(button)
label = lv.label(button)
label.set_text("Button 1")
btn = lv.btn(cont_main)
lv.group_remove_obj(btn)
label = lv.label(btn)
button = lv.button(cont_main)
lv.group_remove_obj(button)
label = lv.label(button)
label.set_text("Button 2");
@@ -72,13 +72,13 @@ label = lv.label(cont_sub2)
label.set_text("Use ENTER/ESC to focus/defocus this container")
label.set_width(lv.pct(100))
btn = lv.btn(cont_sub2)
lv.group_remove_obj(btn)
label = lv.label(btn)
button = lv.button(cont_sub2)
lv.group_remove_obj(button)
label = lv.label(button)
label.set_text("Button 3")
btn = lv.btn(cont_sub2)
lv.group_remove_obj(btn)
label = lv.label(btn)
button = lv.button(cont_sub2)
lv.group_remove_obj(button)
label = lv.label(button)
label.set_text("Button 4")

View File

@@ -6,7 +6,7 @@ static void event_handler(lv_event_t * e)
{
lv_obj_t * obj = lv_event_get_target(e);
lv_obj_t * list = lv_obj_get_parent(obj);
LV_LOG_USER("Clicked: %s", lv_list_get_btn_text(list, obj));
LV_LOG_USER("Clicked: %s", lv_list_get_button_text(list, obj));
}
/**
@@ -33,12 +33,12 @@ void lv_example_gridnav_4(void)
}
lv_snprintf(buf, sizeof(buf), "File %d", i + 1);
lv_obj_t * item = lv_list_add_btn(list, LV_SYMBOL_FILE, buf);
lv_obj_t * item = lv_list_add_button(list, LV_SYMBOL_FILE, buf);
lv_obj_add_event(item, event_handler, LV_EVENT_CLICKED, NULL);
lv_group_remove_obj(item); /*The default group adds it automatically*/
}
lv_obj_t * btn = lv_btn_create(lv_scr_act());
lv_obj_t * btn = lv_button_create(lv_scr_act());
lv_obj_align(btn, LV_ALIGN_RIGHT_MID, -10, 0);
lv_obj_t * label = lv_label_create(btn);
lv_label_set_text(label, "Button");

View File

@@ -1,7 +1,7 @@
def event_handler(e):
obj = e.get_target_obj()
list = obj.get_parent()
print("Clicked: " + list.get_btn_text(obj))
print("Clicked: " + list.get_button_text(obj))
#
@@ -25,12 +25,12 @@ for i in range(20):
txt = "File {:d}".format(i + 1)
#lv_snprintf(buf, sizeof(buf), "File %d", i + 1);
item = list.add_btn(lv.SYMBOL.FILE, txt)
item = list.add_button(lv.SYMBOL.FILE, txt)
item.add_event(event_handler, lv.EVENT.CLICKED, None)
lv.group_remove_obj(item) # The default group adds it automatically
btn = lv.btn(lv.scr_act())
btn.align(lv.ALIGN.RIGHT_MID, 0, -10)
label = lv.label(btn)
button = lv.button(lv.scr_act())
button.align(lv.ALIGN.RIGHT_MID, 0, -10)
label = lv.label(button)
label.set_text("Button")

View File

@@ -4,7 +4,7 @@
#if LV_BUILD_EXAMPLES
#if LV_USE_IMGFONT
LV_IMG_DECLARE(emoji_F617)
LV_IMAGE_DECLARE(emoji_F617)
char path_buf[128];
static const void * get_imgfont_path(const lv_font_t * font, uint32_t unicode, uint32_t unicode_next,
lv_coord_t * offset_y, void * user_data)

View File

@@ -40,7 +40,7 @@ void lv_example_msg_2(void)
lv_obj_t * label;
/*Create a log out button which will be active only when logged in*/
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_set_pos(btn, 240, 10);
lv_obj_add_event(btn, log_out_event_cb, LV_EVENT_ALL, NULL);
lv_msg_subscribe_obj(MSG_LOGIN_OK, btn, NULL);
@@ -59,7 +59,7 @@ void lv_example_msg_2(void)
lv_msg_subscribe_obj(MSG_LOG_OUT, label, NULL);
/*Create button which will be active only when logged in*/
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_set_pos(btn, 10, 80);
lv_obj_add_event(btn, start_engine_msg_event_cb, LV_EVENT_MSG_RECEIVED, NULL);
lv_obj_add_flag(btn, LV_OBJ_FLAG_CHECKABLE);

View File

@@ -51,22 +51,22 @@ def log_out_event_cb(e):
lv.msg_send(MSG_LOG_OUT, None)
elif code == lv.EVENT.MSG_RECEIVED:
m = e.get_msg()
btn = e.get_target_obj()
button = e.get_target_obj()
id = m.get_id()
if id == MSG_LOGIN_OK:
btn.clear_state(lv.STATE.DISABLED)
button.clear_state(lv.STATE.DISABLED)
elif id == MSG_LOG_OUT:
btn.add_state(lv.STATE.DISABLED)
button.add_state(lv.STATE.DISABLED)
def start_engine_msg_event_cb(e):
m = e.get_msg()
btn = e.get_target_obj()
button = e.get_target_obj()
id = m.get_id()
if id == MSG_LOGIN_OK:
btn.clear_state(lv.STATE.DISABLED)
button.clear_state(lv.STATE.DISABLED)
elif id == MSG_LOG_OUT:
btn.add_state(lv.STATE.DISABLED)
button.add_state(lv.STATE.DISABLED)
def info_label_msg_event_cb(e):
@@ -109,13 +109,13 @@ kb = lv.keyboard(lv.scr_act())
kb.set_textarea(ta)
# Create a log out button which will be active only when logged in
btn = lv.btn(lv.scr_act())
btn.set_pos(240, 10)
btn.add_event(log_out_event_cb, lv.EVENT.ALL, None)
lv.msg_subscribe_obj(MSG_LOGIN_OK, btn, None)
lv.msg_subscribe_obj(MSG_LOG_OUT, btn, None)
button = lv.button(lv.scr_act())
button.set_pos(240, 10)
button.add_event(log_out_event_cb, lv.EVENT.ALL, None)
lv.msg_subscribe_obj(MSG_LOGIN_OK, button, None)
lv.msg_subscribe_obj(MSG_LOG_OUT, button, None)
label = lv.label(btn);
label = lv.label(button);
label.set_text("LOG OUT")
# Create a label to show info
@@ -128,14 +128,14 @@ lv.msg_subscribe_obj(MSG_LOGIN_OK, label, None)
lv.msg_subscribe_obj(MSG_LOG_OUT, label, None)
#Create button which will be active only when logged in
btn = lv.btn(lv.scr_act())
btn.set_pos(10, 80)
btn.add_event(start_engine_msg_event_cb, lv.EVENT.MSG_RECEIVED, None)
btn.add_flag(lv.obj.FLAG.CHECKABLE)
lv.msg_subscribe_obj(MSG_LOGIN_OK, btn, None)
lv.msg_subscribe_obj(MSG_LOG_OUT, btn, None)
button = lv.button(lv.scr_act())
button.set_pos(10, 80)
button.add_event(start_engine_msg_event_cb, lv.EVENT.MSG_RECEIVED, None)
button.add_flag(lv.obj.FLAG.CHECKABLE)
lv.msg_subscribe_obj(MSG_LOGIN_OK, button, None)
lv.msg_subscribe_obj(MSG_LOG_OUT, button, None)
label = lv.label(btn)
label = lv.label(button)
label.set_text("START ENGINE")
lv.msg_send(MSG_LOG_OUT, None)

View File

@@ -27,7 +27,7 @@ void lv_example_msg_3(void)
lv_obj_t * label;
/*Up button*/
btn = lv_btn_create(panel);
btn = lv_button_create(panel);
lv_obj_set_flex_grow(btn, 1);
lv_obj_add_event(btn, btn_event_cb, LV_EVENT_ALL, NULL);
label = lv_label_create(btn);
@@ -43,7 +43,7 @@ void lv_example_msg_3(void)
lv_obj_add_event(label, label_event_cb, LV_EVENT_MSG_RECEIVED, NULL);
/*Down button*/
btn = lv_btn_create(panel);
btn = lv_button_create(panel);
lv_obj_set_flex_grow(btn, 1);
lv_obj_add_event(btn, btn_event_cb, LV_EVENT_ALL, NULL);
label = lv_label_create(btn);

View File

@@ -28,10 +28,10 @@ class LV_Example_Msg_2:
panel.set_flex_align(lv.FLEX_ALIGN.SPACE_BETWEEN, lv.FLEX_ALIGN.CENTER, lv.FLEX_ALIGN.START)
# Up button
btn = lv.btn(panel)
btn.set_flex_grow(1)
btn.add_event(self.btn_event_cb, lv.EVENT.ALL, None)
label = lv.label(btn)
button = lv.button(panel)
button.set_flex_grow(1)
button.add_event(self.button_event_cb, lv.EVENT.ALL, None)
label = lv.label(button)
label.set_text(lv.SYMBOL.LEFT)
label.center()
@@ -44,10 +44,10 @@ class LV_Example_Msg_2:
label.add_event(self.label_event_cb, lv.EVENT.MSG_RECEIVED, None)
# Down button
btn = lv.btn(panel)
btn.set_flex_grow(1)
btn.add_event(self.btn_event_cb, lv.EVENT.ALL, None)
label = lv.label(btn)
button = lv.button(panel)
button.set_flex_grow(1)
button.add_event(self.button_event_cb, lv.EVENT.ALL, None)
label = lv.label(button)
label.set_text(lv.SYMBOL.RIGHT)
label.center()
@@ -83,11 +83,11 @@ class LV_Example_Msg_2:
if self.value != old_value:
lv.msg_send(MSG_UPDATE, NewValue(self.value));
def btn_event_cb(self,e):
btn = e.get_target_obj()
def button_event_cb(self,e):
button = e.get_target_obj()
code = e.get_code()
if code == lv.EVENT.CLICKED or code == lv.EVENT.LONG_PRESSED_REPEAT:
if btn.get_index() == 0: # rst object is the dec. button
if button.get_index() == 0: # rst object is the dec. button
lv.msg_send(MSG_DEC, None)
else :
lv.msg_send(MSG_INC, None)

View File

@@ -7,7 +7,7 @@ static void event_cb(lv_event_t * e)
lv_obj_t * img = lv_event_get_target(e);
if(snapshot_obj) {
lv_img_dsc_t * snapshot = (void *)lv_img_get_src(snapshot_obj);
lv_image_dsc_t * snapshot = (void *)lv_image_get_src(snapshot_obj);
if(snapshot) {
lv_snapshot_free(snapshot);
}
@@ -16,22 +16,22 @@ static void event_cb(lv_event_t * e)
snapshot = lv_snapshot_take(img->parent, LV_COLOR_FORMAT_ARGB8888);
if(snapshot == NULL)
return;
lv_img_set_src(snapshot_obj, snapshot);
lv_image_set_src(snapshot_obj, snapshot);
}
}
void lv_example_snapshot_1(void)
{
LV_IMG_DECLARE(img_star);
LV_IMAGE_DECLARE(img_star);
lv_obj_t * root = lv_scr_act();
lv_obj_set_style_bg_color(root, lv_palette_main(LV_PALETTE_LIGHT_BLUE), 0);
/*Create an image object to show snapshot*/
lv_obj_t * snapshot_obj = lv_img_create(root);
lv_obj_t * snapshot_obj = lv_image_create(root);
lv_obj_set_style_bg_color(snapshot_obj, lv_palette_main(LV_PALETTE_PURPLE), 0);
lv_obj_set_style_bg_opa(snapshot_obj, LV_OPA_100, 0);
lv_img_set_zoom(snapshot_obj, 128);
lv_img_set_angle(snapshot_obj, 300);
lv_image_set_zoom(snapshot_obj, 128);
lv_image_set_angle(snapshot_obj, 300);
/*Create the container and its children*/
lv_obj_t * container = lv_obj_create(root);
@@ -44,8 +44,8 @@ void lv_example_snapshot_1(void)
lv_obj_t * img;
int i;
for(i = 0; i < 4; i++) {
img = lv_img_create(container);
lv_img_set_src(img, &img_star);
img = lv_image_create(container);
lv_image_set_src(img, &img_star);
lv_obj_set_style_bg_color(img, lv_color_black(), 0);
lv_obj_set_style_bg_opa(img, LV_OPA_COVER, 0);
// lv_obj_set_style_transform_zoom(img, 400, LV_STATE_PRESSED);

View File

@@ -18,19 +18,19 @@ except:
print("Could not find star.png")
sys.exit()
img_star = lv.img_dsc_t({
image_star = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
def event_cb(e, snapshot_obj):
img = e.get_target_obj()
image = e.get_target_obj()
if snapshot_obj:
# no need to free the old source for snapshot_obj, gc will free it for us.
# take a new snapshot, overwrite the old one
dsc = lv.snapshot_take(img.get_parent(), lv.COLOR_FORMAT.NATIVE_ALPHA)
dsc = lv.snapshot_take(image.get_parent(), lv.COLOR_FORMAT.NATIVE_ALPHA)
snapshot_obj.set_src(dsc)
gc.collect()
@@ -41,7 +41,7 @@ root = lv.scr_act()
root.set_style_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE), 0)
# Create an image object to show snapshot
snapshot_obj = lv.img(root)
snapshot_obj = lv.image(root)
snapshot_obj.set_style_bg_color(lv.palette_main(lv.PALETTE.PURPLE), 0)
snapshot_obj.set_style_bg_opa(lv.OPA.COVER, 0)
snapshot_obj.set_zoom(128)
@@ -55,11 +55,11 @@ container.set_flex_align(lv.FLEX_ALIGN.SPACE_EVENLY, lv.FLEX_ALIGN.CENTER, lv.FL
container.set_style_radius(50, 0)
for i in range(4):
img = lv.img(container)
img.set_src(img_star)
img.set_style_bg_color(lv.palette_main(lv.PALETTE.GREY), 0)
img.set_style_bg_opa(lv.OPA.COVER, 0)
img.set_style_transform_zoom(400, lv.STATE.PRESSED)
img.add_flag(img.FLAG.CLICKABLE)
img.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.PRESSED, None)
img.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.RELEASED, None)
image = lv.image(container)
image.set_src(image_star)
image.set_style_bg_color(lv.palette_main(lv.PALETTE.GREY), 0)
image.set_style_bg_opa(lv.OPA.COVER, 0)
image.set_style_transform_zoom(400, lv.STATE.PRESSED)
image.add_flag(image.FLAG.CLICKABLE)
image.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.PRESSED, None)
image.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.RELEASED, None)

View File

@@ -106,8 +106,8 @@ void lv_port_indev_init(void)
lv_indev_set_read_cb(indev_mouse, mouse_read);
/*Set cursor. For simplicity set a HOME symbol now.*/
lv_obj_t * mouse_cursor = lv_img_create(lv_scr_act());
lv_img_set_src(mouse_cursor, LV_SYMBOL_HOME);
lv_obj_t * mouse_cursor = lv_image_create(lv_scr_act());
lv_image_set_src(mouse_cursor, LV_SYMBOL_HOME);
lv_indev_set_cursor(indev_mouse, mouse_cursor);
/*------------------

View File

@@ -25,7 +25,7 @@ void lv_example_scroll_1(void)
lv_obj_set_pos(child, 160, 80);
lv_obj_set_size(child, 80, 80);
lv_obj_t * child2 = lv_btn_create(child);
lv_obj_t * child2 = lv_button_create(child);
lv_obj_set_size(child2, 100, 50);
label = lv_label_create(child2);

View File

@@ -17,7 +17,7 @@ child = lv.obj(panel)
child.set_pos(160, 80)
child.set_size(80, 80)
child2 = lv.btn(child)
child2 = lv.button(child)
child2.set_size(100, 50)
label = lv.label(child2)

View File

@@ -27,7 +27,7 @@ void lv_example_scroll_2(void)
uint32_t i;
for(i = 0; i < 10; i++) {
lv_obj_t * btn = lv_btn_create(panel);
lv_obj_t * btn = lv_button_create(panel);
lv_obj_set_size(btn, 150, lv_pct(100));
lv_obj_t * label = lv_label_create(btn);

View File

@@ -22,13 +22,13 @@ panel.set_flex_flow(lv.FLEX_FLOW.ROW)
panel.center()
for i in range(10):
btn = lv.btn(panel)
btn.set_size(150, 100)
button = lv.button(panel)
button.set_size(150, 100)
label = lv.label(btn)
label = lv.label(button)
if i == 3:
label.set_text("Panel {:d}\nno snap".format(i))
btn.clear_flag(lv.obj.FLAG.SNAPPABLE)
button.clear_flag(lv.obj.FLAG.SNAPPABLE)
else:
label.set_text("Panel {:d}".format(i))
label.center()

View File

@@ -3,7 +3,7 @@
static uint32_t btn_cnt = 1;
static void float_btn_event_cb(lv_event_t * e)
static void float_button_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * float_btn = lv_event_get_target(e);
@@ -12,7 +12,7 @@ static void float_btn_event_cb(lv_event_t * e)
lv_obj_t * list = lv_event_get_user_data(e);
char buf[32];
lv_snprintf(buf, sizeof(buf), "Track %d", (int)btn_cnt);
lv_obj_t * list_btn = lv_list_add_btn(list, LV_SYMBOL_AUDIO, buf);
lv_obj_t * list_btn = lv_list_add_button(list, LV_SYMBOL_AUDIO, buf);
btn_cnt++;
lv_obj_move_foreground(float_btn);
@@ -33,16 +33,16 @@ void lv_example_scroll_3(void)
for(btn_cnt = 1; btn_cnt <= 2; btn_cnt++) {
char buf[32];
lv_snprintf(buf, sizeof(buf), "Track %d", (int)btn_cnt);
lv_list_add_btn(list, LV_SYMBOL_AUDIO, buf);
lv_list_add_button(list, LV_SYMBOL_AUDIO, buf);
}
lv_obj_t * float_btn = lv_btn_create(list);
lv_obj_t * float_btn = lv_button_create(list);
lv_obj_set_size(float_btn, 50, 50);
lv_obj_add_flag(float_btn, LV_OBJ_FLAG_FLOATING);
lv_obj_align(float_btn, LV_ALIGN_BOTTOM_RIGHT, 0, -lv_obj_get_style_pad_right(list, LV_PART_MAIN));
lv_obj_add_event(float_btn, float_btn_event_cb, LV_EVENT_ALL, list);
lv_obj_add_event(float_btn, float_button_event_cb, LV_EVENT_ALL, list);
lv_obj_set_style_radius(float_btn, LV_RADIUS_CIRCLE, 0);
lv_obj_set_style_bg_img_src(float_btn, LV_SYMBOL_PLUS, 0);
lv_obj_set_style_bg_image_src(float_btn, LV_SYMBOL_PLUS, 0);
lv_obj_set_style_text_font(float_btn, lv_theme_get_font_large(float_btn), 0);
}

View File

@@ -1,6 +1,6 @@
class ScrollExample_3():
def __init__(self):
self.btn_cnt = 1
self.button_cnt = 1
#
# Create a list with a floating button
#
@@ -9,29 +9,29 @@ class ScrollExample_3():
list.set_size(280, 220)
list.center()
for btn_cnt in range(2):
list.add_btn(lv.SYMBOL.AUDIO,"Track {:d}".format(btn_cnt))
for button_cnt in range(2):
list.add_button(lv.SYMBOL.AUDIO,"Track {:d}".format(button_cnt))
float_btn = lv.btn(list)
float_btn.set_size(50, 50)
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(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_bg_img_src(lv.SYMBOL.PLUS, 0)
float_btn.set_style_text_font(lv.theme_get_font_large(float_btn), 0)
float_button = lv.button(list)
float_button.set_size(50, 50)
float_button.add_flag(lv.obj.FLAG.FLOATING)
float_button.align(lv.ALIGN.BOTTOM_RIGHT, 0, -list.get_style_pad_right(lv.PART.MAIN))
float_button.add_event(lambda evt: self.float_button_event_cb(evt,list), lv.EVENT.ALL, None)
float_button.set_style_radius(lv.RADIUS_CIRCLE, 0)
float_button.set_style_bg_image_src(lv.SYMBOL.PLUS, 0)
float_button.set_style_text_font(lv.theme_get_font_large(float_button), 0)
def float_btn_event_cb(self,e,list):
def float_button_event_cb(self,e,list):
code = e.get_code()
float_btn = e.get_target_obj()
float_button = e.get_target_obj()
if code == lv.EVENT.CLICKED:
list_btn = list.add_btn(lv.SYMBOL.AUDIO, "Track {:d}".format(self.btn_cnt))
self.btn_cnt += 1
list_button = list.add_button(lv.SYMBOL.AUDIO, "Track {:d}".format(self.button_cnt))
self.button_cnt += 1
float_btn.move_foreground()
float_button.move_foreground()
list_btn.scroll_to_view(lv.ANIM.ON)
list_button.scroll_to_view(lv.ANIM.ON)
scroll_example_3 = ScrollExample_3()

View File

@@ -63,7 +63,7 @@ void lv_example_scroll_6(void)
uint32_t i;
for(i = 0; i < 20; i++) {
lv_obj_t * btn = lv_btn_create(cont);
lv_obj_t * btn = lv_button_create(cont);
lv_obj_set_width(btn, lv_pct(100));
lv_obj_t * label = lv_label_create(btn);

View File

@@ -54,10 +54,10 @@ cont.set_scroll_snap_y(lv.SCROLL_SNAP.CENTER)
cont.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
for i in range(20):
btn = lv.btn(cont)
btn.set_width(lv.pct(100))
button = lv.button(cont)
button.set_width(lv.pct(100))
label = lv.label(btn)
label = lv.label(button)
label.set_text("Button " + str(i))
# Update the buttons position manually for first*

View File

@@ -10,7 +10,7 @@ static void new_theme_apply_cb(lv_theme_t * th, lv_obj_t * obj)
{
LV_UNUSED(th);
if(lv_obj_check_type(obj, &lv_btn_class)) {
if(lv_obj_check_type(obj, &lv_button_class)) {
lv_obj_add_style(obj, &style_btn, 0);
}
}
@@ -46,7 +46,7 @@ void lv_example_style_14(void)
lv_obj_t * btn;
lv_obj_t * label;
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 20);
label = lv_label_create(btn);
@@ -54,7 +54,7 @@ void lv_example_style_14(void)
new_theme_init_and_set();
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -20);
label = lv_label_create(btn);

View File

@@ -6,11 +6,11 @@ class NewTheme(lv.theme_t):
def __init__(self):
super().__init__()
# Initialize the styles
self.style_btn = lv.style_t()
self.style_btn.init()
self.style_btn.set_bg_color(lv.palette_main(lv.PALETTE.GREEN))
self.style_btn.set_border_color(lv.palette_darken(lv.PALETTE.GREEN, 3))
self.style_btn.set_border_width(3)
self.style_button = lv.style_t()
self.style_button.init()
self.style_button.set_bg_color(lv.palette_main(lv.PALETTE.GREEN))
self.style_button.set_border_color(lv.palette_darken(lv.PALETTE.GREEN, 3))
self.style_button.set_border_width(3)
# This theme is based on active theme
th_act = lv.theme_get_from_obj(lv.scr_act())
@@ -25,24 +25,24 @@ class ExampleStyle_14:
# Extending the current theme
#
btn = lv.btn(lv.scr_act())
btn.align(lv.ALIGN.TOP_MID, 0, 20)
button = lv.button(lv.scr_act())
button.align(lv.ALIGN.TOP_MID, 0, 20)
label = lv.label(btn)
label = lv.label(button)
label.set_text("Original theme")
self.new_theme_init_and_set()
btn = lv.btn(lv.scr_act())
btn.align(lv.ALIGN.BOTTOM_MID, 0, -20)
button = lv.button(lv.scr_act())
button.align(lv.ALIGN.BOTTOM_MID, 0, -20)
label = lv.label(btn)
label = lv.label(button)
label.set_text("New theme")
def new_theme_apply_cb(self, th, obj):
print(th,obj)
if obj.get_class() == lv.btn_class:
obj.add_style(self.th_new.style_btn, 0)
if obj.get_class() == lv.button_class:
obj.add_style(self.th_new.style_button, 0)
def new_theme_init_and_set(self):
print("new_theme_init_and_set")

View File

@@ -12,7 +12,7 @@ void lv_example_style_15(void)
lv_obj_t * label;
/*Normal button*/
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 40);
lv_obj_align(btn, LV_ALIGN_CENTER, 0, -70);
@@ -22,7 +22,7 @@ void lv_example_style_15(void)
/*Set opacity
*The button and the label is rendered to a layer first and that layer is blended*/
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 40);
lv_obj_set_style_opa(btn, LV_OPA_50, 0);
lv_obj_align(btn, LV_ALIGN_CENTER, 0, 0);
@@ -33,7 +33,7 @@ void lv_example_style_15(void)
/*Set transformations
*The button and the label is rendered to a layer first and that layer is transformed*/
btn = lv_btn_create(lv_scr_act());
btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 40);
lv_obj_set_style_transform_angle(btn, 150, 0); /*15 deg*/
lv_obj_set_style_transform_zoom(btn, 256 + 64, 0); /*1.25x*/

View File

@@ -3,37 +3,37 @@
#
# Normal button
btn = lv.btn(lv.scr_act())
btn.set_size(100, 40)
btn.align(lv.ALIGN.CENTER, 0, -70)
button = lv.button(lv.scr_act())
button.set_size(100, 40)
button.align(lv.ALIGN.CENTER, 0, -70)
label = lv.label(btn)
label = lv.label(button)
label.set_text("Normal")
label.center()
# Set opacity
# The button and the label is rendered to a layer first and that layer is blended
btn = lv.btn(lv.scr_act())
btn.set_size(100, 40)
btn.set_style_opa(lv.OPA._50, 0)
btn.align(lv.ALIGN.CENTER, 0, 0)
button = lv.button(lv.scr_act())
button.set_size(100, 40)
button.set_style_opa(lv.OPA._50, 0)
button.align(lv.ALIGN.CENTER, 0, 0)
label = lv.label(btn)
label = lv.label(button)
label.set_text("Opa:50%")
label.center()
# Set transformations
# The button and the label is rendered to a layer first and that layer is transformed
btn = lv.btn(lv.scr_act())
btn.set_size(100, 40)
btn.set_style_transform_angle(150, 0) # 15 deg
btn.set_style_transform_zoom(256 + 64, 0) # 1.25x
btn.set_style_transform_pivot_x(50, 0)
btn.set_style_transform_pivot_y(20, 0)
btn.set_style_opa(lv.OPA._50, 0)
btn.align(lv.ALIGN.CENTER, 0, 70)
button = lv.button(lv.scr_act())
button.set_size(100, 40)
button.set_style_transform_angle(150, 0) # 15 deg
button.set_style_transform_zoom(256 + 64, 0) # 1.25x
button.set_style_transform_pivot_x(50, 0)
button.set_style_transform_pivot_y(20, 0)
button.set_style_opa(lv.OPA._50, 0)
button.align(lv.ALIGN.CENTER, 0, 70)
label = lv.label(btn)
label = lv.label(button)
label.set_text("Transf.")
label.center()

View File

@@ -16,16 +16,16 @@ void lv_example_style_6(void)
lv_style_set_border_width(&style, 2);
lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_img_recolor(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_img_recolor_opa(&style, LV_OPA_50);
lv_style_set_image_recolor(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_image_recolor_opa(&style, LV_OPA_50);
lv_style_set_transform_angle(&style, 300);
/*Create an object with the new style*/
lv_obj_t * obj = lv_img_create(lv_scr_act());
lv_obj_t * obj = lv_image_create(lv_scr_act());
lv_obj_add_style(obj, &style, 0);
LV_IMG_DECLARE(img_cogwheel_argb);
lv_img_set_src(obj, &img_cogwheel_argb);
LV_IMAGE_DECLARE(img_cogwheel_argb);
lv_image_set_src(obj, &img_cogwheel_argb);
lv_obj_center(obj);
}

View File

@@ -6,7 +6,7 @@ except:
print("Could not find img_cogwheel_argb.png")
sys.exit()
img_cogwheel_argb = lv.img_dsc_t({
image_cogwheel_argb = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
@@ -24,14 +24,14 @@ style.set_bg_color(lv.palette_lighten(lv.PALETTE.GREY, 3))
style.set_border_width(2)
style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
style.set_img_recolor(lv.palette_main(lv.PALETTE.BLUE))
style.set_img_recolor_opa(lv.OPA._50)
style.set_image_recolor(lv.palette_main(lv.PALETTE.BLUE))
style.set_image_recolor_opa(lv.OPA._50)
style.set_transform_angle(300)
# Create an object with the new style
obj = lv.img(lv.scr_act())
obj = lv.image(lv.scr_act())
obj.add_style(style, 0)
obj.set_src(img_cogwheel_argb)
obj.set_src(image_cogwheel_argb)
obj.center()

View File

@@ -1,10 +1,10 @@
#include "../../lv_examples.h"
#if LV_USE_ANIMIMG && LV_BUILD_EXAMPLES
LV_IMG_DECLARE(animimg001)
LV_IMG_DECLARE(animimg002)
LV_IMG_DECLARE(animimg003)
LV_IMAGE_DECLARE(animimg001)
LV_IMAGE_DECLARE(animimg002)
LV_IMAGE_DECLARE(animimg003)
static const lv_img_dsc_t * anim_imgs[3] = {
static const lv_image_dsc_t * anim_imgs[3] = {
&animimg001,
&animimg002,
&animimg003,

View File

@@ -1,4 +1,4 @@
anim_imgs = [None]*3
anim_images = [None]*3
# Create an image from the png file
try:
with open('../../assets/animimg001.png','rb') as f:
@@ -7,7 +7,7 @@ except:
print("Could not find animimg001.png")
sys.exit()
anim_imgs[0] = lv.img_dsc_t({
anim_images[0] = lv.image_dsc_t({
'data_size': len(anim001_data),
'data': anim001_data
})
@@ -19,7 +19,7 @@ except:
print("Could not find animimg002.png")
sys.exit()
anim_imgs[1] = lv.img_dsc_t({
anim_images[1] = lv.image_dsc_t({
'data_size': len(anim002_data),
'data': anim002_data
})
@@ -31,17 +31,17 @@ except:
print("Could not find animimg003.png")
sys.exit()
anim_imgs[2] = lv.img_dsc_t({
anim_images[2] = lv.image_dsc_t({
'data_size': len(anim003_data),
'data': anim003_data
})
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.start()
animimage0 = lv.animimg(lv.scr_act())
animimage0.center()
animimage0.set_src(anim_images, 3)
animimage0.set_duration(1000)
animimage0.set_repeat_count(lv.ANIM_REPEAT_INFINITE)
animimage0.start()

View File

@@ -6,13 +6,13 @@
*/
void lv_example_bar_4(void)
{
LV_IMG_DECLARE(img_skew_strip);
LV_IMAGE_DECLARE(img_skew_strip);
static lv_style_t style_indic;
lv_style_init(&style_indic);
lv_style_set_bg_img_src(&style_indic, &img_skew_strip);
lv_style_set_bg_img_tiled(&style_indic, true);
lv_style_set_bg_img_opa(&style_indic, LV_OPA_30);
lv_style_set_bg_image_src(&style_indic, &img_skew_strip);
lv_style_set_bg_image_tiled(&style_indic, true);
lv_style_set_bg_image_opa(&style_indic, LV_OPA_30);
lv_obj_t * bar = lv_bar_create(lv_scr_act());
lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR);

View File

@@ -6,7 +6,7 @@ except:
print("Could not find img_strip.png")
sys.exit()
img_skew_strip_dsc = lv.img_dsc_t({
image_skew_strip_dsc = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
@@ -18,9 +18,9 @@ img_skew_strip_dsc = lv.img_dsc_t({
style_indic = lv.style_t()
style_indic.init()
style_indic.set_bg_img_src(img_skew_strip_dsc)
style_indic.set_bg_img_tiled(True)
style_indic.set_bg_img_opa(lv.OPA._30)
style_indic.set_bg_image_src(image_skew_strip_dsc)
style_indic.set_bg_image_tiled(True)
style_indic.set_bg_image_opa(lv.OPA._30)
bar = lv.bar(lv.scr_act())
bar.add_style(style_indic, lv.PART.INDICATOR)

View File

@@ -13,11 +13,11 @@ static void event_handler(lv_event_t * e)
}
}
void lv_example_btn_1(void)
void lv_example_button_1(void)
{
lv_obj_t * label;
lv_obj_t * btn1 = lv_btn_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
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);
@@ -26,7 +26,7 @@ void lv_example_btn_1(void)
lv_label_set_text(label, "Button");
lv_obj_center(label);
lv_obj_t * btn2 = lv_btn_create(lv_scr_act());
lv_obj_t * btn2 = lv_button_create(lv_scr_act());
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,26 +7,26 @@ def event_handler(evt):
print("Value changed seen")
# create a simple button
btn1 = lv.btn(lv.scr_act())
button1 = lv.button(lv.scr_act())
# attach the callback
btn1.add_event(event_handler,lv.EVENT.ALL, None)
button1.add_event(event_handler,lv.EVENT.ALL, None)
btn1.align(lv.ALIGN.CENTER,0,-40)
label=lv.label(btn1)
button1.align(lv.ALIGN.CENTER,0,-40)
label=lv.label(button1)
label.set_text("Button")
# create a toggle button
btn2 = lv.btn(lv.scr_act())
button2 = lv.button(lv.scr_act())
# attach the callback
#btn2.add_event(event_handler,lv.EVENT.VALUE_CHANGED,None)
btn2.add_event(event_handler,lv.EVENT.ALL, None)
#button2.add_event(event_handler,lv.EVENT.VALUE_CHANGED,None)
button2.add_event(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)
button2.align(lv.ALIGN.CENTER,0,40)
button2.add_flag(lv.obj.FLAG.CHECKABLE)
button2.set_height(lv.SIZE_CONTENT)
label=lv.label(btn2)
label=lv.label(button2)
label.set_text("Toggle")
label.center()

View File

@@ -4,7 +4,7 @@
/**
* Style a button from scratch
*/
void lv_example_btn_2(void)
void lv_example_button_2(void)
{
/*Init the style for the default state*/
static lv_style_t style;
@@ -51,7 +51,7 @@ void lv_example_btn_2(void)
lv_style_set_transition(&style_pr, &trans);
lv_obj_t * btn1 = lv_btn_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
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,14 +47,14 @@ trans.init(props, lv.anim_t.path_linear, 300, 0, None)
style_pr.set_transition(trans)
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.center()
button1 = lv.button(lv.scr_act())
button1.remove_style_all() # Remove the style coming from the theme
button1.add_style(style, 0)
button1.add_style(style_pr, lv.STATE.PRESSED)
button1.set_size(lv.SIZE_CONTENT, lv.SIZE_CONTENT)
button1.center()
label = lv.label(btn1)
label = lv.label(button1)
label.set_text("Button")
label.center()

View File

@@ -4,7 +4,7 @@
/**
* Create a style transition on a button to act like a gum when clicked
*/
void lv_example_btn_3(void)
void lv_example_button_3(void)
{
/*Properties to transition*/
static lv_style_prop_t props[] = {
@@ -34,7 +34,7 @@ void lv_example_btn_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_btn_create(lv_scr_act());
lv_obj_t * btn1 = lv_button_create(lv_scr_act());
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,11 +28,11 @@ style_pr.set_transform_height(-10)
style_pr.set_text_letter_space(10)
style_pr.set_transition(transition_dsc_pr)
btn1 = lv.btn(lv.scr_act())
btn1.align(lv.ALIGN.CENTER, 0, -80)
btn1.add_style(style_pr, lv.STATE.PRESSED)
btn1.add_style(style_def, 0)
button1 = lv.button(lv.scr_act())
button1.align(lv.ALIGN.CENTER, 0, -80)
button1.add_style(style_pr, lv.STATE.PRESSED)
button1.add_style(style_def, 0)
label = lv.label(btn1)
label = lv.label(button1)
label.set_text("Gum")

View File

@@ -6,8 +6,8 @@ static void event_handler(lv_event_t * e)
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
if(code == LV_EVENT_VALUE_CHANGED) {
uint32_t id = lv_btnmatrix_get_selected_btn(obj);
const char * txt = lv_btnmatrix_get_btn_text(obj, id);
uint32_t id = lv_buttonmatrix_get_selected_button(obj);
const char * txt = lv_buttonmatrix_get_button_text(obj, id);
LV_UNUSED(txt);
LV_LOG_USER("%s was pressed\n", txt);
}
@@ -19,13 +19,13 @@ static const char * btnm_map[] = {"1", "2", "3", "4", "5", "\n",
"Action1", "Action2", ""
};
void lv_example_btnmatrix_1(void)
void lv_example_buttonmatrix_1(void)
{
lv_obj_t * btnm1 = lv_btnmatrix_create(lv_scr_act());
lv_btnmatrix_set_map(btnm1, btnm_map);
lv_btnmatrix_set_btn_width(btnm1, 10, 2); /*Make "Action1" twice as wide as "Action2"*/
lv_btnmatrix_set_btn_ctrl(btnm1, 10, LV_BTNMATRIX_CTRL_CHECKABLE);
lv_btnmatrix_set_btn_ctrl(btnm1, 11, LV_BTNMATRIX_CTRL_CHECKED);
lv_obj_t * btnm1 = lv_buttonmatrix_create(lv_scr_act());
lv_buttonmatrix_set_map(btnm1, btnm_map);
lv_buttonmatrix_set_button_width(btnm1, 10, 2); /*Make "Action1" twice as wide as "Action2"*/
lv_buttonmatrix_set_button_ctrl(btnm1, 10, LV_BUTTONMATRIX_CTRL_CHECKABLE);
lv_buttonmatrix_set_button_ctrl(btnm1, 11, LV_BUTTONMATRIX_CTRL_CHECKED);
lv_obj_align(btnm1, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_event(btnm1, event_handler, LV_EVENT_ALL, NULL);
}

View File

@@ -3,22 +3,22 @@ def event_handler(e):
obj = e.get_target_obj()
if code == lv.EVENT.VALUE_CHANGED :
id = obj.get_selected_btn()
txt = obj.get_btn_text(id)
id = obj.get_selected_button()
txt = obj.get_button_text(id)
print("%s was pressed"%txt)
btnm_map = ["1", "2", "3", "4", "5", "\n",
buttonm_map = ["1", "2", "3", "4", "5", "\n",
"6", "7", "8", "9", "0", "\n",
"Action1", "Action2", ""]
btnm1 = lv.btnmatrix(lv.scr_act())
btnm1.set_map(btnm_map)
btnm1.set_btn_width(10, 2) # Make "Action1" twice as wide as "Action2"
btnm1.set_btn_ctrl(10, lv.btnmatrix.CTRL.CHECKABLE)
btnm1.set_btn_ctrl(11, lv.btnmatrix.CTRL.CHECKED)
btnm1.align(lv.ALIGN.CENTER, 0, 0)
btnm1.add_event(event_handler, lv.EVENT.ALL, None)
buttonm1 = lv.buttonmatrix(lv.scr_act())
buttonm1.set_map(buttonm_map)
buttonm1.set_button_width(10, 2) # Make "Action1" twice as wide as "Action2"
buttonm1.set_button_ctrl(10, lv.buttonmatrix.CTRL.CHECKABLE)
buttonm1.set_button_ctrl(11, lv.buttonmatrix.CTRL.CHECKED)
buttonm1.align(lv.ALIGN.CENTER, 0, 0)
buttonm1.add_event(event_handler, lv.EVENT.ALL, None)
#endif

View File

@@ -10,7 +10,7 @@ static void event_cb(lv_event_t * e)
/*When the button matrix draws the buttons...*/
if(base_dsc->part == LV_PART_ITEMS) {
bool pressed = false;
if(lv_btnmatrix_get_selected_btn(obj) == base_dsc->id1 && lv_obj_has_state(obj, LV_STATE_PRESSED)) {
if(lv_buttonmatrix_get_selected_button(obj) == base_dsc->id1 && lv_obj_has_state(obj, LV_STATE_PRESSED)) {
pressed = true;
}
@@ -46,9 +46,9 @@ static void event_cb(lv_event_t * e)
label_draw_dsc->opa = 0;
}
if(draw_task->type == LV_DRAW_TASK_TYPE_FILL) {
LV_IMG_DECLARE(img_star);
lv_img_header_t header;
lv_res_t res = lv_img_decoder_get_info(&img_star, &header);
LV_IMAGE_DECLARE(img_star);
lv_image_header_t header;
lv_res_t res = lv_image_decoder_get_info(&img_star, &header);
if(res != LV_RES_OK) return;
lv_area_t a;
@@ -58,13 +58,13 @@ static void event_cb(lv_event_t * e)
a.y2 = header.h - 1;
lv_area_align(&draw_task->area, &a, LV_ALIGN_CENTER, 0, 0);
lv_draw_img_dsc_t img_draw_dsc;
lv_draw_img_dsc_init(&img_draw_dsc);
lv_draw_image_dsc_t img_draw_dsc;
lv_draw_image_dsc_init(&img_draw_dsc);
img_draw_dsc.src = &img_star;
img_draw_dsc.recolor = lv_color_black();
if(pressed) img_draw_dsc.recolor_opa = LV_OPA_30;
lv_draw_img(base_dsc->layer, &img_draw_dsc, &a);
lv_draw_image(base_dsc->layer, &img_draw_dsc, &a);
}
}
@@ -74,9 +74,9 @@ static void event_cb(lv_event_t * e)
/**
* Add custom drawer to the button matrix to customize buttons one by one
*/
void lv_example_btnmatrix_2(void)
void lv_example_buttonmatrix_2(void)
{
lv_obj_t * btnm = lv_btnmatrix_create(lv_scr_act());
lv_obj_t * btnm = lv_buttonmatrix_create(lv_scr_act());
lv_obj_add_event(btnm, event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL);
lv_obj_add_flag(btnm, LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS);
lv_obj_center(btnm);

View File

@@ -4,27 +4,27 @@
static void event_cb(lv_event_t * e)
{
lv_obj_t * obj = lv_event_get_target(e);
uint32_t id = lv_btnmatrix_get_selected_btn(obj);
uint32_t id = lv_buttonmatrix_get_selected_button(obj);
bool prev = id == 0;
bool next = id == 6;
if(prev || next) {
/*Find the checked button*/
uint32_t i;
for(i = 1; i < 7; i++) {
if(lv_btnmatrix_has_btn_ctrl(obj, i, LV_BTNMATRIX_CTRL_CHECKED)) break;
if(lv_buttonmatrix_has_button_ctrl(obj, i, LV_BUTTONMATRIX_CTRL_CHECKED)) break;
}
if(prev && i > 1) i--;
else if(next && i < 5) i++;
lv_btnmatrix_set_btn_ctrl(obj, i, LV_BTNMATRIX_CTRL_CHECKED);
lv_buttonmatrix_set_button_ctrl(obj, i, LV_BUTTONMATRIX_CTRL_CHECKED);
}
}
/**
* Make a button group (pagination)
*/
void lv_example_btnmatrix_3(void)
void lv_example_buttonmatrix_3(void)
{
static lv_style_t style_bg;
lv_style_init(&style_bg);
@@ -46,20 +46,20 @@ void lv_example_btnmatrix_3(void)
static const char * map[] = {LV_SYMBOL_LEFT, "1", "2", "3", "4", "5", LV_SYMBOL_RIGHT, ""};
lv_obj_t * btnm = lv_btnmatrix_create(lv_scr_act());
lv_btnmatrix_set_map(btnm, map);
lv_obj_t * btnm = lv_buttonmatrix_create(lv_scr_act());
lv_buttonmatrix_set_map(btnm, map);
lv_obj_add_style(btnm, &style_bg, 0);
lv_obj_add_style(btnm, &style_btn, LV_PART_ITEMS);
lv_obj_add_event(btnm, event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_set_size(btnm, 225, 35);
/*Allow selecting on one number at time*/
lv_btnmatrix_set_btn_ctrl_all(btnm, LV_BTNMATRIX_CTRL_CHECKABLE);
lv_btnmatrix_clear_btn_ctrl(btnm, 0, LV_BTNMATRIX_CTRL_CHECKABLE);
lv_btnmatrix_clear_btn_ctrl(btnm, 6, LV_BTNMATRIX_CTRL_CHECKABLE);
lv_buttonmatrix_set_button_ctrl_all(btnm, LV_BUTTONMATRIX_CTRL_CHECKABLE);
lv_buttonmatrix_clear_button_ctrl(btnm, 0, LV_BUTTONMATRIX_CTRL_CHECKABLE);
lv_buttonmatrix_clear_button_ctrl(btnm, 6, LV_BUTTONMATRIX_CTRL_CHECKABLE);
lv_btnmatrix_set_one_checked(btnm, true);
lv_btnmatrix_set_btn_ctrl(btnm, 1, LV_BTNMATRIX_CTRL_CHECKED);
lv_buttonmatrix_set_one_checked(btnm, true);
lv_buttonmatrix_set_button_ctrl(btnm, 1, LV_BUTTONMATRIX_CTRL_CHECKED);
lv_obj_center(btnm);

View File

@@ -1,6 +1,6 @@
def event_cb(e):
obj = e.get_target_obj()
id = obj.get_selected_btn()
id = obj.get_selected_button()
if id == 0:
prev = True
else:
@@ -12,14 +12,14 @@ def event_cb(e):
if prev or next:
# Find the checked butto
for i in range(7):
if obj.has_btn_ctrl(i, lv.btnmatrix.CTRL.CHECKED):
if obj.has_button_ctrl(i, lv.buttonmatrix.CTRL.CHECKED):
break
if prev and i > 1:
i-=1
elif next and i < 5:
i+=1
obj.set_btn_ctrl(i, lv.btnmatrix.CTRL.CHECKED)
obj.set_button_ctrl(i, lv.buttonmatrix.CTRL.CHECKED)
#
# Make a button group
@@ -34,31 +34,31 @@ style_bg.set_radius(lv.RADIUS_CIRCLE)
style_bg.set_border_width(0)
style_btn = lv.style_t()
style_btn.init()
style_btn.set_radius(0)
style_btn.set_border_width(1)
style_btn.set_border_opa(lv.OPA._50)
style_btn.set_border_color(lv.palette_main(lv.PALETTE.GREY))
style_btn.set_border_side(lv.BORDER_SIDE.INTERNAL)
style_btn.set_radius(0)
style_button = lv.style_t()
style_button.init()
style_button.set_radius(0)
style_button.set_border_width(1)
style_button.set_border_opa(lv.OPA._50)
style_button.set_border_color(lv.palette_main(lv.PALETTE.GREY))
style_button.set_border_side(lv.BORDER_SIDE.INTERNAL)
style_button.set_radius(0)
map = [lv.SYMBOL.LEFT,"1","2", "3", "4", "5",lv.SYMBOL.RIGHT, ""]
btnm = lv.btnmatrix(lv.scr_act())
btnm.set_map(map)
btnm.add_style(style_bg, 0)
btnm.add_style(style_btn, lv.PART.ITEMS)
btnm.add_event(event_cb, lv.EVENT.VALUE_CHANGED, None)
btnm.set_size(225, 35)
buttonm = lv.buttonmatrix(lv.scr_act())
buttonm.set_map(map)
buttonm.add_style(style_bg, 0)
buttonm.add_style(style_button, lv.PART.ITEMS)
buttonm.add_event(event_cb, lv.EVENT.VALUE_CHANGED, None)
buttonm.set_size(225, 35)
# Allow selecting on one number at time
btnm.set_btn_ctrl_all(lv.btnmatrix.CTRL.CHECKABLE)
btnm.clear_btn_ctrl(0, lv.btnmatrix.CTRL.CHECKABLE)
btnm.clear_btn_ctrl(6, lv.btnmatrix.CTRL.CHECKABLE)
buttonm.set_button_ctrl_all(lv.buttonmatrix.CTRL.CHECKABLE)
buttonm.clear_button_ctrl(0, lv.buttonmatrix.CTRL.CHECKABLE)
buttonm.clear_button_ctrl(6, lv.buttonmatrix.CTRL.CHECKABLE)
btnm.set_one_checked(True)
btnm.set_btn_ctrl(1, lv.btnmatrix.CTRL.CHECKED)
buttonm.set_one_checked(True)
buttonm.set_button_ctrl(1, lv.buttonmatrix.CTRL.CHECKED)
btnm.center()
buttonm.center()

View File

@@ -52,7 +52,7 @@ void lv_example_canvas_1(void)
*So copy the current image to buffer and rotate it to the canvas*/
static uint8_t cbuf_tmp[LV_CANVAS_BUF_SIZE_TRUE_COLOR(CANVAS_WIDTH, CANVAS_HEIGHT)];
lv_memcpy(cbuf_tmp, cbuf, sizeof(cbuf_tmp));
lv_img_dsc_t img;
lv_image_dsc_t img;
img.data = (void *)cbuf_tmp;
img.header.cf = LV_COLOR_FORMAT_NATIVE;
img.header.w = CANVAS_WIDTH;
@@ -62,15 +62,15 @@ void lv_example_canvas_1(void)
lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_GREY, 1), LV_OPA_COVER);
lv_draw_img_dsc_t img_dsc;
lv_draw_img_dsc_init(&img_dsc);
lv_draw_image_dsc_t img_dsc;
lv_draw_image_dsc_init(&img_dsc);
img_dsc.angle = 120;
img_dsc.src = &img;
img_dsc.pivot.x = CANVAS_WIDTH / 2;
img_dsc.pivot.y = CANVAS_HEIGHT / 2;
lv_area_t coords_img = {0, 0, CANVAS_WIDTH - 1, CANVAS_HEIGHT - 1};
lv_draw_img(&layer, &img_dsc, &coords_img);
lv_draw_image(&layer, &img_dsc, &coords_img);
lv_canvas_finish_layer(canvas, &layer);
}

View File

@@ -1,6 +1,6 @@
_CANVAS_WIDTH = 200
_CANVAS_HEIGHT = 150
LV_IMG_ZOOM_NONE = 256
LV_IMAGE_ZOOM_NONE = 256
rect_dsc = lv.draw_rect_dsc_t()
rect_dsc.init()
@@ -60,28 +60,28 @@ canvas.finish_layer(layer)
# Test the rotation. It requires another buffer where the original image is stored.
# So copy the current image to buffer and rotate it to the canvas
img = lv.img_dsc_t()
image = lv.image_dsc_t()
img.data = cbuf[:]
img.header.cf = lv.COLOR_FORMAT.NATIVE
img.header.w = _CANVAS_WIDTH
img.header.h = _CANVAS_HEIGHT
image.data = cbuf[:]
image.header.cf = lv.COLOR_FORMAT.NATIVE
image.header.w = _CANVAS_WIDTH
image.header.h = _CANVAS_HEIGHT
canvas.fill_bg(lv.palette_lighten(lv.PALETTE.GREY, 3), lv.OPA.COVER)
img_dsc = lv.draw_img_dsc_t()
img_dsc.init();
img_dsc.angle = 120;
img_dsc.src = img;
img_dsc.pivot.x = _CANVAS_WIDTH // 2;
img_dsc.pivot.y = _CANVAS_HEIGHT // 2;
image_dsc = lv.draw_image_dsc_t()
image_dsc.init();
image_dsc.angle = 120;
image_dsc.src = image;
image_dsc.pivot.x = _CANVAS_WIDTH // 2;
image_dsc.pivot.y = _CANVAS_HEIGHT // 2;
coords_img = lv.area_t()
coords_img.x1 = 0
coords_img.y1 = 0
coords_img.x2 = _CANVAS_WIDTH - 1
coords_img.y2 = _CANVAS_HEIGHT - 1
coords_image = lv.area_t()
coords_image.x1 = 0
coords_image.y1 = 0
coords_image.x2 = _CANVAS_WIDTH - 1
coords_image.y2 = _CANVAS_HEIGHT - 1
lv.draw_img(layer, img_dsc, coords_img)
lv.draw_image(layer, image_dsc, coords_image)

View File

@@ -21,14 +21,14 @@ void lv_example_canvas_6(void)
lv_layer_t layer;
lv_canvas_init_layer(canvas, &layer);
LV_IMG_DECLARE(img_star);
lv_draw_img_dsc_t dsc;
lv_draw_img_dsc_init(&dsc);
LV_IMAGE_DECLARE(img_star);
lv_draw_image_dsc_t dsc;
lv_draw_image_dsc_init(&dsc);
dsc.src = &img_star;
lv_area_t coords = {10, 10, 10 + img_star.header.w - 1, 10 + img_star.header.h - 1};
lv_draw_img(&layer, &dsc, &coords);
lv_draw_image(&layer, &dsc, &coords);
lv_canvas_finish_layer(canvas, &layer);

View File

@@ -11,7 +11,7 @@ except:
print("Could not find star.png")
sys.exit()
img_star_argb = lv.img_dsc_t({
image_star_argb = lv.image_dsc_t({
'data_size': len(png_data),
'data': png_data
})
@@ -29,9 +29,9 @@ canvas.set_buffer(cbuf, CANVAS_WIDTH, CANVAS_HEIGHT, lv.COLOR_FORMAT.NATIVE)
canvas.fill_bg(lv.color_hex3(0xccc), lv.OPA.COVER)
canvas.center()
dsc = lv.draw_img_dsc_t()
dsc = lv.draw_image_dsc_t()
dsc.init()
dsc.src = img_star_argb
dsc.src = image_star_argb
@@ -45,6 +45,6 @@ coords.y2 = 5 + 28
layer = lv.layer_t()
canvas.init_layer(layer);
lv.draw_img(layer, dsc, coords)
lv.draw_image(layer, dsc, coords)
canvas.finish_layer(layer)

View File

@@ -36,8 +36,8 @@ static void event_cb(lv_event_t * e)
draw_rect_dsc.bg_color = lv_color_black();
draw_rect_dsc.bg_opa = LV_OPA_50;
draw_rect_dsc.radius = 3;
draw_rect_dsc.bg_img_src = buf;
draw_rect_dsc.bg_img_recolor = lv_color_white();
draw_rect_dsc.bg_image_src = buf;
draw_rect_dsc.bg_image_recolor = lv_color_white();
lv_area_t a;
a.x1 = chart->coords.x1 + p.x - 20;

View File

@@ -37,8 +37,8 @@ def event_cb(e):
draw_rect_dsc.bg_color = lv.color_black()
draw_rect_dsc.bg_opa = lv.OPA._50
draw_rect_dsc.radius = 3
draw_rect_dsc.bg_img_src = buf
draw_rect_dsc.bg_img_recolor = lv.color_white()
draw_rect_dsc.bg_image_src = buf
draw_rect_dsc.bg_image_recolor = lv.color_white()
coords = lv.area_t()
chart.get_coords(coords)

View File

@@ -49,7 +49,7 @@ void lv_example_checkbox_2(void)
lv_style_set_radius(&style_radio, LV_RADIUS_CIRCLE);
lv_style_init(&style_radio_chk);
lv_style_set_bg_img_src(&style_radio_chk, NULL);
lv_style_set_bg_image_src(&style_radio_chk, NULL);
uint32_t i;
char buf[32];

View File

@@ -19,7 +19,7 @@ class LV_Example_Checkbox_2:
self.style_radio_chk = lv.style_t()
self.style_radio_chk.init()
self.style_radio_chk.init()
self.style_radio_chk.set_bg_img_src(None)
self.style_radio_chk.set_bg_image_src(None)
self.cont1 = lv.obj(lv.scr_act())
self.cont1.set_flex_flow(lv.FLEX_FLOW.COLUMN)

Some files were not shown because too many files have changed in this diff Show More