The file layout2.pmlfrm, shown below, defines the form shown in
Figure 21:2.: The tabbed pages of a complex form. Within the form definition the
TABSET frame is defined and directly contains a frame gadget for each tabbed page. Note its
ANCHOR ALL setting which maintains the distance between each edge of the frame and the corresponding edge of the form, when the form is resized by you. This allows the frame to grow and shrink without overwriting gadgets outside of it.
Alternatively, when you define a TABSET FRAME, you can specify its
DOCK or
ANCHOR attributes to determine its resize behaviour within the form.
For each tabbed-page frame within the TABSET, it is no longer necessary to specify any
DOCK or
ANCHOR attribute settings, and any that are specified will be ignored. Each tabbed-page frame will always fill the available space in its
TABSET parent (it exhibits
DOCK FILL behaviour).
The gadget ANCHOR attribute is used extensively to allow resizable gadgets to expand in specific directions and not others for. It is also used by non-resizable gadgets, e.g.
BUTTONs, to allow them to move with edges of their containers and so avoid being overlaid by resizing gadgets.
Note also, the extensive use of form methods to provide the intelligence of the form as gadget callbacks. In particular the method listCallback(!list is GADGET, !event is STRING), which just reports details of select and unselect events on list fields, has the standard form of an open callback, and is used as such on the list gadgets
LI1 and
LI2, i.e.
!this.Li1.callback = |!this.listCallback(|. Open callbacks are described in
PML Open Callbacks.