Ultra Light Client Guide and Reference


Box general advice

Code examples

The dimension of a new box is defined by sending the message #rows:columns: or #rows:columns:radioGroup: to the class:

UlcBox rows: 3 columns: 5 radioGroup: false

All boxes define the gap between contained cells, which is set by sending #setVerticalGap: or #setHorizontalGap: to the box. At initialization, use the methods #verticalGap: or #horizontalGap:, as follows:

UlcHBox new horizontalGap: 5.
 
UlcVBox new verticalGap: 5.
 
UlcBox new
 horizontalGap: 5;
 verticalGap: 5;
 yourself

Box also enables you to expand or align widgets within their cells. The UlcBox API includes the following convenience methods:

For example, the following code aligns widgets in UlcBox to the top left corner of their cells:

(UlcBox rows: 3 columns: 5 radioGroup: false)
 alignVerticalTop;
 alignHorizontalLeft;
 yourself

Widgets are added to a box sequentially and fill the box row by row (left to right, top to bottom). For more sophisticated layouts, you can specify that a widget uses more than one cell. This is known as spanning. In the following code, the familyName field is spanned over two cells:

(UlcBox rows: 3 columns: 5 radioGroup: false)
 add: (UlcField new ulcName: 'familyName'; columns: 10; yourself)
 horizontalSpan: 2
 verticalSpan: nil

For more details on layout and alignment, see ULC layout.

*


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]