Local Forms
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.
To edit or test the form, use the following options on the Form node’s context menu:
Right-click the Form node and choose Edit () to open the form window, where you can interactively create and design the form (see Working with Forms).
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.
Enter the name of the form object in the Name field.
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.
Size
The size properties are applicable when the form appears in a dialog box. By default, the Application Builder automatically determines the initial size based on the form contents. From the Initial size list, choose Automatic (the default) or Manual to specify the initial size in the Width and Height fields (default: 40 pixels).
Margins
In this section, you can adjust the form’s Horizontal and Vertical margins if desired (default: 20 pixels).
Dialog Settings
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.
Section Settings
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.
Sketch Grid
The Sketch Grid section is only available when you have selected the sketch mode for the form.
In this section, you find settings for the grid that you can display in the sketch mode (see Showing Grid Lines and Snapping to the Grid) and for the snapping of form objects to that grid.
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.
Grid Layout for Contained Form Objects
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.
Appearance
In this section, you can control the appearance of the text and background for the form:
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.
If you choose to use a background image, you can also specify the following alignment settings under Image position and size:
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.
Events
In this section, you can connect local methods to events that are triggered when loading and closing the form and when a form is referenced in a Form Reference, Form Collection, or Card Stack. The methods can perform some initialization or clean up, for example, when loading and closing the form.
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.