Changing Form Layout Dynamically
For form components, you can override the layout as defined in the Define Frames worksheet using the $paintedfieldproperties ProcScript function. At runtime, the form displays the fields using the position and size coordinates and optional Z-order specified with this function.
It is possible to move and resize fields in a form, with the following exceptions:
- Labels—moving the field does not move the label.
- GUI only—it is not possible to alter the layout of fields in character-based forms.
- Grid widgets—fields in grid widgets cannot be moved or resized.
- Split bars—$paintedfieldproperties has no effect on forms with split bars
$paintedfieldproperties returns or sets the dynamic widget properties for the specified widget, independent of the retrieved occurrence. $paintedfieldproperties accepts the following properties related to position and size, expressed in characters:
xpos
—sets the horizontal positionypos
—sets the vertical positionxsize
—sets the horizontal sizeysize
—sets the vertical size in characterszorder
—places the painted field to top or bottom of a stack of fields, along a virtual Z-axis (Z-order). This is useful when fields stack or overlap.
You can define absolute values for theses properties, or you precede them by a + or - to set relative values, as shown in the following examples.
The following ProcScript moves the second repetition of field MYFIELD to position 20 horizontally and 15 vertically:
$paintedfieldproperties("MYFIELD","2","xpos;ypos") = "xpos=20;ypos=15"
The following ProcScript moves the second repetition of field MYFIELD 5 characters to the left and 6 characters down:
$paintedfieldproperties("MYFIELD","2","xpos;ypos") = "xpos–=5;ypos+=6"