The default layout format for an interview is for the controls in the interview to be arranged vertically, one under the other.
This behaviour can be modified by use of the HzGroup command (the name standing for ‘HorizontalGroup’).
For instance, the command
would cause the controls for data elements Title, FirstNames and LastName to be arranged horizontally on the interview screen. This grouping is referred to as a horizontal group or just a group.
There are a number of options which can be applied to the group, as follows:
«HzGroup(Title:4,FirstNames,LastName,25,EmptyAllCaptions,Enter the names)»
- The :4 after Title means that the control for Title will be 4 characters wide (see The Width Command for a discussion of how widths work).
- The 25 means that the default width of all controls in the group will be 25 characters. When this is not specified in the command, then the default width will be 20 characters. In this example, it is only FirstNames and LastName which will be 25 characters long, as Title has had a width of 4 specified explicitly for it.
- EmptyAllCaptions will mean that all the default captions for the data elements in the group will be emptied – made zero characters long. This is often used in the context of a horizontal group, because from an aesthetics point of view it sometimes looks better to have the captions appear either above or below the controls, in which case the “caption” will be specified as a Heading or Footing.
- The string “Enter the names” is a caption for the group as a whole. This functions in the same way as a caption for an ordinary data element – i.e. it can have styling, colour and font applied to it, and it will cause the left hand edge of the group itself to line up with the left hand side of ordinary controls on the interview.
When applying horizontal grouping to repeating data, then the data element names need to be qualified explicitly with the containing repeating element name. Suppose there is a repeating element Child which has sub-elements ChildFirstNames, ChildLastName and ChildAge which are all required in the same horizontal group:
There are many applications for the concept of horizontal grouping, and the description of the various uses would be too tedious to read if it were rendered in this help format. There are two sample templates which have been delivered with the XpressDox desktop, and these are in the
My Documents\XpressDox\Samples folder. The two templates are called
CheckAll-CommasAndList.xdtpxand they demonstrate a number of techniques available to the template author.
Some things to bear in mind:
- There is no built-in limit to the number of data elements that can be in one group. Particularly in the case of narrow, small width controls (e.g. check boxes), there can practically be dozens of controls in one horizontal line.
- There is, however, a practical limit. For example, on any monitor a group consisting of 10 data elements all with width 30 characters will probably not fit inside one screen. XpressDox does NOT implement horizontal scrolling to accommodate these kind of situations (horizontal scrolling is typically not as easy to use as vertical scrolling), but will give a warning to the user (who is hopefully the template author if the template is being subjected to adequate quality control) that the bounds of the screen would be exceeded by that group.