Summary:
See also: Form Specification Files.
Attribute | Description |
ACCELERATOR | First accelerator key for an action default |
ACCELERATOR2 | Second accelerator key for an action default |
ACCELERATOR3 | Third accelerator key for an action default |
ACCELERATOR4 | Fourth accelerator key for an action default |
ACTION | Action name to be sent to the program when the item is activated |
AUTOSCALE | Forces the item's contents to be scaled according to the available space |
AUTONEXT | Automatically gives the focus to the next field when all data is entered |
BUTTONTEXTHIDDEN | Indicates that the button labels of the element must be hidden |
CENTURY | Specifies expansion of 2-digit years in DATE and DATETIME fields |
COLOR | Specifies the foreground color of the text displayed by a form item |
COLOR WHERE | Defines a Boolean condition based on field values to set the color attribute dynamically |
COMMENT | Specifies a message to display on the Comment line |
DEFAULT | Assigns a default value to a field during data entry |
DEFAULTVIEW | Defines if the default view must be displayed for an action |
DISPLAY LIKE | Assigns attributes from the database schema files |
DOUBLECLICK | Defines the action to be sent when user double-clicks on the item |
DOWNSHIFT | Converts to lowercase any uppercase character data |
HEIGHT | Explicitly defines the height of a form element |
HIDDEN | Makes an element invisible |
FONTPITCH | Defines the character font type as fixed or variable |
FORMAT | Formats DECIMAL, SMALLFLOAT, FLOAT, or DATE output |
GRIDCHILDRENINPARENT | Aligns children to the parent container |
INCLUDE | Lists a set of acceptable values during data entry |
INITIALIZER | Specifies an initialization function for the ComboBox item |
INVISIBLE | Does not echo characters on the screen during data entry |
IMAGE | Defines the URL of the image resource associated to the form item |
ITEMS | Defines a list of values to be used by the form item |
JUSTIFY | Specifies the text justification |
MINHEIGHT | Defines a minimum height for the form item |
MINWIDTH | Defines a minimum width for the form item |
NOT NULL | Indicates that the field does not accept NULL values |
NOENTRY | Prevents the user from entering data in the field |
ORIENTATION | Defines the orientation of an element as vertical or horizontal |
PICTURE | Imposes a data-entry format on CHAR or VARCHAR fields |
PROGRAM | Invokes an external program to display TEXT or BYTE values |
QUERYEDITABLE | Allows a combobox field to be editable during a CONSTRUCT |
REQUIRED | Requires the user to supply a value during input instructions |
SAMPLE | Provides the text to be used as a sample to compute the width |
SCROLL | Allows scrolling within the field |
SCROLLBARS | Defines vertical and/or horizontal scrollbars for the form item |
SIZEPOLICY | Indicates sizing hint to display form elements. |
SPACING | Indicates spacing hint to display form elements |
SPLITTER | Indicates that the container must use a splitter |
STEP | Defines how much the value increases or decreases with a single click |
STRETCH | Defines how the widget must resize according to the parent container |
STYLE | Defines a presentation style for the form element |
TAG | Defines a string identifier for the form item |
TABINDEX | Defines the tab order for the form item |
TEXT | Defines the label to be associated with the form item |
TITLE | Defines the title to be associated with the form item |
UPSHIFT | Converts to uppercase any lowercase character data |
UNHIDABLE | Indicates that the column cannot be hidden |
UNHIDABLECOLUMNS | The table does not allow columns to be hidden |
UNMOVABLE | Indicates that the column cannot be moved |
UNMOVABLECOLUMNS | Prevents the user from changing the order of the columns |
UNSIZABLE | Indicates that the column cannot be resized |
UNSIZABLECOLUMNS | The table does not allow columns to be resized |
UNSORTABLE | Indicates that the column cannot be used for sorting |
UNSORTABLECOLUMNS | The table does not allow rows to be sorted |
VALIDATE | Defines the data validation mode for a given action |
VALIDATE LIKE | Validates data entry with definitions from the database schema files |
VALUEMIN | Defines the lower limit for widgets (such as progressbars) |
VALUEMAX | Defines the upper limit for widgets (such as progressbars) |
VALUECHECKED | Defines the value to be associated with a checked checkbox |
VALUEUNCHECKED | Defines the value to be associated with an unchecked checkbox |
VERIFY | Requires that data be entered twice when the database is modified |
VERSION | Defines a user version string for an element |
WANTTABS | Forces the field to consume TAB keys |
WANTNORETURNS | Forces the field to reject RETURN keys |
WANTFIXEDPAGESIZE | Forces the table to have a fixed height when the parent window is resized |
WIDTH | Explicitly defines the width of a form element |
Specifies the style to be used by the parent window | |
WORDWRAP | Invokes a multiple-line editor in multiple-segment fields |
CLASS | Specifies the behavior of a field defined with the WIDGET attribute |
CONFIG | Specifies the parameters for the definition of a widget (only used with WIDGET attribute) |
KEY | Defines the label of a key when the field gets the focus |
OPTIONS | Specifies widget definition options |
REVERSE | Causes values in the field to be displayed in reverse video |
WIDGET | Defines the type of widget to be used for presentation |
The ACCELERATOR attribute defines the primary accelerator key of an action default item.
ACCELERATOR = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR2 attribute defines the secondary accelerator key of an action default item.
ACCELERATOR2 = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR3 attribute defines the third accelerator key of an action default item.
ACCELERATOR3 = [CONTROL-][SHIFT-][ALT-]key
The ACCELERATOR4 attribute defines the fourth accelerator key of an action default item.
ACCELERATOR4 = [CONTROL-][SHIFT-][ALT-]key
The ACTION attribute defines the name of the action to be sent to the program when the user activates the form item.
ACTION = action-name
01
BUTTONEDIT f001 = customer.state, ACTION = print;
The AUTOSCALE attribute causes the form element contents to automatically scale to the size given to the item.
AUTOSCALE
The AUTONEXT attribute causes the cursor to automatically advance during input to the next field when the current field is full.
AUTONEXT
The CENTURY attribute specifies how to expand abbreviated one- and two-digit year specifications in a DATE and DATETIME field. Expansion is based on this setting (and on the year value from the system clock at runtime).
CENTURY = { "R" | "C" |
"F" | "P" }
The CLASS attribute is used to define the behavior of a field.
CLASS = "identifier"
Class | Description |
KEY | Field is used to trigger a keystroke instead of being a
normal input field. Only supported with special widgets such as buttons, checkboxes and radiobuttons. |
PASSWORD | Field input is masked by replacing normal character echo by stars "*". |
The COLOR attribute defines the foreground color of the text displayed by a form element.
COLOR = color-name
01
EDIT f001 = customer.name, COLOR = RED;
The COLOR WHERE attribute defines a condition to set the foreground color dynamically.
COLOR = color-name [...] WHERE boolexpr
01
EDIT f001 = item.price, COLOR = RED WHERE f001>100;
The CONFIG attribute is used with the WIDGET attribute to define the behavior and decoration of the field.
CONFIG = "parameter [...]"
The COMMENT attribute defines text that can be shown when the element becomes current.
COMMENT = [%]"string"
01
EDIT f001 = customer.name, COMMENT = "The customer name";
The DEFAULT attribute assigns a default value to a field during data entry.
DEFAULT = value
01
EDIT f001 = order.orderdate, DEFAULT = TODAY;
DEFAULTVIEW is an Action Default attribute defining whether the default view (button) must be displayed for an action.
DEFAULTVIEW = [ AUTO | YES | NO ]
The DISPLAY LIKE attribute takes column attributes defined in the database schema files and applies them to a field.
DISPLAY LIKE [table.]column
01
EDIT f001 = FORMONLY.fullname, DISPLAY LIKE customer.custname;
The HIDDEN attribute indicates that the element should not be displayed.
HIDDEN [ = USER ]
By default, all elements are visible. You can use the HIDDEN attribute to hide an element, such as a form field or a groupbox. The runtime system handles hidden form fields. If you write an INPUT statement using a hidden field, the field is ignored (as if it was declared as NOENTRY). Programs may change the visibility of form fields dynamically with the ui.Form built-in class.
When you use the HIDDEN keyword only, the underlying item attribute is set to 1. The value 1 indicates that the element is hidden to the user without the possibility of showing the element, for example with the context menu of table headers. In this hidden mode, the UNHIDABLE attribute is ignored by the front end.
When you use HIDDEN=USER, the underlying item attribute is set to 2. The value 2 indicates that the element is hidden by default, but the user can show/hide the element as needed. For example, the user can change a hidden column back to visible.
01
EDIT f001 = FORMONLY.field1, HIDDEN;02
EDIT col1 = FORMONLY.column1, HIDDEN=USER;
The HEIGHT attribute defines an explicit height for a form element.
HEIGHT = integer [CHARACTERS|LINES|POINTS|PIXELS]
By default, the size of an element is defined in characters and automatically computed by the form compiler according to the size of the form element in the layout.
For items like images, the default height is defined by the number of lines of the item tag (as a vertical character height). You can overwrite this default by specifying the HEIGHT attribute. You typically give a number of pixels.
For tables, the default height is defined by the number of lines used in the table layout. You can overwrite this default by specifying the HEIGHT attribute.
If you don't specify any unit, the size unit defaults to CHARACTERS, which defines the number of grid cells.
See also: WIDTH.
01
IMAGE img1 : image1, WIDTH = 200 PIXELS, HEIGHT = 120 PIXELS;
The BUTTONTEXTHIDDEN attribute indicates that the labels of the buttons of this element should not be displayed.
BUTTONTEXTHIDDEN
Use in a TOOLBAR definition to hide the labels of buttons.
The DOUBLECLICK attribute defines the action to be sent when the user double-clicks on a TABLE row.
DOUBLECLICK = action-name
This attribute is typically used in a TABLE container, to define the action to be sent when the user double-clicks on a row. By default, if the TABLE is driven by a DISPLAY ARRAY, a double-click fires the accept action. When using an INPUT ARRAY, double-click selects the whole text if the current widget is editable. If DOUBLECLICK is defined when using an INPUT ARRAY, the action can only be sent when the user double-clicks on a non-editable widget like a LABEL.
Assign the DOWNSHIFT attribute to a character field when you want the runtime system to convert uppercase letters entered by the user to lowercase letters, both on the screen and in the corresponding program variable.
DOWNSHIFT
You can use the FORMAT attribute with numeric and date time fields to control the format of output displays.
FORMAT = "format-string"
For DECIMAL, SMALLFLOAT, and FLOAT data types, format-string consists of pound signs (#) that represent digits and a decimal point. For example, "###.##" produces three places to the left of the decimal point and exactly two to the right.
If the numeric value is too large to fit in the number of characters defined by the format, an overflow text is displayed (****).
If the actual number displayed requires fewer characters than format-string specifies, numbers are right-aligned and padded on the left with blanks.
If necessary to satisfy the format-string specification, the number values are rounded before display.
Character |
Description |
* | Fills with asterisks any position that would otherwise be blank. |
& | Fills with zeros any position that would otherwise be blank. |
# | This does not change any blank positions in the display. |
< | Causes left alignment. |
, (comma) | Defines the position of the comma (not displayed if there are no digits on the left). |
. (period) | Defines the position of the period (only one can be used). |
- | Displays a minus sign for negative numbers. |
+ | Displays a plus sign for positive numbers. |
$ | This is the placeholder for the front specification of DBMONEY or DBFORMAT. |
( | Displayed as left parentheses for negative numbers (accounting parentheses). |
) | Displayed as right parentheses for negative numbers (accounting parentheses). |
For DATE data types, the runtime system recognizes these symbols as special in format-string:
Character |
Description |
dd | Day of the month as a 2-digit integer. |
ddd | Three-letter English-language abbreviation of the day of the week, for example, Mon, Tue. |
mm | Month as a 2-digit integer. |
mmm | Three-letter English-language abbreviation of the month, for example, Jan, Feb. |
yy | Year, as a 2-digits integer representing the 2 trailing digits. |
yyyy | Year as a 4-digit number. |
The form compiler interprets any other characters as literals and displays them wherever you place them within format-string.
These format-string examples and their corresponding display formats for DATE fields display the twenty-third day of September 1999:
FORMAT attribute | Result |
none | 09/23/1999 |
FORMAT = "mm/dd/yy" |
09/23/99 |
FORMAT = "mmm dd, yyyy" |
Sep 23, 1999 |
FORMAT = "yymmdd" |
990923 |
FORMAT = "dd-mm-yy" |
23-09-99 |
FORMAT = "(ddd.) mmm. dd, yyyy" |
(Thu.) Sep. 23, 1999 |
01
EDIT f001 = order.thedate, FORMAT = "mm/dd/yyyy";
This attribute defines the character font type as fixed or variable when the default font is used.
FONTPITCH = {FIXED|VARIABLE}
FIXED
, you force the characters to
have a fixed size.VARIABLE
, you allow the characters to
have a variable size.By default, most front ends use variable width character fonts, but in some cases you might need to use a fixed font.
It is recommended that you use a STYLE defining a fixed font instead of this attribute.
This attribute is used for a container to align its children to the parent container.
GRIDCHILDRENINPARENT
By default, child elements of a container are aligned locally inside the container layout cells. With this attribute, you can force children to be aligned according to the layout cells of the parent container of the container to which you assign this attribute.
This is useful, for example, when you want to align fields across groups defined with Layout Tags inside a GRID:
01
LAYOUT02
GRID03
{04
<G g1 >05
Field1 [f1 ]06
Field2 [f2 ]07
Field3 [f3 ]08
09
<G g2 >10
F4 [f4 ]11
F5 [f5 ]12
13
}14
END15
END16
ATTRIBUTES17
GROUP g1 : GRIDCHILDRENINPARENT;18
GROUP g2 : GRIDCHILDRENINPARENT;19
EDIT f1 = FORMONLY.field1;20
EDIT f2 = FORMONLY.field2;21
EDIT f3 = FORMONLY.field3;22
EDIT f4 = FORMONLY.field4;23
EDIT f5 = FORMONLY.field5;24
END
The INCLUDE attribute specifies acceptable values for a field and causes the runtime system to check the data before accepting an input value.
INCLUDE = ( { NULL | literal [ TO literal
] } [,...] )
01
EDIT f001 = compute.rate, INCLUDE = ( 1 TO 100, 200, NULL);02
EDIT f002 = customer.state, INCLUDE = ( "AL" TO "GA", "IA" TO "WY" );
The INVISIBLE attribute prevents user-entered data from being echoed on the screen during an interactive statement.
INVISIBLE
The IMAGE attribute defines the image file to be associated with the form item.
IMAGE = "name"
This attribute is used to define the image file containing the icon to be displayed in a button or the picture of an image form item.
The name can be a simple file name, a complete or relative path, or an URL (Uniform Resource Locator) path to an image server.
While you can give a complete path with the file extension, it is recommended that you use a simple name or a relative path without the file extension, so that the system can automatically search for the image file using the specific extension (bmp, gif, ...).
If the image specification is a simple file name, the file is first sought in the pictures directory on the client workstation. If the file is not found, the front-end automatically sends an image request to the runtime system, in order to search for an image on the application server. The runtime system searches for server-side images by using the FGLIMAGEPATH environment variable.
To simplify deployment, you should use server-side images to centralize all images on the application server.
01
BUTTONEDIT f001 = FORMONLY.field01, IMAGE = "zoom";
The KEY attribute is used to define the labels of keys when the field is made current.
KEY keyname = [%]"label"
01
EDIT f001 = customer.city, KEY F10 = "City list";02
EDIT f002 = customer.state, KEY "Control-z" = "Open Zoom";
The MINHEIGHT attribute defines the minimum height of a form.
MINHEIGHT = integer
The MINHEIGHT attribute is used to define a minimum height of the form/window. It must be specified in the attributes of the LAYOUT section.
The unit defaults to a number of grid cells. This is the equivalent of the CHARACTERS in the HEIGHT attribute specification.
See also: MINWIDTH.
01
LAYOUT ( MINWIDTH=60, MINHEIGHT=50 )02
GRID03
...
The MINWIDTH attribute defines the minimum width of a form.
MINWIDTH = integer
The MINWIDTH attribute is used to define a minimum width of the form/window. It must be specified in the attributes of the LAYOUT section.
The unit defaults to a number of grid cells. This is the equivalent of the CHARACTERS in the WIDTH attribute specification.
See also: MINHEIGHT.
01
LAYOUT ( MINWIDTH=60, MINHEIGHT=50 )02
GRID03
...
The NOT NULL attribute sets that the field does not accept NULL values.
NOT NULL
This attribute requires that the field contains a value. If the field contains a default value, the NOT NULL attribute satisfied. To insist on data entry from the user, combine NOT NULL with the REQUIRED attribute in the field definition, or make sure the corresponding column is defined as REQUIRED in the database schema file.
See also REQUIRED attribute.
01
EDIT f001 = customer.city, NOT NULL;
The NOENTRY attribute prevents data entry in the field during an INPUT or INPUT ARRAY statement.
NOENTRY
01
EDIT f001 = order.totamount, NOENTRY;
The ORIENTATION attribute defines whether an element displays vertically or horizontally.
ORIENTATION = { VERTICAL | HORIZONTAL }
01
RADIOGROUP f001 = customer.status, ORIENTATION=HORIZONTAL;
The PICTURE attribute specifies a character pattern for data entry in a text field, and prevents entry of values that conflict with the specified pattern.
PICTURE = "format-string"
01
EDIT f001 = carinfo.number, PICTURE = "AA####-AA(X)";
The PROGRAM attribute can specify an external application program to work with screen fields of data type TEXT or BYTE.
PROGRAM = "editor"
The QUERYEDITABLE attribute makes a combobox field editable during a CONSTRUCT statement.
QUERYEDITABLE
The REQUIRED attribute forces the user to enter data in the field during an INPUT or INPUT ARRAY statement.
REQUIRED
This attribute requires only that the user enter a printable character in the field. If the user subsequently erases the entry during the same input, the runtime system considers the REQUIRED attribute satisfied. To insist on a non-null entry, combine REQUIRED with the NOT NULL attribute in the field definition or make sure the corresponding column is defined as NOT NULL in the database schema file.
See also NOT NULL attribute.
On character terminals, the REVERSE attribute displays any value in the field in reverse video (dark characters in a bright field).
REVERSE
The SAMPLE attribute defines the text to be used to compute the width of a form field.
SAMPLE = "text"
By default, form fields are rendered by the client with a size determined by the current font and the number of characters used in the layout grid. The field width is computed so that the largest value can fit in the widget.
Sometimes the default computed width is too wide for the typical values displayed in the field. For example, numeric fields usually need less space as alphanumeric fields. If the values are always smaller, you can use the SAMPLE attribute to provide a hint for the front end to compute the best width for that form field.
You can define a default sample for all fields used in the form, by specifying a DEFAULT SAMPLE option in the INSTRUCTIONS section.
See also: DEFAULT SAMPLE.
01
EDIT cid = customer.custid, SAMPLE="0000";02
EDIT ccode = customer.ucode, SAMPLE="MMMMMM";03
DATEEDIT be01 = customer.created, SAMPLE="00-00-0000";
The SCROLL attribute can be used to enable horizontal scrolling in a character field.
SCROLL
By default, the maximum data input length is defined by the width of the item-tag of the field. For example, if you define an CHAR field in the form with a length of 3 characters, users can only enter a maximum of 3 characters, even if the program variable used for input is a CHAR(20).
If you want to let the user input more characters than the width of the item-tag of the field, use the SCROLL attribute.
See also: Field Input Length.
The STRETCH attribute specifies how a widget must resize when the parent container is resized.
STRETCH = { NONE | X | Y | BOTH }
This attribute is typically used with form items that can be resized like IMAGE or TEXTEDIT fields. By default such form items have a fixed width and height, but in some cases you may want to force the widget to resize vertically, horizontally, or in both directions.
01
IMAGE i01 = FORMONLY.image01, STRETCH=BOTH;
The STEP attribute specifies how a value is increased or decreased in one step (by a mouse click or key up/down).
STEP = integer
This attribute is typically used with form items allowing the user to change the current integer value by a mouse click like SLIDER, SPINEDIT.
01
SLIDER s01 = FORMONLY.slider, STEP=10;
The TEXT attribute defines the label associated with a form item, such as the text of a checkbox item.
TEXT = [%]"string"
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED='y', VALUEUNCHECKED='n';
The TITLE attribute defines the title of a form item. Use may be restricted to form fields that make up the columns of a table container; see the documentation for the relevant form item.
TITLE = [%]"string"
01
EDIT col1 = FORMONLY.column1, TITLE="Num";
The VALUEMIN attribute defines a lower limit of values displayed in widgets (such as progress bars).
VALUEMIN = integer
This attribute is typically used in PROGRESSBAR fields, to define the lower limit.
The VALUEMAX attribute defines a upper limit of values displayed in widgets (such as progress bars).
VALUEMAX = integer
This attribute is typically used in PROGRESSBAR fields, to define the upper limit.
The VALUECHECKED attribute defines the value associated with a checkbox item when it is checked.
VALUECHECKED = value
This attribute is used in conjunction with the VALUEUNCHECKED attribute to define the values corresponding to the states of a CHECKBOX. See CHECKBOX definition for more details.
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED=TRUE, VALUEUNCHECKED=FALSE;
The VALUEUNCHECKED attribute defines the value associated with a checkbox item when it is not checked.
VALUEUNCHECKED = value
This attribute is used in conjunction with the VALUECHECKED attribute to define the values corresponding to the states of a CHECKBOX. See CHECKBOX definition for more details.
01
CHECKBOX cb01 = FORMONLY.checkbox01, TEXT="OK", VALUECHECKED="Y", VALUEUNCHECKED="N";
Indicates that the element cannot be selected by the user for sorting.
UNSORTABLE
By default, a TABLE container allows the user to sort the columns by a left-click on the column header. Use this attribute to prevent a sort on a specific column.
01
EDIT c01 = item.comment, UNSORTABLE;
Indicates that the columns of the table cannot be selected by the user for sorting.
UNSORTABLECOLUMNS
Same effect as UNSORTABLE, but at the TABLE level, so that none of the table columns can be used for sort.
01
TABLE t1 ( UNSORTABLECOLUMNS )
Indicates that the element cannot be resized by the user.
UNSIZABLE
By default, a TABLE container allows the user to resize the columns by a drag-click on the column header. Use this attribute to prevent a resize on a specific column.
01
EDIT c01 = item.comment, UNSIZABLE;
Indicates that the columns of the table cannot be resized by the user.
UNSIZABLECOLUMNS
Same effect as UNSIZABLE, but at the TABLE level, to make all columns not resizable.
01
TABLE t1 ( UNSIZABLECOLUMNS )
Indicates that the element cannot be hidden or shown by the user with the context menu.
UNHIDABLE
By default, a TABLE container allows the user to hide the columns by a right-click on the column header. Use this attribute to prevent the user from hiding a specific column.
01
EDIT c01 = item.comment, UNHIDABLE;
Indicates that the columns of the table cannot be hidden or shown by the user with the context menu.
UNHIDABLECOLUMNS
Same effect as UNHIDABLE, but at the TABLE level, to make all columns not hidable.
01
TABLE t1 ( UNHIDABLECOLUMNS )
The UNMOVABLE attribute prevents the user from moving a defined column of a table.
UNMOVABLE
By default, a TABLE container allows the user to move the columns by dragging and dropping the column header. Use this attribute to prevent the user from changing the order of a specific column. Typically, UNMOVABLE is used on at least two columns to prevent the user from changing the order of the input on these columns.
The UNMOVABLECOLUMNS attribute prevents the user from moving columns of a table.
UNMOVABLECOLUMNS
By default, a TABLE container allows the user to move the columns by dragging and dropping the column header. Use this attribute to prevent the user from changing the order of columns.
Assign the UPSHIFT attribute to a character field when you want the runtime system to convert lowercase letters entered by the user to uppercase letters, both on the screen and in the corresponding program variable.
UPSHIFT
01
EDIT f001 = FORMONLY.thetitle, UPSHIFT;
VALIDATE is an Action Defaults attribute defining the data validation level for a given action.
VALIDATE = NO
The VALIDATE LIKE attribute instructs the runtime system to validate the data entered in the field by using the validation rules defined in the database schema file for the column associated with the field.
VALIDATE LIKE [table.]column
01
EDIT f001 = FORMONLY.fullname, VALIDATE LIKE customer.custname;
The INITIALIZER attribute allows you to specify an initialization function that will be automatically called by the runtime system to set up the form item.
INITIALIZER = function
The initialization function must exist in the program using the form file and must be defined with a ui.ComboBox parameter.
The ITEMS attribute defines a list of possible values that can be used by the form item.
ITEMS = { single-value-list | double-value-list }
where single-value-list is:
( value [,...]
)
where double-value-list is:
( ( value, label-value
) [,...]
)
The list must be delimited by parentheses, and each element of the list can be a simple literal value or a pair of literal values delimited by parentheses.
The following example defines a list of simple values:
ITEMS = ("Paris", "London", "New York")
The next example defines a list of pairs:
ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"))
This attribute can be used, for example, to define the list of a COMBOBOX form item:
01
COMBOBOX cb01 = FORMONLY.combobox01, ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"));
In this case, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed in the selection list.
When used in a RADIOGROUP form item, this attribute defines the list of radio buttons:
01
RADIOGROUP rg01 = FORMONLY.radiogroup01, ITEMS = ((1,"Paris"),(2,"London"),(3,"New York"));
In this case, the first value of a pair (1,2,3) defines the data values of the form field and the second value of a pair ("Paris", "London", "New York") defines the value to be displayed as the radio button label.
Localization
You can specify item labels with Localized Strings, but this is only possible when you specify a key and a label:
ITEMS = ((1,%"item1"),(2,%"item2"),(3,%"item3"))
Using NULL items
It is allowed to define a NULL value for an item (note that an empty string is equivalent to NULL):
ITEMS = ((NULL,"Enter bug status"),(1,"Open"),(2,"Resolved"))
In this case, the behavior of the field depends from the item type used. For more details, see field type specific notes for COMBOBOX and RADIOGROUP.
The JUSTIFY attribute defines text justification.
JUSTIFY = { LEFT | CENTER | RIGHT }
Default text justification depends on the dialog type, the field data type and the FORMAT attribute. For example, a numeric field value is right aligned, while a string field is left aligned. The type of dialog also defines the default justification. In a CONSTRUCT, all input fields are left aligned, for search criteria input.
With the JUSTIFY attribute, you define the display text justification of a field, as LEFT, CENTER or RIGHT. This attribute is ignored for input; only the default text justification rule applies when a field has the focus.
The JUSTIFY attribute can only be used for widgets displaying a value as text, like a LABEL, EDIT or BUTTONEDIT.
01
LABEL t01 : TEXT="Hello!", JUSTIFY=RIGHT;02
EDIT f01 = order.value, JUSTIFY=CENTER;
The SCROLLBARS attribute can be used to specify scrollbars for a form item.
SCROLLBARS = { NONE | VERTICAL | HORIZONTAL |
BOTH }
This attribute defines scrollbars for the form item, such as a TEXTEDIT.
01
TEXTEDIT f001 = customer.fname, SCROLLBARS=BOTH;
The SIZEPOLICY attribute is a sizing directive to display form elements.
SIZEPOLICY = { INITIAL | FIXED | DYNAMIC }
This attribute defines the initial size of some form elements. The default value of SIZEPOLICY is INITIAL.
When the SIZEPOLICY is FIXED, the form elements size is exactly the one defined in the Form Specification File. The width of the element is computed from the defined width and the font used.
For some elements such as COMBOBOX or RADIOGROUP, you may want the size of the widget to fit exactly to its content: When SIZEPOLICY is DYNAMIC, the width of the element grows and shrinks according to the width of the wider item.
When a form element is created from a database (for instance populating a COMBOBOX item list), the width of each element is not known when designing the form. When SIZEPOLICY is INITIAL, the width is computed to display the element correctly the first time it appears on the screen. Once it is displayed, its width is frozen. This behavior is also very useful when using Internationalization.
When SIZEPOLICY is INITIAL, the client behaves differently depending on the form element type:
The following table shows the effect of the SIZEPOLICY attribute according to the type of form item; INITIAL corresponds to the first content, while DYNAMIC corresponds to the content at anytime:
Item Type | INITIAL | FIXED | DYNAMIC |
EDIT | fixed | fixed | no effect |
BUTTONEDIT | fixed | fixed | no effect |
TEXTEDIT | fixed | fixed | no effect |
DATEEDIT | can shrink | fixed | no effect |
COMBOBOX | can grow | fixed | can grow |
BUTTON | can grow | fixed | can shrink and grow |
LABEL | can shrink and grow | fixed | can shrink and grow |
RADIOGROUP | can shrink and grow | fixed | can shrink and grow |
CHECKBOX | can shrink and grow | fixed | can shrink and grow |
PROGRESSBAR | fixed | fixed | no effect |
SLIDER | fixed | fixed | no effect |
SPINEDIT | fixed | fixed | no effect |
TIMEEDIT | fixed | fixed | no effect |
IMAGE | depends on AUTOSCALE and STRETCH attributes | ||
CANVAS | Non applicable | Non applicable | Non applicable |
01
COMBOBOX f001 = customer.city, ITEMS=((1,"Paris"),(2,"Madrid"),(3,"London")), SIZEPOLICY=DYNAMIC;
The SPACING attribute is a spacing directive to display form elements.
SPACING = { NORMAL | COMPACT }
This attribute defines the global distance between two neighboring form elements. By default, forms are displayed with NORMAL spacing. In NORMAL mode, the front end displays form elements consistent with the desktop spacing, which is, for example, 6 and 10 pixels on Microsoft Windows platforms. Some overcrowded forms may need to be displayed with less space between elements, to let them fit to the screen. In this case you can use the COMPACT mode.
01
LAYOUT ( SPACING=COMPACT )
The SPLITTER attribute forces the container to use a splitter widget between each child element.
SPLITTER
This attribute indicates that the container (typically, a VBOX or HBOX) must have a splitter between each child element held by the container. If a container is defined with a splitter and if the children are stretchable (like TABLE or TEXTEDIT), users can resize the child elements inside the container.
01
VBOX ( SPLITTER )
The STYLE attribute specifies a presentation style for a form element.
STYLE = "string"
This attribute specifies a presentation style to be applied to a form element. The presentation style can define decoration attributes such as a background color, a font type, and so on.
The TAG attribute can be used to identify the form item with a specific string.
TAG = "tag-string"
This attribute is used to identify form items with a specific string. It can be queried in the program to perform specific processing.
You are free to use this attribute as you need. For example, you can define a numeric identifier for each field in the form in order to show context help, or group fields for specific input verification.
If you need to handle multiple data, you can format the text, for example, by using a pipe separator.
01
EDIT f001 = customer.fname, TAG = "name";02
EDIT f002 = customer.lname, TAG = "name|optional";
The TABINDEX attribute defines the tab order for a form item.
TABINDEX = integer
This attribute can be used to define the order in which the form items are selected as the user "tabs" from field to field when the program is using the form field order option.
It can also be used to define which field must get the focus when a folder page is selected.
By default, form items get a tab index according to the order in which they appear in the LAYOUT section.
Tip: TABINDEX can be set to zero in order to exclude the item from the tabbing list. The item can still get the focus with the mouse.
01
EDIT f001 = customer.fname, TABINDEX = 1;02
EDIT f002 = customer.lname, TABINDEX = 2;03
EDIT f003 = customer.comment, TABINDEX = 0; -- Exclude from tabbing list
The VERIFY attribute requires users to enter data in the field twice to reduce the probability of erroneous data entry.
VERIFY
The VERSION attribute is used to specify a user version string for an element.
VERSION = { "string" | TIMESTAMP }
This attribute specifies a version string to distinguish different versions of a form element. You can specify an explicit version string or use the TIMESTAMP keyword to force the form compiler to write a timestamp string into the 42f file.
Typical usage is to specify a version of the form to indicate if the form content has changed. This attribute is used by the front-end to distinguish different form versions and to avoid reloading window/form settings into a new version of a form.
01
LAYOUT ( TEXT="Orders", VERSION = "1.23" )
The OPTION attribute specifies widget options for the field.
OPTIONS = "option [...]"
-nolist
(to indicate that the
column should appear as an independent field).The WANTTABS attribute forces a text field to insert TAB characters in the text when the user presses the TAB key.
WANTTABS
By default, text fields like TEXTEDIT do not insert a TAB character in the text when the user presses the TAB key, since the TAB key is used to move to the next field. You can force the field to consume TAB keys with this attribute.
The WANTNORETURNS attribute forces a text field to reject NewLine characters when the user presses the RETURN key.
WANTNORETURNS
By default, text fields like TEXTEDIT insert a NewLine (ASCII 10) character in the text when the user presses the RETURN key. As the RETURN key is used to validate the dialog, you can force the field to reject RETURN keys with this attribute.
The WANTFIXEDPAGESIZE attribute gives a fixed height to a TABLE container.
WANTFIXEDPAGESIZE
By default, the height of a TABLE container is resizable. Use this attribute to freeze the number of rows to the number of screen lines defined by the form file.
The WIDTH attribute defines an explicit width of a form element.
WIDTH = integer [CHARACTERS|COLUMNS|POINTS|PIXELS]
By default, the size of an element is defined in characters and automatically computed by the form compiler according to the size of the form element in the layout.
For items like images, the default width is defined by the number of horizontal characters used in the item tag. You can overwrite this default by specifying the WIDTH attribute. You typically give a number of pixels.
For tables, the default width is defined by the columns used in the table layout. You can overwrite this default by specifying the WIDTH attribute. You typically give a number of columns. This allows you to use tables with a large number of columns, but a small initial width.
If you don't specify any unit, the size unit defaults to CHARACTERS, which defines the number of grid cells.
See also: HEIGHT.
01
TABLE t1 ( WIDTH = 5 COLUMNS )
The WIDGET attribute specifies the type of graphical widget to be used for the field.
WIDGET = "identifier"
Symbol | Effect | Other attributes |
Canvas | The field is used as a drawing area. Field must be declared as FORMONLY field. |
None. |
BUTTON | The field is presented as a button widget with a label. | CONFIG: The unique parameter defines
the key to be sent when the user clicks on the button. Button text is
defined in configuration files or from the program with a DISPLAY
TO instruction. For example: CONFIG = "Control-z" |
BMP | The field is presented as a button with an image. | CONFIG: First parameter defines
the image file to be displayed, second parameter defines the key to be
sent when the user clicks on the button. For example: CONFIG = "smiley.bmp F11" Important warning: Image files are not centralized on the machine where the program is executed; image files must be present on the Workstation. See front end specific documentation for more details. |
CHECK | The field is presented as a checkbox widget.
It can be used with the CLASS attribute to change the behavior of the widget. |
CONFIG: First and second
parameters define the values corresponding respectively to the state
"Checked" / "Unchecked" of the check box, while the
third parameter defines the label of the checkbox. For example: CONFIG = "Y N Confirmation" If the CLASS attribute is used with the "KEY" value, the first and second parameters defines the keys to be sent respectively when the checkbox is "Checked" / "Unchecked", and the third parameter defines the label of the checkbox as with normal checkbox usage. For example: CLASS="KEY",CONFIG="F11 F12 Confirmation" |
COMBO | The field is presented as a combobox widget.
It can be used with the CLASS attribute to change the behavior of the widget. |
INCLUDE: This attribute defines
the list of acceptable values that will be displayed in the combobox
list. For example: INCLUDE = ("Paris", "London", "Madrid") Important warning: The INCLUDE attribute cannot hold value range definitions, because all items must be explicitly listed to be added to the combobox list. The following example is not supported: INCLUDE = ( 1 TO 10 ) |
FIELD_BMP | The field is presented as a normal editbox, plus a button on the right. | CONFIG: The first parameter defines
the image file to be displayed in the button;
the second parameter defines the key to be sent when the user clicks
on the button. For example: CONFIG = "combo.bmp Control-z" |
LABEL | The field is presented as a simple label, a read-only text. | None. |
RADIO | The field is presented as a radiogroup widget. | CONFIG: Parameter pairs define
respectively the value and the label corresponding to one radio button. For example: CONFIG = "AA First BB Second CC Third" If the CLASS attribute is used with the value "KEY", the first element of each pairs represents the key to be sent when the user selects a radio button. For example: CLASS="KEY", CONFIG="F11 First F12 Second F13 Third" |
The following list of widgets can be enabled or disabled from programs with a DISPLAY TO instruction:
If you display an exclamation mark in such fields, the button is enabled, but if you display a star (*), it is disabled:
01
DISPLAY "*" TO button1 # disables the button02
DISPLAY "!" TO button1 # enables the button
Text buttons (WIDGET="BUTTON") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "Click me" TO button1 # Sets text and enables the button
Image buttons (WIDGET="BMP") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "smiley.bmp" TO button1 # Sets image and enables the button
Warning: Image files are not centralized on the machine where the program is executed; image files must be present on the Workstation. See front end specific documentation for more details.
The text if label fields (WIDGET="LABEL") can be changed from programs with the DISPLAY TO instruction:
01
DISPLAY "Firstname" TO l_firstname # Sets text of the label field
The fields declared with the WIDGET="Canvas" attribute can be used by the program as drawing areas. Canvas fields must be defined in the LAYOUT section. A set of drawing functions are provided to fill CANVAS fields with graphical elements.
The WINDOWSTYLE attribute defines the style to be used by the parent window of a form.
WINDOWSTYLE = "string"
The WINDOWSTYLE attribute can be used to specify the style of the parent window that will hold the form. This attribute is specific to the LAYOUT element. Do not confuse with the STYLE attribute, which is used to specify decoration style of the form elements.
When a form is loaded by the OPEN WINDOW or DISPLAY FORM instructions, the runtime system automatically assigns the WINDOWSTYLE to the 'style' attribute of the parent window element.
See also: STYLE, Windows and Forms.
01
LAYOUT ( STYLE="BigFont", WINDOWSTYLE="dialog" )
The WORDWRAP attribute enables a multiple-line editor in TUI mode.
WORDWRAP [ { COMPRESS | NONCOMPRESS } ]
The maximum number of bytes a user can enter is the width of the form-field multiplied by the height of the form-field. Blank characters may be intentional blanks or fill blanks. Intentional blanks are initially stored in the target variable where entered by the user. Fill blanks are inserted at the end of a line by the editor when a new-line or a word-alignment forces a line-break. It is not possible to set the cursor at a fill blank. Intentional blanks are always displayed (even on the beginning of a line; the word-wrapping method used in reports with PRINT WORDWRAP works differently).
When entering characters with Japanese locales, special characters are prohibited from being the first or the last character on a line. If the last character is prohibited from ending a line, this character is wrapped down to the next line. If the first character is prohibited from beginning a line, the preceding character will also wrap down to the next line. This method is called kinsoku. The test for prohibited characters will be done only once for the first and the last character on each line.
Word-wrapping is disabled on the last row of a WORDWRAP field. The last word on the last row may by truncated. The WORDWRAP COMPRESS attribute instructs the editor to remove fill blanks before assigning the field-buffer to the target variable. The WORDWRAP NONCOMPRESS attribute instructs the editor to store fill blanks to the target variable. The WORDWRAP and WORDWRAP NONCOMPRESS attributes are equivalent.