table updates

This commit is contained in:
Gabor Kiss-Vamosi
2018-11-29 08:52:21 +01:00
parent c1140ec6a7
commit e7058e9135
2 changed files with 207 additions and 31 deletions

View File

@@ -31,12 +31,27 @@ extern "C" {
/**********************
* TYPEDEFS
**********************/
typedef enum {
LV_TABLE_CELL_ALIGN_LEFT,
LV_TABLE_CELL_ALIGN_RIGHT,
LV_TABLE_CELL_ALIGN_CENTER,
}lv_table_cell_align_t;
typedef union {
struct {
uint8_t align:2;
uint8_t right_merge:1;
};
uint8_t format_byte;
}lv_table_cell_format_t;
/*Data of table*/
typedef struct {
/*New data for this type */
uint16_t col_cnt;
uint16_t row_cnt;
const char ** cell_data;
char ** cell_data;
lv_style_t * cell_style;
lv_coord_t col_w[LV_TABLE_COL_MAX];
} lv_table_ext_t;
@@ -62,6 +77,16 @@ typedef uint8_t lv_table_style_t;
*/
lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy);
void lv_table_set_cell_value(lv_obj_t * table, uint16_t row, uint16_t col, const char * txt);
void lv_table_set_cell_format(lv_obj_t * table, uint16_t row, uint16_t col, lv_table_cell_align_t align);
void lv_table_set_cell_merge_right(lv_obj_t * table, uint16_t row, uint16_t col, bool en);
void lv_table_set_row_cnt(lv_obj_t * table, uint16_t row_cnt);
void lv_table_set_col_cnt(lv_obj_t * table, uint16_t col_cnt);
/*======================
* Add/remove functions
*=====================*/