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 selecting 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 you do so 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.
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.
In this section, you define the active form selector that controls the visible form 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 form 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. In addition, you can click the
Create New Declaration and Use It as Source button (

) or the
Create New Form Declaration and Use It as Source button (

) in the
Active Form Selector section header to create a new global or local (in the form) variable declaration for the form collection and use it as the source. A
Create and Use Declaration dialog box opens so that you can select the data type of the source (if applicable), its name, and its initial value (if applicable). The name cannot be in conflict with any existing variable declaration. You can extend the list of available data nodes by clicking the
Switch to Model Builder and Activate Data Access button (

).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 form 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.
The top area in this section contains a tree with the forms that can be added to the form collection (but has not yet been added). Right-click a Form node and choose
Add to Form Collection (

) to add the form to the table of included forms below. You can also right-click a node in the tree and choose
Edit Node (

) to move to that node and open its Settings window for editing. Those buttons are also available underneath the tree.
•
|
Select or clear the check box in the Collapsible column to make the form collapsible or not. This setting is selected by default and only available when you have selected Sections from the Type list.
|
•
|
Select or clear the check box in the Expanded column to show the form expanded. This setting is selected by default and only available when you have selected Sections from the Type list and the form is collapsible.
|
When applicable, use the Move Up (

),
Move Down (

), and
Delete (

) buttons underneath the table to edit its contents. Also, click the
Edit Node button (

) to move to the selected form’s node and open its Settings window for editing. These options are also available when you right-click a row in the table.
Click the Add New Form button (

) button in the
Forms section’s toolbar to open the
New Form dialog box from which you can create a new form with a given name and title and use it in the Form Collection object. Similarly, click the Add
New Local Form button (

) to add a new local form.
From the Default form list, choose which form (tabbed pane, for example) that is active by default. This setting is not available if the form collection uses sections because then every form in the collection is active.
•
|
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 absolute position of the form collection 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.
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, for no margin around the form object
|
•
|
Custom, to specify the margins for the form object in the Horizontal and Vertical text fields
|
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.
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.
You can also select the Bold check box to use a boldface font or 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. In the Form Editor, the state of the form object is indicated by a change in its appearance. Objects that are hidden become visible when selected in the Form Editor.