Working With Forms > The Form Objects > Form Collection

Form Collection
The Form Collection () form object is a collection of forms that displays as panes in a tabbed pane form object, where each pane shows the form content. Each form can use a different set of layout options. You can also display them with a list for selection of the panes or as separate sections. A tabbed pane needs a data source to hold the currently selected pane and to enable pane switching from methods. Therefore, you also need to choose a data source and initial value similar to how it is done for Combo Box form objects. Enter the name of the Form Collection object in the Name field.
From the Type list, choose the type of layout for the form collection:
The Tabs layout (the default) displays the forms using tabbed panes.
The List layout displays a list to the left of the form panes, where you can select the form to display.
The Sections layout displays each form in a separate section.
The Tiled or tabbed layout has two different looks with the same forms and a Boolean source controlling which one of the modes (the tiled mode or the tabbed mode) is shown. The tabbed mode is identical to a Form Collection with the type set to Tabs. The tiled mode displays all of the forms simultaneously in a grid.
The onLoad and onClose event methods are active when opening and closing a form and when you switch tabs in a form collection. The onClose method runs when switching to a tab using the form, and the onLoad method runs when switching from a tag using the form. The events only run for form collections with the layout types Tabs or List. For Sections, no events run.
In addition, the Settings window contains the following sections:
Tiled or Tabbed
This section is only available if you have chosen Tiled or tabbed from the Type list above.
From the tree view, choose a Boolean variable to use as the source for the switch between a tiled look and a tabbed look. Click the Use as Source button ( or right-click and choose Use as Source to make a selected Boolean variable the source for switching the look of the form collection.
You can specify some settings for the tiled mode under by Tiled mode settings. By default, the Add borders in tiled mode check box is selected to add borders around the form objects. From the Tiling strategy list, choose Columns first (the default) or Rows first to control the order of the tiled form objects. You can specify the number of columns for the tiled mode in the Number of columns field (default: 2 columns), The form objects in the two modes are synchronized.
Active Pane Selector
In this section you define the active pane selector that controls the visible pane for the form collection when the Type list is set to Tabs or List. The section contains a tree with a filtered view of the tree in the Application Builder window. The nodes either represent some sort of data or have children that do. For a form collection, string variables that you define under Declarations are available as the active pane selector. When you select a node that represents the selector, the Use as Source toolbar button () below the tree becomes enabled. You can also right-click the node and choose Use as Source. You can also click the Create button () in the Source section header to create a new variable declaration and use it as the source. A Create and Use Variable dialog box opens, so that you can select the data type of the source (if applicable), its name, and its initial value. The name cannot be in conflict with any existing variable declaration. Click the Edit Node toolbar button () below the tree to move to the corresponding node. If necessary, the program switches to the Model Builder.
After selecting a node as the source, the node appears as the selected source under Selected source. A data source as the active pane selector is not necessary, so you can click the Clear Source toolbar button () under the source tree. You only need to select a source if you want to control the visible pane in a way other than clicking on the tab to show it.
Panes
In the Use selected forms as panes list, add Form objects from the list under Available to the list under Selected using the button, where each form represents a pane in the order they appear in the list. From the Default pane list, select one of the selected Form objects to make it the default pane. When you have selected a data source, the Default pane setting also initializes the data source, overriding any default specified in the data declaration. The allowed values for a data source connected to a form collection are the names of the forms, such as form1 and form2. To change the order in which the forms under Selected are displayed, use the Move Up () and Move Down () buttons.
Position and Size
This section contains all layout settings for a form collection in the grid of the parent form.
In the grid mode, you can control the horizontal and vertical alignment of the form collection using the following lists:
From the Horizontal alignment list, choose Left, Center, Right, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
From the Vertical alignment list, choose Middle, Top, Bottom, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
The need to specify the alignment is most obvious when working in the grid mode, as it controls how the form object is aligned in its grid cell. Aligning the form object can be useful in the sketch mode too, and you can then use the alignment tools on the Arrange menu in the Form toolbar’s Sketch section. When running the application in any client other than the Windows client, the form objects may not be positioned exactly as seen in the form windows. This is because the form objects may have a different size in other clients, giving them a slightly different positioning. Specifying the alignment ensures that the form objects are aligned as you want them to be in all clients.
You can also specify the width and height of the form collection. By default they are determined automatically. To adjust the width, select Manual from the Width list and then enter a width (in points) in the associated field. If you have chosen Fill from the Horizontal alignment list, you can instead specify a Minimum width. Choose Automatic to compute the minimum width automatically (typically this means a minimum size of 0), or choose Manual to specify a minimum width in the text field underneath. To adjust the height, select Manual from the Height list and then enter a height (in points) in the associated field. If you have chosen Fill from the Vertical alignment list, you can instead specify a Minimum height. Choose Automatic to compute the minimum height automatically (typically this means a minimum size of 0), or choose Manual to specify a minimum height in the text field underneath.
Additionally, in the sketch mode, you can specify the form object’s absolute position using the Position x and Position y fields. In the grid mode, you can position the object in the grid and see the grid position as the Row, Column, Row span, and Column span values.
Cell Margin
Under Cell margin (in grid mode only), you can control the margins around the form object. By default, the margins are taken from the parent form. From the Cell margin list, choose:
None, to use no margin around the form object.
From parent form (the default), to use the margins set for the parent form.
Custom, to specify the margins for the form object in the Horizontal and Vertical text fields.
Appearance
In this section, you can control the appearance of the text in the form collection:
From the Text color list, select a color to use for the text: Inherit (the default; the form object then uses the setting from the Form it is located in), any of the predefined basic colors, or Custom, which makes it possible to select a custom color from a color palette that opens.
The font and the font size for the results table use the font settings from the Forms node by default. Select a font from the Font list: Default font or any of the available fonts. If needed, choose or enter a font size (in points) in the Font size combo box. The default font size is Default size.
Select the Bold check box to use a boldface font.
Select the Italic check box to use italics (an italic font).
Under State, you can control the initial state of the form collection when users run the application. By default, the form collection is visible and enabled. Clear the Visible or Enabled check box if you want to make the initial state so that the form collection is hidden or unavailable. You can then make it visible or enable it using a method.