Bambookit Home
Bambookit GUI Tutorial
Back
Next
IV. Advanced Features
Chapter 14. Auto Layout
Method signature
setLayout = "
[string name]
type,
[int]
width,
[int]
height,
[int]
offset"
[string name] is an string name value: iconviewx, iconviewy, listviewx,listviewx, fillview
Types of Layout
ZERO no Layout
setLayout="
0
,1,1,0"
This removes any layout already set
ONE, Iconic View x-axis
<Widget setSize="300,300"
setLayout="iconviewx,80,25,0"
>
<Button setLabel="1"/>
<Button setLabel="2"/>
<Button setLabel="3"/>
</Widget>
setLayout reads as;
Layout children using an Iconic View x-axis
setting all children to a size of 80x25 with offset number of pixels equals 0.
TWO, Iconic View y-axis
<Widget setSize="300,300"
setLayout="iconviewt,80,25,0"
>
<Button setLabel="1"/>
<Button setLabel="2"/>
<Button setLabel="3"/>
</Widget>
setLayout reads as;
Layout children using an Iconic View y-axis
setting all children to a size of 80x25 with offset number of pixels equals 0.
THREE, List View x-axis
<Widget setSize="300,300"
setLayout="listviewx,80,25,0"
>
<Button setLabel="1"/>
<Button setLabel="2"/>
<Button setLabel="3"/>
</Widget>
setLayout reads as;
Layout children using a List View x-axis
setting all children to a height of 25 (width is ignored)
FOUR, List View y-axis
<Widget setSize="300,300"
setLayout="listviewy,80,25,0"
>
<Button setLabel="1"/>
<Button setLabel="2"/>
<Button setLabel="3"/>
</Widget>
setLayout reads as;
Layout children using a List View y-axis
setting all children to a width of 80 (height is ignored)
Notes
If any of the children widgets had their Anchor attribute set
then the layout manager would NOT modify the widget and skip to the
next Child
See also the Quick Reference Guide on 'Anchors'
Back
Next