HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
hi::v1::grid Class Reference

#include <hikogui/layout/grid.hpp>

Public Member Functions

 grid (grid const &)=delete
 grid (grid &&)=delete
grid & operator= (grid const &)=delete
grid & operator= (grid &&)=delete
constexpr void update () noexcept
 Calculate the constraints for the grid.
constexpr void remove_cell (size_t id) noexcept
constexpr size_t add_cell () noexcept
constexpr detail::grid_cell_dataoperator[] (size_t id) noexcept
constexpr detail::grid_cell_data const & operator[] (size_t id) const noexcept

Detailed Description

The layout-algorithm:

Member Function Documentation

◆ update()

void hi::v1::grid::update ( )
inlineconstexprnoexcept

Calculate the constraints for the grid.

The constrain-algorithm:

  1. Assign priorities to each row and column.
  2. Assign margins to each row and column.
  3. Calculate the preferred-height of each row.
    • First handle row-span = 1
    • Next handle row-span > 1, and extent rows based on the priority assigned to each row.
  4. Calculate the preferred-width of each column.
    • First handle col-span = 1
    • Next handle col-span > 1, and extent columns based on the priority assigned to each column.
  5. Calculate the minimum-width of each column; select preferred-width or wrapped-width depending if the cell's wrapped-height fits into the preferred-height of the row it is in.

The documentation for this class was generated from the following file: