Creates an AdvancedGridLayout with specified columns, rows, and margin.
Retrieve the anchor data structure for a given widget
Append a column of the given size (and stretch factor)
Append a row of the given size (and stretch factor)
Return the number of cols
Computes the layout
The margin of this AdvancedGridLayout.
Sets the margin of this AdvancedGridLayout.
Return the number of rows
Specify the anchor data structure for a given widget
Set the stretch factor of a given column
Set the stretch factor of a given row
Helper struct to coordinate anchor points for the layout.
The mapping of widgets to their specified anchor points.
The stretch for each column of this AdvancedGridLayout.
The columns of this AdvancedGridLayout.
The margin around this AdvancedGridLayout.
The stretch for each row of this AdvancedGridLayout.
The rows of this AdvancedGridLayout.
Performs any and all resizing applicable.
The preferred size for this layout.
The margin of this Layout.
Sets the margin of this Layout.
The is a fancier grid layout with support for items that span multiple rows or columns, and per-widget alignment flags. Each row and column additionally stores a stretch factor that controls how additional space is redistributed. The downside of this flexibility is that a layout anchor data structure must be provided for each widget.
An example:
Label label = new Label(window, "A label"); // Add a centered label at grid position (1, 5), which spans two horizontal cells layout.setAnchor(label, AdvancedGridLayout.Anchor(1, 5, 2, 1, Alignment.Middle, Alignment.Middle));
The grid is initialized with user-specified column and row size vectors (which can be expanded later on if desired). If a size value of zero is specified for a column or row, the size is set to the maximum preferred size of any widgets contained in the same row or column. Any remaining space is redistributed according to the row and column stretch factors.
The high level usage somewhat resembles the classic HIG layout:
- https://web.archive.org/web/20070813221705/http://www.autel.cz/dmi/tutorial.html - https://github.com/jaapgeurts/higlayout