mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(table): rename shortened function names to full names (#4918)
This commit is contained in:
parent
55d35329ba
commit
91020ea20e
@ -50,7 +50,7 @@ Width and Height
|
||||
----------------
|
||||
|
||||
The width of the columns can be set with
|
||||
:cpp:expr:`lv_table_set_col_width(table, col_id, width)`. The overall width of
|
||||
:cpp:expr:`lv_table_set_column_width(table, col_id, width)`. The overall width of
|
||||
the Table object will be set to the sum of columns widths.
|
||||
|
||||
The height is calculated automatically from the cell styles (font,
|
||||
|
@ -70,7 +70,7 @@ void lv_example_table_2(void)
|
||||
/*Set a smaller height to the table. It'll make it scrollable*/
|
||||
lv_obj_set_size(table, LV_SIZE_CONTENT, 200);
|
||||
|
||||
lv_table_set_col_width(table, 0, 150);
|
||||
lv_table_set_column_width(table, 0, 150);
|
||||
lv_table_set_row_count(table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/
|
||||
lv_table_set_column_count(table, 1);
|
||||
|
||||
|
@ -226,6 +226,8 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
|
||||
#define lv_table_set_row_cnt lv_table_set_row_count
|
||||
#define lv_table_get_col_cnt lv_table_get_column_count
|
||||
#define lv_table_get_row_cnt lv_table_get_row_count
|
||||
#define lv_table_set_col_width lv_table_set_column_width
|
||||
#define lv_table_get_col_width lv_table_get_column_width
|
||||
|
||||
#define lv_dropdown_get_option_cnt lv_dropdown_get_option_count
|
||||
|
||||
|
@ -321,7 +321,7 @@ static void lv_file_explorer_constructor(const lv_obj_class_t * class_p, lv_obj_
|
||||
/*Table showing the contents of the table of contents*/
|
||||
explorer->file_table = lv_table_create(explorer->browser_area);
|
||||
lv_obj_set_size(explorer->file_table, LV_PCT(100), LV_PCT(86));
|
||||
lv_table_set_col_width(explorer->file_table, 0, LV_PCT(100));
|
||||
lv_table_set_column_width(explorer->file_table, 0, LV_PCT(100));
|
||||
lv_table_set_column_count(explorer->file_table, 1);
|
||||
lv_obj_add_event_cb(explorer->file_table, browser_file_event_handler, LV_EVENT_ALL, obj);
|
||||
|
||||
@ -516,7 +516,7 @@ static void browser_file_event_handler(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
else if(code == LV_EVENT_SIZE_CHANGED) {
|
||||
lv_table_set_col_width(explorer->file_table, 0, lv_obj_get_width(explorer->file_table));
|
||||
lv_table_set_column_width(explorer->file_table, 0, lv_obj_get_width(explorer->file_table));
|
||||
}
|
||||
else if((code == LV_EVENT_CLICKED) || (code == LV_EVENT_RELEASED)) {
|
||||
lv_obj_send_event(obj, LV_EVENT_CLICKED, NULL);
|
||||
|
@ -299,7 +299,7 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt)
|
||||
refr_size_form_row(obj, 0) ;
|
||||
}
|
||||
|
||||
void lv_table_set_col_width(lv_obj_t * obj, uint32_t col_id, int32_t w)
|
||||
void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
@ -427,7 +427,7 @@ uint32_t lv_table_get_column_count(lv_obj_t * obj)
|
||||
return table->col_cnt;
|
||||
}
|
||||
|
||||
int32_t lv_table_get_col_width(lv_obj_t * obj, uint32_t col)
|
||||
int32_t lv_table_get_column_width(lv_obj_t * obj, uint32_t col)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
|
@ -125,7 +125,7 @@ void lv_table_set_column_count(lv_obj_t * obj, uint32_t col_cnt);
|
||||
* @param col_id id of the column [0 .. LV_TABLE_COL_MAX -1]
|
||||
* @param w width of the column
|
||||
*/
|
||||
void lv_table_set_col_width(lv_obj_t * obj, uint32_t col_id, int32_t w);
|
||||
void lv_table_set_column_width(lv_obj_t * obj, uint32_t col_id, int32_t w);
|
||||
|
||||
/**
|
||||
* Add control bits to the cell.
|
||||
@ -190,7 +190,7 @@ uint32_t lv_table_get_column_count(lv_obj_t * obj);
|
||||
* @param col id of the column [0 .. LV_TABLE_COL_MAX -1]
|
||||
* @return width of the column
|
||||
*/
|
||||
int32_t lv_table_get_col_width(lv_obj_t * obj, uint32_t col);
|
||||
int32_t lv_table_get_column_width(lv_obj_t * obj, uint32_t col);
|
||||
|
||||
/**
|
||||
* Get whether a cell has the control bits
|
||||
|
@ -109,7 +109,7 @@ void test_table_should_wrap_long_texts(void)
|
||||
const char * long_text = "Testing automatic text wrap with a very long text";
|
||||
const char * small_text = "Hi";
|
||||
|
||||
lv_table_set_col_width(table, 0, 50);
|
||||
lv_table_set_column_width(table, 0, 50);
|
||||
|
||||
lv_table_set_cell_value(table, 0, 0, small_text);
|
||||
int32_t row_height = table_ptr->row_h[0];
|
||||
@ -171,8 +171,8 @@ void test_table_rendering(void)
|
||||
lv_obj_set_style_border_width(table, 5, LV_PART_ITEMS);
|
||||
lv_table_set_column_count(table, 5);
|
||||
lv_table_set_row_count(table, 5);
|
||||
lv_table_set_col_width(table, 1, 60);
|
||||
lv_table_set_col_width(table, 2, 100);
|
||||
lv_table_set_column_width(table, 1, 60);
|
||||
lv_table_set_column_width(table, 2, 100);
|
||||
|
||||
lv_table_add_cell_ctrl(table, 0, 1, LV_TABLE_CELL_CTRL_MERGE_RIGHT);
|
||||
lv_table_set_cell_value(table, 0, 1, "2 cells are merged");
|
||||
|
Loading…
x
Reference in New Issue
Block a user