#include <hikogui/layout/grid_layout.hpp>
|
using | value_type = T |
|
using | cell_type = detail::grid_layout_cell<value_type> |
|
using | cell_vector = std::vector<cell_type> |
|
using | iterator = cell_vector::iterator |
|
using | const_iterator = cell_vector::const_iterator |
|
using | reference = cell_vector::reference |
|
using | const_reference = cell_vector::const_reference |
|
|
constexpr | grid_layout (grid_layout const &) noexcept=default |
|
constexpr | grid_layout (grid_layout &&) noexcept=default |
|
constexpr grid_layout & | operator= (grid_layout const &) noexcept=default |
|
constexpr grid_layout & | operator= (grid_layout &&) noexcept=default |
|
constexpr bool | empty () const noexcept |
|
constexpr size_t | size () const noexcept |
|
constexpr size_t | num_columns () const noexcept |
|
constexpr size_t | num_rows () const noexcept |
|
constexpr iterator | begin () noexcept |
|
constexpr iterator | end () noexcept |
|
constexpr const_iterator | begin () const noexcept |
|
constexpr const_iterator | end () const noexcept |
|
constexpr const_iterator | cbegin () const noexcept |
|
constexpr const_iterator | cend () const noexcept |
|
constexpr const_reference | operator[] (size_t i) const noexcept |
|
constexpr reference | operator[] (size_t i) noexcept |
|
constexpr bool | cell_in_use (size_t first_column, size_t first_row, size_t last_column, size_t last_row) noexcept |
| Check if the cell on the grid is already in use.
|
|
template<forward_of< value_type > Value> |
constexpr reference | add_cell (size_t first_column, size_t first_row, size_t last_column, size_t last_row, Value &&value, bool beyond_maximum=false) noexcept |
| Check if the cell on the grid is already in use.
|
|
template<forward_of< value_type > Value> |
constexpr reference | add_cell (size_t column, size_t row, Value &&value, bool beyond_maximum=false) noexcept |
| Check if the cell on the grid is already in use.
|
|
constexpr void | clear () noexcept |
|
constexpr box_constraints | constraints (bool left_to_right) const noexcept |
|
constexpr void | set_layout (box_shape const &shape, float baseline_adjustment) noexcept |
| Layout the cells based on the width and height.
|
|
template<typename T>
class hi::v1::grid_layout< T >
Grid layout algorithm.
◆ add_cell() [1/2]
template<typename T >
template<forward_of< value_type > Value>
constexpr reference hi::v1::grid_layout< T >::add_cell |
( |
size_t | column, |
|
|
size_t | row, |
|
|
Value && | value, |
|
|
bool | beyond_maximum = false ) |
|
inlineconstexprnoexcept |
Check if the cell on the grid is already in use.
- Parameters
-
column | The column of the cell. |
row | The row of the cell. |
value | The value to be copied or moved into the cell. |
beyond_maximum | Allow this cell to resize beyond the maximum constraint. |
- Returns
- A reference to the created cell.
◆ add_cell() [2/2]
template<typename T >
template<forward_of< value_type > Value>
constexpr reference hi::v1::grid_layout< T >::add_cell |
( |
size_t | first_column, |
|
|
size_t | first_row, |
|
|
size_t | last_column, |
|
|
size_t | last_row, |
|
|
Value && | value, |
|
|
bool | beyond_maximum = false ) |
|
inlineconstexprnoexcept |
Check if the cell on the grid is already in use.
- Parameters
-
first_column | The first column of the cell-span. |
last_column | One beyond the last column of the cell-span. |
first_row | The first row of the cell-span. |
last_row | One beyond the last row of the cell-span. |
value | The value to be copied or moved into the cell. |
beyond_maximum | Allow this cell to resize beyond the maximum constraint. |
- Returns
- A reference to the created cell.
◆ cell_in_use()
template<typename T >
constexpr bool hi::v1::grid_layout< T >::cell_in_use |
( |
size_t | first_column, |
|
|
size_t | first_row, |
|
|
size_t | last_column, |
|
|
size_t | last_row ) |
|
inlineconstexprnoexcept |
Check if the cell on the grid is already in use.
- Parameters
-
first_column | The first column of the cell-span. |
first_row | The first row of the cell-span. |
last_column | One beyond the last column of the cell-span. |
last_row | One beyond the last row of the cell-span. |
- Return values
-
true | If the given cell-span overlaps with an already existing cell. |
◆ set_layout()
Layout the cells based on the width and height.
- Parameters
-
shape | The shape of the box to place the grid in. |
baseline_adjustment | How much the baseline needs to be adjusted when aligned to the top. |
The documentation for this class was generated from the following file: