The most frequently used layout views are:
The simplest layout view - all it does is displaying a string or image
label in its boundary. You can arrange for the label to be displayed
centered, left or right adjusted.
Also, the label can scale its image (even bitmaps !) to make them fit exactly.
Layout views (Geometry managers) are provided to manage a group
of other views. For example, a horizontalPanel arranges for its
components to to be aligned in a row.
Various layout strategies are available for common situations
(left-to-right, centered, spread equally or
filling).
Typical uses:
|top panel|
top := StandardSystemView new.
top extent:200@100.
panel := HorizontalPanelView
origin:0.0@0.0
corner:1.0@1.0
in:top.
panel addSubView:(Button label:'one').
panel addSubView:(Button label:'two').
panel addSubView:(Button label:'three').
top open.
|top panel|
top := StandardSystemView new.
top extent:200@100.
panel := HorizontalPanelView
origin:0.0@0.0
corner:1.0@1.0
in:top.
panel addSubView:(Button label:'one').
panel addSubView:(Button label:'two').
panel addSubView:(Button label:'three').
panel horizontalLayout:#right.
top open.
|top panel|
top := StandardSystemView new.
top extent:200@100.
panel := HorizontalPanelView
origin:0.0@0.0
corner:1.0@1.0
in:top.
panel addSubView:(Button label:'one').
panel addSubView:(Button label:'two').
panel addSubView:(Button label:'three').
panel horizontalLayout:#fit.
top open.
Variable panels allow an interactive change of the relative size ratios. For example, the browser's top list and bottom contents views are usually placed into a variableVerticalPanel.
Copyright © 1995 Claus Gittinger Development & Consulting
<cg at exept.de>