The Array Input (

) is a predefined form object with an input table to enter array inputs (vector inputs). The
Array Input supports arrays as data sources. You can also add an optional label, symbol, and unit. Enter the name of the array input object in the
Name field.
In the Length field, enter the length of the array as a positive integer (default: 3). The maximum length is 1000.
From the Show vector as list, choose
Table (the default) to show the array components as a table, or choose
Components to show each array component as a separate input field with a label.
In addition, the Settings window contains the following sections.
In this section, you select the source for the array input. 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 an array input, the list contains array variables defined under
Declarations, for example. When you select a node that represents data, the
Use as Source toolbar button (

) below the tree becomes enabled. You can click it or, alternatively, press Enter, double-click, or right-click the node and choose
Use as Source to add it as the selected source. The initial values from the data source appear in the array input object. 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
Source 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.
From the Initial values list, select
From data source (the default) to use the value specified by the selected data source, or select
Custom values. Then, in the associated table below, enter the initial values for the components in the array.
Use the Label position list to place a label. The options are
Above (the default),
Left, and
No label. For the two first options, you can enter the desired label in the
Label text field.
When the label position is above the table, you can include a symbol to the left of the table by selecting the Include symbol check box. You cannot see this setting when the label position is to the left of the table, as it overlaps with the symbol position. Enter the symbol using LaTeX syntax in the
Symbol (LaTeX encoded) field.
As a final option, select the Include unit check box to add a unit symbol to the right of the table. To add a unit, click the
Select Quantity button (

) to open the
Physical Quantity dialog box to browse to find a physical quantity to use. You can also type a search string in the text field at the top of the dialog box and then click the
Filter button (

) to filter the list of physical quantities. For example, type
potential and click the
Filter button to only list physical quantities that represent some kind of potential. Alternatively, click the
Custom Unit button (

) to enter a unit (for example,
m/s^2) in the text field (the physical quantity then becomes a
Custom unit).
•
|
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 of the array input. Enter a width (in points) in the Width 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. The
Height field is unavailable because the height of the input field is determined by the software.
Additionally, in the sketch mode, you can specify the absolute position of the array input 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
Inherit (the default) to inherit the text color from the setting in the
Form node, or select one of the predefined colors, such as
Black. 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 array input:
Transparent (the default), any of the predefined basic colors, or
Custom, which makes it possible to select a custom color from a color palette.
From the Text alignment list, choose an alignment for the array texts:
Left (the default),
Center, or
Right. The alignment does not affect the label.
The font and the font size for the text in the array input fields 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 is to use the
Default size for the font.
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 array input when users run the application. By default, the array input is visible and enabled. Clear the
Visible or
Enabled check box if you want to make the initial state so that the array input 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.
You can specify a method or command sequence to run when an event such as data entry occurs. The On data change list contains
None (the default) and 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 data change list:
•
|
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 data change list then changes to the created method or command sequence. You can also Ctrl+Alt-click the array 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.