|
HikoGUI
A low latency retained GUI
|
#include <hikogui/widgets/grid_layout.hpp>
Public Member Functions | |
| grid_layout (grid_layout const &)=delete | |
| grid_layout (grid_layout &&)=delete | |
| grid_layout & | operator= (grid_layout const &)=delete |
| grid_layout & | operator= (grid_layout &&)=delete |
| void | clear () noexcept |
| Clear the list of widgets in the layout. | |
| void | add_constraint (std::size_t first, std::size_t last, float minimum, float preferred, float maximum, float margin_before, float margin_after, widget_baseline baseline=widget_baseline{}) noexcept |
| Add a constraint for a widget. | |
| void | add_constraint (std::size_t index, float minimum, float preferred, float maximum, float margin_before, float margin_after, widget_baseline baseline=widget_baseline{}) noexcept |
| Add a constraint for a widget. | |
| void | commit_constraints () noexcept |
| Commit all the constraints. | |
| std::size_t | num_cells () const noexcept |
| The number of cells of the grid_layout. | |
| float | minimum () const noexcept |
| The minimum size of the total grid_layout. | |
| float | preferred () const noexcept |
| The minimum size of the total grid_layout. | |
| float | maximum () const noexcept |
| The minimum size of the total grid_layout. | |
| float | margin_before () const noexcept |
| float | margin_after () const noexcept |
| void | layout (float size) noexcept |
| Layout the cells based on the total size. | |
| float | get_position (std::size_t index) const noexcept |
| Get position of cell. | |
| float | get_size (std::size_t first, std::size_t last) const noexcept |
| Get size of the cells. | |
| float | get_size (std::size_t index) const noexcept |
| Get size of the cell. | |
| std::pair< float, float > | get_position_and_size (std::size_t first, std::size_t last) const noexcept |
| Get the position and size of a cell-span. | |
| std::pair< float, float > | get_position_and_size (std::size_t index) const noexcept |
| Get the position and size of cell. | |
| std::pair< float, float > | get_positions (std::size_t first, std::size_t last) const noexcept |
| Get the start and end position of the cells. | |
| std::pair< float, float > | get_positions (std::size_t index) const noexcept |
| Get the start and end position of a cell. | |
| widget_baseline | get_baseline (std::size_t first, std::size_t last) const noexcept |
| widget_baseline | get_baseline (std::size_t index) const noexcept |
Grid layout is used to layout widgets along an axis.
A grid_widget will use two grid_layout, one for column and one for row layout. The row_widget and column_widget only need a single grid_layout.
|
inlinenoexcept |
Add a constraint for a widget.
| first | The index of the first cell that the widget occupies. |
| last | The index one past the last cell that the widget occupies. |
| minimum | The absolute minimum size that a widget must be laid out as. |
| preferred | The preferred size a widgets wants to be laid out as. |
| maximum | The maximum size that a widget should be laid out as. |
| margin_before | The space between this widget and other widgets. |
| margin_after | The space between this widget and other widgets. |
|
inlinenoexcept |
Add a constraint for a widget.
| index | The index of the cell that the widget occupies. |
| minimum | The absolute minimum size that a widget must be laid out as. |
| preferred | The preferred size a widgets wants to be laid out as. |
| maximum | The maximum size that a widget should be laid out as. |
| margin_before | The space between this widget and other widgets. |
| margin_after | The space between this widget and other widgets. |
|
inlinenoexcept |
Clear the list of widgets in the layout.
|
noexcept |
Commit all the constraints.
This function will start calculating the constraints of the grid_layout.
add_constraints().
|
inlinenoexcept |
Get position of cell.
| index | The index of the cell. |
|
inlinenoexcept |
Get the position and size of a cell-span.
| first | The index of the first cell. |
| last | The index one past the last cell. |
|
inlinenoexcept |
Get the position and size of cell.
| index | The index of the cell. |
|
inlinenoexcept |
Get the start and end position of the cells.
| first | The index of the first cell. |
| last | The index one past the last cell. |
|
inlinenoexcept |
Get the start and end position of a cell.
layout() must be called. | index | The index of the cell. |
|
inlinenoexcept |
Get size of the cells.
| first | The index of the first cell. |
| last | The index one past the last cell. |
|
inlinenoexcept |
Get size of the cell.
| index | The index of the cell. |
|
noexcept |
Layout the cells based on the total size.
commit_constraints() must be called.
|
inlinenoexcept |
The minimum size of the total grid_layout.
commit_constraints() must be called.
|
inlinenoexcept |
The minimum size of the total grid_layout.
commit_constraints() must be called.
|
inlinenoexcept |
The number of cells of the grid_layout.
commit_constraints() must be called.
|
inlinenoexcept |
The minimum size of the total grid_layout.
commit_constraints() must be called.