PML Customisation User Guide

Form Layout : Positioning, Alignment and Size of Gadgets
AVEVA strongly recommend that you lay out your form using auto-placement in combination with relative placement because it allows gadgets to be added, removed, and repositioned without having to adjust the geometry of other gadgets on the form. In general, avoid the use of the AutoAlign keyword.
Auto-placement chooses a gadget's position coordinate automatically, relative to the last placed gadget.
Relative placement uses the AT syntax to specify a gadget's position coordinate relative to the limits of previously placed gadget.
A gadget's size component, width or height, is either a literal value, or a previous gadget's size component, or an extension to a previous gadget's co-ordinate limit, i.e. min or max. The last option, referred to as sizing to Positional Extent, uses the width to… and height to… syntax. This makes it much simpler to lay out complex and resizable forms.
The following example form demonstrates layout of a simple, fixed size dialog form using the VarChars layout mode. Each gadget's position is set within the gadget definition either, implicitly using auto-placement, or using relative placement with the AT syntax. Gadget sizes are set implicitly, or relative to the size of other gadgets or to the positional extents of other gadgets.
Figure 17:4.
Form definition using the VarChars layout mode
Note:
No actual co-ordinate positions are required to specify this form. It is mostly undesirable and unnecessary to specify a gadget's position as absolute grid co-ordinates, e.g. at x 12, y 5; AVEVA recommend defining the layout of each gadget relative to a predecessor. This allows simple editing of the layout, without having to calculate new positions. There are exceptions, for example, for the first gadget in a form or frame, where you may want to establish an initial x or y co-ordinate that is not at the default position.
Here is the corresponding PML code file: usingVarChars.pmlfrm. The 'layout' keywords are explained later in the chapter, and have been emphasized for clarity.
  path down
      path right
      path down
            width to max.frame2
  button .cancel |CANCEL| at xmin form CANCEL
button .ok |OK| at xmax form-size OK

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo