The Card Stack (

) is another special type of form object that only contains cards. A card stack can flip between cards in a stack to show one card at a time. For example, you can display a different image or text depending on an event or results in the application. You associate a card stack with a data source that controls which card to show. Each card specifies a value that it compares against the data source of the card stack. The card stack shows the first card with the matching value. If no cards match, nothing shows. There are two types of cards: local cards and cards that are references to an existing form object.
The Settings window contains the following sections.
In this section, you specify the data source for the active card selector. The section contains a tree with a filtered view of the trees in the Application Builder and
Model Builder windows. The nodes either represent some sort of data or have children that do. For a card stack, you typically only see the available parameters under
Parameters, variables under
Variables, and the data nodes defined under the
Declarations branch. You can extend the list of available data nodes by clicking the
Switch to Model Builder and Activate Data Access button (

) in the
Active Card Selector section header, which takes you to the Model Builder, and then selecting a node in the
Model Builder branch whose data you want to access. With this button active, the
Settings window of the selected node displays a
Select Data Source check box (a green square) next to the settings that you can include. Click to select the check box to include the data as an available source node for card stacks.
When you select a node that represents the source for the active card 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 New Declaration and Use It as Source button (

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

) in the
Active Card Selector section header to create a new global or local (in the form) variable declaration for the card stack 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.
The table in this section contains the cards (in the Card column) and their associated activating values (in the
Activating value column). The stack decides which card to display through the activating values, which you type into this section. The values are checked against the value of the source. For all cards, you can enter their activating values in the
Activating value column. For local cards, you can also edit the name of the card in the
Card column.
Click the Add Card button (

) to add a card to the table. An
Add Card dialog box appears, where you can specify the new card.
From the Card type list, choose
Local (the default) to create a local card for the card stack, or choose
Existing form to use an existing form as a card. For a local card, enter a card name in the
Name field. For a form, choose one of the existing forms from the
Form list. If desired, enter a unique value to act as an activating value in the
Activating value field.
Click the Delete button (

) (or right-click the card entry in the table) to remove a selected card.
Click the Edit button (

) to edit the individual card. You can also right-click a card entry in the table and select
Edit or right-click the card stack object in the form window and select
Edit card1, for example.
Click the Duplicate button (

) to duplicate a card in the card stack. It is also possible to right-click in the Card Stack object in the form window and select
Duplicate card2, for example, to duplicate a card in the stack.
Under Appearance, you can control the initial state of the card stack when users run the application. By default, the card stack is visible and enabled. Clear the
Visible or
Enabled check box if you want to make the initial state so that the card stack 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.
•
|
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 card stack. 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.
Select the Adjust size to selected card check box to make the card stack adjust its size to the currently selected card. When this check box is not selected (the default), the card stack will be as large as the largest card regardless of which card that is selected.
Additionally, in the sketch mode, you can specify the absolute position of the card stack 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
|