Data entry fields and other window controls, such as push buttons and check boxes, can be added to a window by selecting the field from the fields list in the Toolbox and dragging it to the appropriate area of the window. Fields added to a layout area are window fields. Their appearance can be modified using field properties, which
There are two types of fields that can be added to a window layout: global fields and local fields.
You add global fields to a layout by dragging them from the list of fields in the Toolbox. To display all of the global fields defined for the application, choose Global Fields in the drop-down list in the Toolbox. This list will then contain all global fields created using the Field Definition window.
You can also view a list of the global fields that are part of a table attached to the current form. To do this, use the drop-down list in the Toolbox and select the table whose fields you want to list. The fields list in the Toolbox will then display only the fields that are part of that table. To add a global field to the window, complete the following steps.
Select the appropriate field name and drag it to the layout area. You can choose any field from the fields list, or you can use the drop-down list above the fields list to view all global fields or only those from tables linked to the current form:
The size of the box displayed in the window layout is the default size based on the field’s data type and the current display properties. For instance, if you add a check box to a window layout, the check box will be large enough to display the static text value you applied to the check box data type, in the current font and style.
Fields that appear in tables linked to the form are the same fields as those in the list of global fields. Listing the fields associated with a specific table is simply a shortcut, allowing you to view a smaller list of fields. |
Setting field properties is described in the next section.
Local fields are specific to a single form, and all windows from the form will have access to the local fields. They can be used only as window fields. Local fields can’t be stored in a table. Typically, controls such as push buttons are created as local fields, since push buttons aren’t stored in a table. To add a local field to the window, perform the following steps:
In the Toolbox, choose Local Fields in the drop-down list specifying the type of fields to display.
Click New; the Local Field Definition window will appear.
Name the field and select the characteristics for the local field. A local field can use a data type created with the Data Type Definition window or a local data type.
To use a local data type, mark the Local radio button and select the control type, keyable length and static values for the field. To use a global data type, mark the Global radio button and use the Data Type lookup button to open a list of global data types defined for the application. Select a data type and click OK. You can also choose to create a new global data type.
In most cases, local data types are used for local fields. |
After you’ve set up the field, click OK to save the changes. The local field will appear in the fields list in the Toolbox.
Select the appropriate local field name and drag it into the layout area. The size of the box is the default size based upon the field’s data type and current display properties.
Setting field properties is described in the next section.
You can also use the prototyping tools from the Toolbox to add local fields to the window layout. To use a prototyping tool, simply select it in the Toolbox and click in the layout area where you want the local field to appear. A local field will be created and placed in the layout window where you indicated.
The default name of each local field is based upon its control type and the order in which it was placed on the window. For example, the local field PushButton2 field was the third local push button field placed in the window. The numbering starts at zero.
You may want to edit the local fields you created with the prototyping tools to change the names and add static items. To do this, choose Local Fields in the drop-down list in the Toolbox, select the local field, and click Open. |