lv_table.h

API reference for lv_table.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_table_private.h

Functions

lv_table_set_cell_value

Set the value of a cell.

 
void lv_table_set_cell_value(lv_obj_t *obj, uint32_t row, uint32_t col, const char *txt)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a Table object
rowuint32_tid of the row [0 .. row_cnt -1]
coluint32_tid of the column [0 .. col_cnt -1]
txtconst char *text to display in the cell. It will be copied and saved so this variable is not required after this function call.

New roes/columns are added automatically if required

lv_table_set_cell_value_fmt

Set the value of a cell. Memory will be allocated to store the text by the table.

 
void lv_table_set_cell_value_fmt(lv_obj_t *obj, uint32_t row, uint32_t col, const char *fmt,...)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a Table object
rowuint32_tid of the row [0 .. row_cnt -1]
coluint32_tid of the column [0 .. col_cnt -1]
fmtconst char *printf-like format
...

New roes/columns are added automatically if required

lv_table_set_row_count

Set the number of rows

 
void lv_table_set_row_count(lv_obj_t *obj, uint32_t row_cnt)
Parameters
NameTypeDescription
objlv_obj_t *table pointer to a Table object
row_cntuint32_tnumber of rows

lv_table_set_column_count

Set the number of columns

 
void lv_table_set_column_count(lv_obj_t *obj, uint32_t col_cnt)
Parameters
NameTypeDescription
objlv_obj_t *table pointer to a Table object
col_cntuint32_tnumber of columns.

lv_table_set_column_width

Set the width of a column

 
void lv_table_set_column_width(lv_obj_t *obj, uint32_t col_id, int32_t w)
Parameters
NameTypeDescription
objlv_obj_t *table pointer to a Table object
col_iduint32_tid of the column [0 .. LV_TABLE_COL_MAX -1]
wint32_twidth of the column

lv_table_set_cell_ctrl

Add control bits to the cell.

 
void lv_table_set_cell_ctrl(lv_obj_t *obj, uint32_t row, uint32_t col, lv_table_cell_ctrl_t ctrl)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a Table object
rowuint32_tid of the row [0 .. row_cnt -1]
coluint32_tid of the column [0 .. col_cnt -1]
ctrllv_table_cell_ctrl_tOR-ed values from lv_table_cell_ctrl_t

lv_table_set_cell_user_data

Add custom user data to the cell.

 
void lv_table_set_cell_user_data(lv_obj_t *obj, uint16_t row, uint16_t col, void *user_data)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a Table object
rowuint16_tid of the row [0 .. row_cnt -1]
coluint16_tid of the column [0 .. col_cnt -1]
user_datavoid *pointer to the new user_data. Should be allocated by lv_malloc, and it will be freed automatically when the table is deleted or when the cell is dropped due to lower row or column count.

lv_table_set_selected_cell

Set the selected cell

 
void lv_table_set_selected_cell(lv_obj_t *obj, uint16_t row, uint16_t col)
Parameters
NameTypeDescription
objlv_obj_t *pointer to a table object
rowuint16_tid of the cell row to select
coluint16_tid of the cell column to select

Enums

lv_table_cell_ctrl_t

NameValue
LV_TABLE_CELL_CTRL_NONE0 << 0
LV_TABLE_CELL_CTRL_MERGE_RIGHT1 << 0
LV_TABLE_CELL_CTRL_TEXT_CROP1 << 1
LV_TABLE_CELL_CTRL_CUSTOM_11 << 4
LV_TABLE_CELL_CTRL_CUSTOM_21 << 5
LV_TABLE_CELL_CTRL_CUSTOM_31 << 6
LV_TABLE_CELL_CTRL_CUSTOM_41 << 7
Used by 3 functions
  • lv_table_set_cell_ctrl — param ctrl
  • lv_table_clear_cell_ctrl — param ctrl
  • lv_table_has_cell_ctrl — param ctrl

_lv_property_table_id_t

NameValue
LV_PROPERTY_TABLE_ROW_COUNT(LV_PROPERTY_TABLE_START + ((int) 0 )) | (( 1 ) << 28 )
LV_PROPERTY_TABLE_COLUMN_COUNT(LV_PROPERTY_TABLE_START + ((int) 1 )) | (( 1 ) << 28 )
LV_PROPERTY_TABLE_END

Macros

LV_TABLE_CELL_NONE

 
#define LV_TABLE_CELL_NONE 0XFFFF

Variables

lv_table_class

 
const lv_obj_class_t lv_table_class

Dependencies

How is this guide?

Last updated on

On this page