「App:Library:LVGL:docs:Layouts:Grid」の版間の差分
231行目: | 231行目: | ||
: | : | ||
− | ; void lv_obj_set_grid_dsc_array(lv_obj_t *obj, const lv_coord_t col_dsc[], const lv_coord_t row_dsc[]) | + | ; void lv_obj_set_grid_dsc_array([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, const lv_coord_t col_dsc[], const lv_coord_t row_dsc[]) |
: | : | ||
− | ; void lv_obj_set_grid_align(lv_obj_t *obj, lv_grid_align_t column_align, lv_grid_align_t row_align) | + | ; void lv_obj_set_grid_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_grid_align_t column_align, lv_grid_align_t row_align) |
: | : | ||
− | ; void lv_obj_set_grid_cell(lv_obj_t *obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, lv_grid_align_t row_align, uint8_t row_pos, uint8_t row_span) | + | ; void lv_obj_set_grid_cell([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, lv_grid_align_t row_align, uint8_t row_pos, uint8_t row_span) |
: Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen | : Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen | ||
:; Parameters | :; Parameters | ||
251行目: | 251行目: | ||
: Just a wrapper to <code style="color: #bb0000;">LV_GRID_FR</code> for bindings. | : Just a wrapper to <code style="color: #bb0000;">LV_GRID_FR</code> for bindings. | ||
− | ; void lv_style_set_grid_row_dsc_array( | + | ; void lv_style_set_grid_row_dsc_array([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, const lv_coord_t value[]) |
: | : | ||
281行目: | 281行目: | ||
: | : | ||
− | ; void lv_obj_set_style_grid_row_dsc_array(lv_obj_t *obj, const lv_coord_t value[], lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_row_dsc_array([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, const lv_coord_t value[], lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_column_dsc_array(lv_obj_t *obj, const lv_coord_t value[], lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_column_dsc_array([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, const lv_coord_t value[], lv_style_selector_t selector) |
: | : | ||
290行目: | 290行目: | ||
: | : | ||
− | ; void lv_obj_set_style_grid_column_align(lv_obj_t *obj, lv_grid_align_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_column_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_grid_align_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_column_pos(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_column_pos([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_column_span(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_column_span([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_row_pos(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_row_pos([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_row_span(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_row_span([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_x_align(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_x_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_cell_y_align(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_cell_y_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_coord_t value, lv_style_selector_t selector) |
: | : | ||
− | ; static inline const lv_coord_t *lv_obj_get_style_grid_row_dsc_array(const lv_obj_t *obj, uint32_t part) | + | ; static inline const lv_coord_t *lv_obj_get_style_grid_row_dsc_array(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline const lv_coord_t *lv_obj_get_style_grid_column_dsc_array(const lv_obj_t *obj, uint32_t part) | + | ; static inline const lv_coord_t *lv_obj_get_style_grid_column_dsc_array(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const lv_obj_t *obj, uint32_t part) | + | ; static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
2022年6月28日 (火) 15:26時点における版
https://docs.lvgl.io/8.2/widgets/index.html
英文 | 自動翻訳 |
---|---|
Grid
Overview
英文 | 自動翻訳 |
---|---|
The Grid layout is a subset of CSS Flexbox. It can arrange items into a 2D "table" that has rows or columns (tracks). The item can span through multiple columns or rows. The track's size can be set in pixel, to the largest item ( To make an object a grid container call Note that the grid layout feature of LVGL needs to be globally enabled with |
Terms
英文 | 自動翻訳 |
---|---|
|
Simple interface
英文 | 自動翻訳 |
---|---|
With the following functions you can easily set a Grid layout on any parent. |
Grid descriptors
英文 | 自動翻訳 |
---|---|
First you need to describe the size of rows and columns. It can be done by declaring 2 arrays and the track sizes in them. The last element must be For example: static lv_coord_t column_dsc[] = {100, 400, LV_GRID_TEMPLATE_LAST}; /*2 columns with 100 and 400 ps width*/ static lv_coord_t row_dsc[] = {100, 100, 100, LV_GRID_TEMPLATE_LAST}; /*3 100 px tall rows*/ To set the descriptors on a parent use Besides simple settings the size in pixel you can use two special values:
|
Grid items
英文 | 自動翻訳 |
---|---|
By default, the children are not added to the grid. They need to be added manually to a cell. To do this call
|
Grid align
英文 | 自動翻訳 |
---|---|
If there are some empty space the track can be aligned several ways:
To set the track's alignment use |
Style interface
英文 | 自動翻訳 |
---|---|
All the Grid related values are style properties under the hood and you can use them similarly to any other style properties. The following Grid related style properties exist:
|
Internal padding
英文 | 自動翻訳 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
To modify the minimum space Grid inserts between objects, the following properties can be set on the Grid container style:
Other featuresRTL
ExampleDemonstrate cell placement and spanDemonstrate grid's "free unit"Demonstrate track placementDemonstrate column and row gapDemonstrate RTL direction on grid
API
|