Layoutspacing example dialog

This script will demonstrate how you can use the $Layout command to arrange widgets in a dialog boxes.

There are in principle two $Layout methods: GRIDLAYOUT and HLAYOUT / VLAYOUT. In the GRIDLAYOUT everything is arranged in a grid existing of a certain number of columns and rows. With the HLAYOUT and VLAYOUT everything is arranged horzontaly or verticaly. With the parameter LAYOUTSPACING it is possible to insert a fixed space between each widget, as you can see in the left groupbox in the picture below. The LAYOUTSTRECHFACTOR will use the existing space, if there is any and then arrange the widgets relativly according to this parameter. In the groupbox on the right the existing space in the box is always divided by two from the top.

layoutspacing.comi
/Dialog Example to explain the layoutspacing and the layoutstrechfactor
$DIALOG ACTION=START TITLE='Layoutspacing and Layoutstrechfactor Example'
$Layout HLAYOUT ON
$GROUPBOX ACTION=START TITLE='Layoutspacing' ORIENTATION=HORIZONTAL STRIPS=1
$ LAYOUT VLAYOUT ON
$Displayline '<nobr>This will demonstrate how you</nobr>'
$Displayline '<nobr>can add a fixed space between widgets:</nobr>'
$ LAYOUT LAYOUTSPACING 20
$Displayline '<b>20 pixel</b> space above'
$ LAYOUT LAYOUTSPACING 30
$Displayline 'and now <b>30 pixel</b> space above and <b>40 pixel</b> below'
$ LAYOUT LAYOUTSPACING 40
$ LAYOUT VLAYOUT Off
$Groupbox ACTION=STOP
 
$GROUPBOX ACTION=START TITLE='Layoutstreching' ORIENTATION=HORIZONTAL STRIPS=1
$ LAYOUT VLAYOUT ON
$Displayline '<nobr>This will demonstrate how you can</nobr>'
$Displayline 'add a strechable space between widgets:'
$ Layout LAYOUTSTRETCH 4
$Displayline 'The Space above is 2 times the space below'
$ Layout LAYOUTSTRETCH 2
$Displayline 'The Space above is 2 times the space below'
$ Layout LAYOUTSTRETCH 1
$ LAYOUT VLAYOUT Off
$Groupbox ACTION=STOP
 
$Layout HLAYOUT Off
 
$Displayline 'When you resize this dialog with the mouse on the right corner, the effect will be even more obvious.'
 
$DIALOG ACTION=STop
scripts/dialogs/layoutspacing_example.txt · Last modified: 2012/03/21 16:15 (external edit)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0