Rekall contains some basic support for automatically resizing and repositioning of controls when the size of a form is changed by the user. Although this is not as sophisticated as (say) that provided by the QT toolkit in which Rekall is built, it is hopefully sufficient to provide a useful level of functionality.
Firstly, all form controls are embedded in a container, and containers may be nested inside one another. The form itself is a container, and so it a sub-form (and sub-sub-form ...). The position and size of a control depends on the properties of that control, and possibly on the position and size of the container in which it is embedded; the same applies to nested containers. Secondly, forms have a Stretchable property, which can be set to Yes to enable resizing (if this property is not set then the form window can still be resized, but the controls remain fixed within it, and scroll bars appear as neccessary which can be used to pan the window).
Associated with each control and each container (except for the outermost form-level container), are a pair of properties, X mode and Y mode. These determin the behaviour of the control (or container) as its parent container is resized (in the X and Y directions respectively). The default value is Fixed, in which case resizing a container has no effect on embedded controls and containers.
However, these properties can also be set to either Float or Stretch. If the X mode of a control is set to Stretch and the container in which it is embedded changes width, then the width of the control changes to match; if it is set to Float then the control stays the same width, but the whole control moves right or left with the right-hand edge of the form. Y mode similarly controls the behaviour as the height of the form changes. The table below gives the exact meanings and behaviour for X mode (Y mode is analagous).
Setting | Property | Value | Behaviour |
Fixed | X | Distance of left edge of control from left edge of container | Position stays fixed |
W | Width of control | Width stays fixed | |
Float | X | Distance of left edge of control from right edge of container | Control position tracks right edge of container |
W | Width of control | Width stays fixed | |
Stretch | X | Distance of left edge of control from left left edge of container | Position stays fixed |
W | Distance of right edge of control from right edge of container. | Width tracks right edge of container |
In the demonstration database, the subform is set to stretch in both directions, while the buttons are set to float in the Y direction. You will also notice that, since the number of rows displayed in the subform is set to be adjusted automatically according to the height of the subform (ie., Row Count is set to zero), then the number of rows displayed changes as the form height changes.
As noted above, forms themselves are containers, as are nested subforms (blocks). In addition, there are a few other container objects. The simplest is simply called a container, which can be added in the same way as a subform - sweep out an area, and select New Block/Container from the popup menu. In this usage, any control that is embedded in the container is logically part of the block in which the container is embedded, so any data that is retrieved for use in data controls (fields, memos, etc.) comes from the same place as the block retrieves data from (typically the same server database table).
Supppose that you'd like a form which shows multiple rows from a table, which adjusts the number of rows according to the size of the form, and which has a row of navigation buttons across the bottom. Without using a container this is not possible, since the number of rows will adjust to occupy space down to near the bottom of the form. However, using a container, this effect can be achieved, and is illustratd in the screenshot below. The data controls are placed inside a container which has X mode and Y mode both set to Stretch, while the Y modes of the buttons are all set to Float. For effect, the container has been given an edge by setting its Frame Style property.
Tab controls are also containers. These comprise the tab control itself, and one or more tab pages. The geometry of the tab pages is determined by the geometry of the tab control; they are the same width, and the same height less a bit for the tabs.