Next Previous Up Top Contents Index

7.3 DUIM-Layouts Module

<column-layout>

Open abstract instantiable class

Summary

The class of column layouts.

Superclasses

<layout>

Init-keywords

border:
An instance of type <integer>. Default value: 0.

spacing:, y-spacing:

An instance of type <integer>. Default value: 0.

equalize-heights?:

An instance of type <boolean>. Default value: #f.

equalize-widths?:

An instance of type <boolean>. Default value: #f.

x-alignment:
An instance of type one-of(#"left", #"right", #"center"). Default value: #"left".

ratios:, y-ratios:

An instance of type false-or(limited(<sequence>), of: <integer>)). Default value: #f.

Library

duim-layouts

Module

duim-layouts

Description

The class of column layouts. A column layout arranges its children in a column, automatically calculating the size and placement of each child within the specified parameters.

Figure 7.2 Three buttons arranged in a column layout

The border: init-keyword provides a border of whitespace around the children in the layout, and the value of this init-keyword represents the size of the border in pixels. This basically has the same effect as using the macro with-spacing around the layout, except it uses a simpler syntax.

The spacing: or y-spacing: init-keywords let you specify how much vertical space should be inserted, in pixels, between the children of the layout. These two init-keywords can be used interchangeably.

If true, equalize-heights?: ensures that all the children of the layout have the same height.

If true, equalize-widths?: ensures that all the children of the layout have the same width.

By default, all the children of a column layout are left-aligned. You can specify that they should be right or center-aligned using the x-alignment: keyword.

The ratios: or y-ratios: init-keywords let you specify the proportion of the total layout that should be taken up by each individual child. These two init-keywords can be used interchangeably.

The value passed to ratios: needs to be a sequence of as many integers as there are children in the layout. Each child is then allocated the appropriate portion of vertical space in the layout. For example, if the value #(1, 2, 3) is specified for the ratios: init-keyword of a column layout containing three children, then the first child would claim a sixth of the available vertical space, the second child would claim a third of the vertical space, and the third child would claim half the vertical space, as shown in the diagram below.

Operations

None.

Example

contain(make(<column-layout>, 
             children: vector(make(<button>, 
                                   label: "Hello"),
                              make(<button>, 
                                   label: "World")) 
             spacing: 100, 
             x-alignment: #"right", 
             ratios: #(1, 3)));

See also

<grid-layout>, page 466

<layout>, page 468

<row-layout>, page 480

<stack-layout>, page 491

<table-layout>, page 494

vertically, page 500


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index