|
|
|
@ -61,11 +61,33 @@ static void table_style_cb(lv_event_t *e) |
|
|
|
dsc->rect_dsc->bg_color = lv_color_hex(0x007185); // 蓝色背景
|
|
|
|
dsc->rect_dsc->bg_opa = LV_OPA_COVER; |
|
|
|
dsc->label_dsc->color = lv_color_hex(0xFFFFFF); // 白色文字
|
|
|
|
dsc->label_dsc->font = &lv_font_simsun_24; |
|
|
|
} |
|
|
|
else if ((table == guider_ui.screen_w_list)&&(row == Work_step_row)) { |
|
|
|
dsc->rect_dsc->bg_color = lv_color_hex(0x007185); // 蓝色背景
|
|
|
|
dsc->rect_dsc->bg_opa = LV_OPA_COVER; |
|
|
|
dsc->label_dsc->color = lv_color_hex(0xFFFFFF); // 白色文字
|
|
|
|
dsc->label_dsc->font = &lv_font_simsun_24; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
static void table_step_cb(lv_event_t *e) |
|
|
|
{ |
|
|
|
lv_event_code_t code = lv_event_get_code(e); |
|
|
|
lv_obj_t *table = lv_event_get_target(e); |
|
|
|
|
|
|
|
if (code == LV_EVENT_DRAW_PART_BEGIN) { |
|
|
|
lv_obj_draw_part_dsc_t *dsc = lv_event_get_param(e); |
|
|
|
// 检查是否是单元格绘制
|
|
|
|
if (dsc->part == LV_PART_ITEMS && dsc->id < LV_TABLE_CELL_NONE) { |
|
|
|
uint16_t row = dsc->id / lv_table_get_col_cnt(table); |
|
|
|
//uint16_t col = dsc->id % lv_table_get_col_cnt(table);
|
|
|
|
if (row == Work_step_row) { |
|
|
|
dsc->rect_dsc->bg_color = lv_color_hex(0x007185); // 蓝色背景
|
|
|
|
dsc->rect_dsc->bg_opa = LV_OPA_COVER; |
|
|
|
dsc->label_dsc->color = lv_color_hex(0xFFFFFF); // 白色文字
|
|
|
|
dsc->label_dsc->font = &lv_font_simsun_24; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -130,8 +152,7 @@ static void table_click_event_cb(lv_event_t *e) { |
|
|
|
// 初始化样式
|
|
|
|
void table_style_init(lv_obj_t *container) |
|
|
|
{ |
|
|
|
//guider_ui.screen_list_inf = lv_table_create(guider_ui.screen_inf_list);
|
|
|
|
lv_obj_add_event_cb(container, table_style_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); |
|
|
|
//lv_obj_add_event_cb(container, table_style_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
|
|
|
|
lv_obj_add_event_cb(container, table_click_event_cb, LV_EVENT_CLICKED, NULL); |
|
|
|
|
|
|
|
lv_obj_set_pos(container, 0, 0); |
|
|
|
@ -165,7 +186,7 @@ void table_style_init(lv_obj_t *container) |
|
|
|
lv_obj_set_style_pad_right(container, 10, LV_PART_ITEMS|LV_STATE_DEFAULT); |
|
|
|
|
|
|
|
lv_obj_set_style_text_color(container, lv_color_hex(0xFFFFFF), LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
lv_obj_set_style_text_font(container, &lv_font_simsun_14, LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
lv_obj_set_style_text_font(container, &lv_font_simsun_24, LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
lv_obj_set_style_text_opa(container, 255, LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
lv_obj_set_style_text_align(container, LV_TEXT_ALIGN_CENTER, LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
lv_obj_set_style_bg_opa(container, 255, LV_PART_ITEMS|LV_STATE_CHECKED); |
|
|
|
@ -196,16 +217,46 @@ void custom_init(lv_ui *ui) |
|
|
|
lv_obj_set_style_pad_all(ui->screen_w_io_tab_4, 0, LV_PART_MAIN); |
|
|
|
lv_obj_set_scroll_dir(ui->screen_w_io_tab_4, LV_DIR_NONE); |
|
|
|
|
|
|
|
//table_style_init();
|
|
|
|
|
|
|
|
//
|
|
|
|
guider_ui.screen_list_inf = lv_table_create(guider_ui.screen_inf_list); |
|
|
|
table_style_init(guider_ui.screen_list_inf); |
|
|
|
lv_table_set_col_cnt(guider_ui.screen_list_inf,6); |
|
|
|
lv_obj_add_event_cb(guider_ui.screen_list_inf, table_style_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); |
|
|
|
lv_table_set_col_cnt(guider_ui.screen_list_inf,2); |
|
|
|
lv_table_set_col_width(guider_ui.screen_list_inf, 0, 350); |
|
|
|
lv_table_set_col_width(guider_ui.screen_list_inf, 1, 360); |
|
|
|
lv_table_set_cell_value(guider_ui.screen_list_inf,0,0,"工单"); |
|
|
|
lv_table_set_cell_value(guider_ui.screen_list_inf,0,1,"工艺"); |
|
|
|
|
|
|
|
//
|
|
|
|
guider_ui.screen_w_list_NAME = lv_table_create(guider_ui.screen_tabview_tab_1); |
|
|
|
lv_obj_set_pos(guider_ui.screen_w_list_NAME, 0, 0); |
|
|
|
lv_obj_set_size(guider_ui.screen_w_list_NAME, 300, 50); |
|
|
|
table_style_init(guider_ui.screen_w_list_NAME); |
|
|
|
lv_obj_add_event_cb(guider_ui.screen_w_list_NAME, table_style_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); |
|
|
|
lv_table_set_row_cnt(guider_ui.screen_w_list_NAME,1); |
|
|
|
lv_table_set_col_width(guider_ui.screen_w_list_NAME, 0, 50); |
|
|
|
lv_table_set_col_width(guider_ui.screen_w_list_NAME, 1, 250); |
|
|
|
lv_table_set_cell_value(guider_ui.screen_w_list_NAME,0,0,"步"); |
|
|
|
lv_table_set_cell_value(guider_ui.screen_w_list_NAME,0,1,"工艺"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
guider_ui.screen_w_list = lv_table_create(guider_ui.screen_step_list); |
|
|
|
table_style_init(guider_ui.screen_w_list); |
|
|
|
lv_obj_add_event_cb(guider_ui.screen_w_list, table_step_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); |
|
|
|
lv_table_set_col_cnt(guider_ui.screen_w_list,2); |
|
|
|
lv_table_set_row_cnt(guider_ui.screen_w_list,6); |
|
|
|
lv_table_set_row_cnt(guider_ui.screen_w_list,2); |
|
|
|
lv_table_set_col_width(guider_ui.screen_w_list, 0, 50); |
|
|
|
lv_table_set_col_width(guider_ui.screen_w_list, 1, 250); |
|
|
|
lv_obj_set_style_height(guider_ui.screen_w_list, 100, LV_PART_ITEMS | LV_STATE_DEFAULT); |
|
|
|
lv_obj_set_style_min_height(guider_ui.screen_w_list, 100, LV_PART_ITEMS | LV_STATE_DEFAULT); |
|
|
|
lv_obj_set_style_max_height(guider_ui.screen_w_list, 100, LV_PART_ITEMS | LV_STATE_DEFAULT); |
|
|
|
|
|
|
|
//
|
|
|
|
lv_obj_set_size(guider_ui.screen_text_inf, 550, 230); |
|
|
|
lv_label_set_text(guider_ui.screen_text_inf,""); |
|
|
|
/* Add your codes here */ |
|
|
|
} |
|
|
|
|
|
|
|
|