Form Objects
Positioning Form Objects
You can easily change the positioning of form objects such as input fields, graphics objects, and buttons in one of the following ways (which methods are applicable depends on which layout mode you are using):
In the figures below, a Plot button is being moved from its original position. Blue guide lines show its alignment relative to the unit objects and the Compute button.
Resizing Form Objects
In sketch layout mode, to resize an object:
Note that some form objects that cannot be resized in grid mode can be resized in sketch mode.
Copying, Pasting, Duplicating, and Deleting an Object
To delete an object, click to select it and then press Delete on your keyboard. You can also click the Delete button in the Quick Access Toolbar.
You can copy-paste an object by pressing Ctrl+C and Ctrl+V. Alternatively, you can right-click an object to get menu options for Copy, Duplicate, Delete, and more.
To paste an already copied object, right-click an empty area in the form and right-click again. Depending on the copied object, a Paste menu option will be shown. In the figure below, an Input Field has previously been copied and as a result, a Paste Input Field option is shown.
Adjusting Position and Size by the Number of Pixels
When in sketch layout mode, you can adjust the position and size of an object by typing the number of pixels in the Position and Size section of its Settings window:
Click an object to select it. Make sure its Settings window is shown. If not, double-click the object or click the Settings button in the Form tab.
Edit the numbers in the Position and Size section.
The Position and Size section will have different options depending on the type of form object. For grid layout mode, there are additional settings for the position of the object with respect to rows and columns. For details, see Sketch and Grid Layout.
Changing the Appearance of Displayed Text
For form objects that display text, the Appearance section in the Settings window lets you change properties such as the text displayed, font, font color, and font size. For some form objects, such as a button, the size of the object will adapt to the length of the text string.
In the figure below, the Settings window for a text label object is shown.
By using grid layout mode (see Sketch and Grid Layout) you can gain further control over the size of form objects, such as setting an arbitrary size for a button.
Selecting Multiple Form Objects
If you select more than one form object, for example, by using Ctrl+click, then the Settings window will contain a set of properties that can be shared between the selected objects. Shared properties will always originate from the Appearance section, the Position and Size section, or the Events section.
The Name of a Form Object
A form object has a Name, which is a text string without spaces. The string can contain letters, numbers, and underscore, but the reserved names root and parent are not allowed. The Name string is used by other form objects and methods to reference the object as part of its path. The object’s path is displayed as a tooltip when hovering over the Name field in the Settings window.
Inserting Form Objects
You can insert form objects in addition to those created by the Form Wizard. In the Form ribbon tab, in the Form Objects section, you can quickly select some of the most common form objects: Input Field, Button, Checkbox, Text Label, Data Display, and Graphics.
Additional form objects are available from the More Objects menu button.
The remainder of this section, The Form Editor, only describes the types of form objects that are added by the Form Wizard. The form objects and ribbon features added by using the wizard may include:
Text Label (typically associated with Input Field)
Unit (typically associated with Input Field)
However, when using Data Access (see Data Access in the Form Editor), the additional form objects may be added by the wizard, including:
For more information on the checkbox, combo box, and other form objects, see Appendix A — Form Objects, Ribbon, Menu, and Toolbar Items.
Events and Actions Associated with Forms and Form Objects
You can associate objects such as buttons, menu items, ribbon buttons, forms, and form objects with actions triggered by an event. An action can be a sequence of commands including global methods, form methods, or local methods. Local methods are not accessible or visible outside of the forms or objects where they are defined. The events that can be associated with an object depend on the type of object and include: button click, keyboard shortcut, load of a form (On load), close of a form (On close), change of the value of a variable (On data change), and focus gained.
Using Ctrl+Alt+click on a form object opens any associated method in the Method Editor. If there is no method associated with the form object, a new local method will be created, associated with the form object, and opened in the Method Editor. If the form object has an associated command sequence, this sequence is converted to code and inserted in the local method.