lv_table.h
API reference for lv_table.h
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_table_private.h
Functions
widgets/table/lv_table.h:80function
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a Table object |
row | uint32_t | id of the row [0 .. row_cnt -1] |
col | uint32_t | id of the column [0 .. col_cnt -1] |
txt | const 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
widgets/table/lv_table.h:90function
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,...)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a Table object |
row | uint32_t | id of the row [0 .. row_cnt -1] |
col | uint32_t | id of the column [0 .. col_cnt -1] |
fmt | const char * | printf-like format |
... |
New roes/columns are added automatically if required
widgets/table/lv_table.h:98function
lv_table_set_row_count
Set the number of rows
void lv_table_set_row_count(lv_obj_t *obj, uint32_t row_cnt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | table pointer to a Table object |
row_cnt | uint32_t | number of rows |
widgets/table/lv_table.h:105function
lv_table_set_column_count
Set the number of columns
void lv_table_set_column_count(lv_obj_t *obj, uint32_t col_cnt)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | table pointer to a Table object |
col_cnt | uint32_t | number of columns. |
widgets/table/lv_table.h:113function
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | table pointer to a Table object |
col_id | uint32_t | id of the column [0 .. LV_TABLE_COL_MAX -1] |
w | int32_t | width of the column |
widgets/table/lv_table.h:122function
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a Table object |
row | uint32_t | id of the row [0 .. row_cnt -1] |
col | uint32_t | id of the column [0 .. col_cnt -1] |
ctrl | lv_table_cell_ctrl_t | OR-ed values from lv_table_cell_ctrl_t |
widgets/table/lv_table.h:143function
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a Table object |
row | uint16_t | id of the row [0 .. row_cnt -1] |
col | uint16_t | id of the column [0 .. col_cnt -1] |
user_data | void * | 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. |
widgets/table/lv_table.h:151function
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a table object |
row | uint16_t | id of the cell row to select |
col | uint16_t | id of the cell column to select |
Enums
lv_table_cell_ctrl_t
| Name | Value |
|---|---|
LV_TABLE_CELL_CTRL_NONE | 0 << 0 |
LV_TABLE_CELL_CTRL_MERGE_RIGHT | 1 << 0 |
LV_TABLE_CELL_CTRL_TEXT_CROP | 1 << 1 |
LV_TABLE_CELL_CTRL_CUSTOM_1 | 1 << 4 |
LV_TABLE_CELL_CTRL_CUSTOM_2 | 1 << 5 |
LV_TABLE_CELL_CTRL_CUSTOM_3 | 1 << 6 |
LV_TABLE_CELL_CTRL_CUSTOM_4 | 1 << 7 |
Used by 3 functions
lv_table_set_cell_ctrl— paramctrllv_table_clear_cell_ctrl— paramctrllv_table_has_cell_ctrl— paramctrl
_lv_property_table_id_t
| Name | Value |
|---|---|
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 0XFFFFVariables
widgets/table/lv_table.h:47variable
lv_table_class
const lv_obj_class_t lv_table_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_array.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_conf_kconfig.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_ll.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property_names.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_observer.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_style_properties.hlv_symbol_def.hlv_text.hlv_tick.hlv_timer.hlv_types.h
How is this guide?
Last updated on