Lines Matching refs:col

40 static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col);
41 static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col);
44 static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area);
86 void lv_table_set_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col, const char * txt) in lv_table_set_cell_value() argument
94 if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); in lv_table_set_cell_value()
97 uint32_t cell = row * table->col_cnt + col; in lv_table_set_cell_value()
122 refr_cell_size(obj, row, col); in lv_table_set_cell_value()
125 void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, const char * fmt, ...) in lv_table_set_cell_value_fmt() argument
131 if(col >= table->col_cnt) { in lv_table_set_cell_value_fmt()
132 lv_table_set_col_cnt(obj, col + 1); in lv_table_set_cell_value_fmt()
140 uint32_t cell = row * table->col_cnt + col; in lv_table_set_cell_value_fmt()
203 refr_cell_size(obj, row, col); in lv_table_set_cell_value_fmt()
304 uint32_t col; in lv_table_set_col_cnt() local
305 for(col = old_col_cnt; col < col_cnt; col++) { in lv_table_set_col_cnt()
306 table->col_w[col] = LV_DPI_DEF; in lv_table_set_col_cnt()
325 void lv_table_add_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) in lv_table_add_cell_ctrl() argument
332 if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); in lv_table_add_cell_ctrl()
335 uint32_t cell = row * table->col_cnt + col; in lv_table_add_cell_ctrl()
352 void lv_table_clear_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) in lv_table_clear_cell_ctrl() argument
359 if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); in lv_table_clear_cell_ctrl()
362 uint32_t cell = row * table->col_cnt + col; in lv_table_clear_cell_ctrl()
380 void lv_table_set_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col, void * user_data) in lv_table_set_cell_user_data() argument
387 if(col >= table->col_cnt) lv_table_set_col_cnt(obj, col + 1); in lv_table_set_cell_user_data()
390 uint32_t cell = row * table->col_cnt + col; in lv_table_set_cell_user_data()
414 const char * lv_table_get_cell_value(lv_obj_t * obj, uint16_t row, uint16_t col) in lv_table_get_cell_value() argument
419 if(row >= table->row_cnt || col >= table->col_cnt) { in lv_table_get_cell_value()
423 uint32_t cell = row * table->col_cnt + col; in lv_table_get_cell_value()
446 lv_coord_t lv_table_get_col_width(lv_obj_t * obj, uint16_t col) in lv_table_get_col_width() argument
452 if(col >= table->col_cnt) { in lv_table_get_col_width()
457 return table->col_w[col]; in lv_table_get_col_width()
460 bool lv_table_has_cell_ctrl(lv_obj_t * obj, uint16_t row, uint16_t col, lv_table_cell_ctrl_t ctrl) in lv_table_has_cell_ctrl() argument
465 if(row >= table->row_cnt || col >= table->col_cnt) { in lv_table_has_cell_ctrl()
469 uint32_t cell = row * table->col_cnt + col; in lv_table_has_cell_ctrl()
475 void lv_table_get_selected_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) in lv_table_get_selected_cell() argument
479 *col = table->col_act; in lv_table_get_selected_cell()
483 void * lv_table_get_cell_user_data(lv_obj_t * obj, uint16_t row, uint16_t col) in lv_table_get_cell_user_data() argument
488 if(row >= table->row_cnt || col >= table->col_cnt) { in lv_table_get_cell_user_data()
492 uint32_t cell = row * table->col_cnt + col; in lv_table_get_cell_user_data()
577 uint16_t col; in lv_table_event() local
579 lv_res_t pr_res = get_pressed_cell(obj, &row, &col); in lv_table_event()
581 if(pr_res == LV_RES_OK && (table->col_act != col || table->row_act != row)) { in lv_table_event()
582 table->col_act = col; in lv_table_event()
607 int32_t col = table->col_act; in lv_table_event() local
609 if(col == LV_TABLE_CELL_NONE || row == LV_TABLE_CELL_NONE) { in lv_table_event()
617 if(col >= table->col_cnt) col = 0; in lv_table_event()
620 if(c == LV_KEY_LEFT) col--; in lv_table_event()
621 else if(c == LV_KEY_RIGHT) col++; in lv_table_event()
626 if(col >= table->col_cnt) { in lv_table_event()
628 col = 0; in lv_table_event()
632 col = table->col_cnt - 1; in lv_table_event()
635 else if(col < 0) { in lv_table_event()
637 col = table->col_cnt - 1; in lv_table_event()
641 col = 0; in lv_table_event()
652 if(table->col_act != col || table->row_act != row) { in lv_table_event()
653 table->col_act = col; in lv_table_event()
703 uint16_t col; in draw_main() local
731 for(col = 0; col < table->col_cnt; col++) { in draw_main()
737 cell_area.x1 = cell_area.x2 - table->col_w[col] + 1; in draw_main()
741 cell_area.x2 = cell_area.x1 + table->col_w[col] - 1; in draw_main()
745 for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { in draw_main()
752 lv_coord_t offset = table->col_w[col + col_merge + 1]; in draw_main()
764 col += col_merge; in draw_main()
786 if(row == table->row_act && col == table->col_act) { in draw_main()
811 part_draw_dsc.id = row * table->col_cnt + col; in draw_main()
856 col += col_merge; in draw_main()
890 static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col) in refr_cell_size() argument
914 get_cell_area(obj, row, col, &cell_area); in refr_cell_size()
936 uint16_t col; in get_row_height() local
937 for(cell = row_start, col = 0; cell < row_start + table->col_cnt; cell++, col++) { in get_row_height()
944 lv_coord_t txt_w = table->col_w[col]; in get_row_height()
950 for(col_merge = 0; col_merge + col < table->col_cnt - 1; col_merge++) { in get_row_height()
957 txt_w += table->col_w[col + col_merge + 1]; in get_row_height()
982 col += col_merge; in get_row_height()
989 static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col) in get_pressed_cell() argument
995 if(col) *col = LV_TABLE_CELL_NONE; in get_pressed_cell()
1004 if(col) { in get_pressed_cell()
1015 *col = 0; in get_pressed_cell()
1017 for(*col = 0; *col < table->col_cnt; (*col)++) { in get_pressed_cell()
1018 tmp += table->col_w[*col]; in get_pressed_cell()
1064 static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area) in get_cell_area() argument
1070 for(c = 0; c < col; c++) { in get_cell_area()
1079 area->x1 = area->x2 - table->col_w[col]; in get_cell_area()
1084 area->x2 = area->x1 + table->col_w[col] - 1; in get_cell_area()