Add a Local Form node (

) to create a
local form that can be used by a parent global form. It can, for example, represent the content of a desktop window, a dialog window, or a tabbed pane. A form has to be referenced by another node to be part of the user interface, but you can choose to show a form as a dialog after the user has clicked a button. You can access local forms in a limited scope that consists of the parent global form and its children. For example, local forms can access to local declarations defined by their parent global form, and grouping forms that will be used as dialogs as local forms under a global form could be used to determine which forms that should be loaded into a settings form’s data container. You can add local
Form nodes from the
New Form menu in the
Main section of the
Home and
Form ribbon toolbars and also by right-clicking a global
Form node and then choosing
Local Form.
•
|
Right-click the Form node and choose Preview Form (  ) to test the form by opening it as a preview in a separate window that you can inspect.
|
You can right-click the Form node and choose
New Method to add a form method that is local to the form. You can also add form declarations such as scalar and array strings, Booleans, integers, and doubles that are available as local declarations within the form object.
Specify a Title for the form. The default title is
Form 1, for the first form in the application.
From the Icon list, select an icon image to use as the icon for the form when used as a settings form in the
Model Builder. The
Default icon is the standard icon for a Form object. Click the
Add Image to Library and Use Here button (

) to add any other image to the list of icons and use it. Click the
Export button (

) to export the image used as the Form object’s icon to a file.
In this section, you can adjust the form’s Horizontal and
Vertical margins if desired (default: 20 pixels).
From the Store changes list, select
On request (the default) to store data changes when the user clicks, for example, an OK or Apply button (and where a Cancel button can discard any pending changes); or select
Immediately to store data immediately when a change is made. This setting applies when the form appears as a dialog. Use the
Immediately setting to create dynamic dialogs where you, for example, have a direct connection between a slider and an input field.
Select the Resizable check box to make it possible for users to resize the dialog if desired.
The Expandable check box is selected by default. Clear it if you do not want users to be able to expand and collapse the section. With this setting selected, you also have the option to make the section’s state initially collapsed by selecting the
Initially collapsed check box.
|
The Sketch Grid section is only available when you have selected the sketch mode for the form.
|
You specify the grid size by entering values in the Column width (default: 100 pixels) and
Row height (default: 20 pixels) fields.
Select the Align grid to margin check box to make the grid lines align with the left and top margins.
The Snap zone slider controls how exact you need to be when resizing a form object to make it snap to the grid. By default, the snap zone is set to its maximum value so that the object quickly resizes to snap to the grid. Move the slider from
Large to
Small to make the snap zone smaller if desired.
Select the Snap only to grid check box to make the resizing of form objects snap only to the grid and not to the borders of other form objects, for example.
|
The Sketch Grid section is only available when you have selected the grid mode for the form.
|
There are two tables in this section of the Settings window: one for the columns and one for the rows in the grid. In the
Column and
Row columns, you find the column and row numbers, respectively, each starting at 1 from the left and from the top. You can control how each row and column fills up the space in the form. Each table has a
Width (columns) or
Height (rows) column with lists that contain the following options:
Fit (the default),
Grow, and
Fixed.
•
|
The Fit option makes the column or row use the space needed for the contained object to fit. Columns and rows with this setting will not grow in size.
|
•
|
The Grow option makes it possible for the column or row in the grid to expand by using available space in the form when a user of the application increases the size of the form by dragging the corner of the application window, for example.
|
•
|
The Fixed option specifies that the grid layout has a certain width or height for its column or row, specified in the third Size column of the table. For the other options, the Size column is not applicable and displays N/A. The added width or height in pixels appears in the column or row header in the form’s editing window. Columns and rows with this setting will not grow in size.
|
From the Inherit columns list, select a form object from which to inherit its column settings. The default is
None; that is, the columns settings are not inherited.
From the Text color list, select
System (the default, as defined by the operating system); one of the predefined colors; or select
Custom to choose a custom text color from the color palette.
From the Background color list, select a color to use as the background in the forms:
System (the default, as defined by the operating system); one of the predefined colors; or
Custom, which make it possible to select a custom background color from the color palette.
From the Background image list, choose a background image if you want to use such an image in the form. The default is
None for no background image. To add an image to the image library and use it as a background image, click the
Add Image to Library and Use Here button (

). Click the
Export button (

) to save the background image to a PNG file.
•
|
From the Horizontal alignment list, choose Left, Center, Right, Fill, or Repeat.
|
•
|
From the Vertical alignment list, choose Top, Middle, Bottom, Fill, or Repeat.
|
Choose Fill to automatically stretch the background image to fill the form window in the horizontal or vertical direction (or in both directions). Choose
Repeat to repeat (tile) the images horizontally, vertically, or in both directions.
The default in the lists for On load and
On close is
None, which means that no method runs when an event is triggered for loading or closing the form. Those lists also contain any available methods or command sequence. You can add the following types of events by choosing from the
Create Global Method menu (

) to the right of the
On load and
On close lists:
•
|
Choose Create Global Method (  ) to create a global method. Type the name of the global method in the Name field of the Create Global Method dialog box that opens and then click OK. The global method is then added under Methods, and its Method Editor window opens.
|
•
|
Choose Create Form Method (  ) to create a form method. Type the name of the form method in the Name field of the Create Form Method dialog box that opens and then click OK. The form method is then added under the Methods node under the Form node, and its Method Editor window opens.
|
•
|
Choose Create Local Method (  ) to create a local method. Its Method Editor window opens.
|
•
|
Choose Create Command Sequence (  ) to create a command sequence using the Create Command Sequence dialog box that opens. There you can choose commands from the available Forms, GUI Commands, Declarations, Form Declarations, Methods, Form Methods, Libraries, and Model folders. To add a command, right-click the desired command node and choose the command to use ( Run, for example). The command then appears in the list of commands below. You can edit that command sequence using the toolbar buttons for moving and deleting commands below the table. Click the Convert to Method button (  ) and choose Convert to Method or Convert to Form Method to convert the command sequence to a method. Click the Go to Method button (  ) below the table to select the method in the Application Builder tree and open the method in a Method Editor window. For commands that include arguments, click the Edit Argument button (  ) to choose an argument in the Edit Argument dialog box that opens.
|
There can only be one local method and one command sequence so if you add one or both of them, the menu will instead contain Remove Local Method (

) and
Remove Command Sequence (

), respectively. Click one of them to delete the local method or command sequence.
The selected method in the On load and
On close lists then changes to the created method or command sequence. You can also Ctrl+Alt-click the selection input object or right-click it to create a local method or (by choosing
Edit Method or
Edit Local Method) to open the method associated with the command. To open the selected method or command sequence, click the
Go to Source button (

). The focus then moves to the method’s editor window or the
Command Sequence dialog box, respectively.