ColumnBox arranges boxes in one or more columns.
The number and width of the columns as well as the size of the gap between the columns can be modified. Additionally, the contents can either fill the columns one after the other or the columns can be made equally high.
If the column box has padding and/or borders specified, they are handled like with any other box. This means they are around all columns and their contents and are not used separately for each column.
The following style properties are used (additionally to those used by the parent class):
If this is set to :flow, the frames created for the columns will take the shape of the frame into account. This also means that the
available_heightarguments are ignored.
The columns definition.
This is an array containing the widths of the columns. The size of the array is the number of columns.
If a negative integer is used for the width, the column is auto-sized. Such columns split the remaining width (after substracting the widths of the fixed columns) proportionally among them. For example, if the definition is [-1, -2, -2], the first column is a fifth of the width and the other columns are each two fifth of the width.
composer.box(:column, columns: 2, gaps: 10, children: [composer.document.layout.lorem_ipsum_box])
composer.box(:column, columns: [50, -2, -1], gaps: [10, 5], children: [composer.document.layout.lorem_ipsum_box])
Public Class Methods
Creates a new
ColumnBox object for the given child boxes in
Can either simply integer specify the number of columns or be a full column definition (see
Can either be a simply integer specifying the width between two columns or a full gap definition (see gap for details).
fitmethod tries to balance the columns in terms of their height. Otherwise the columns are filled from the left.
Public Instance Methods
Fits the column box into the available space.
If the style property 'position' is set to :flow, the columns might not be rectangles but arbitrary (sets of) polygons since the +frame+s shape is taken into account.
true as the 'position' style property value :flow is supported.