WIDGET attribute
The WIDGET
attribute specifies the type of graphical widget to be used
for a field.
Syntax
This feature is deprecated, its use is discouraged although not prohibited.
WIDGET = "identifier"
- identifier defines the type of widget, it can be one of the keywords listed in Table 1.
Usage
The WIDGET
attribute defines the type of widget to be used for a form field.
This attribute is used with CONFIG
,
CLASS
, and
INCLUDE
attributes, to
define parameters for the field widget.
WIDGET
attribute is deprecated, use new form item types instead.- Instead of
WIDGET="BMP"
, use a IMAGE form item. - Instead of
WIDGET="CANVAS"
, use a CANVAS form item. - Instead of
WIDGET="CHECK"
, use a CHECKBOX form item. - Instead of
WIDGET="COMBO"
, use a COMBOBOX form item. - Instead of
WIDGET="BUTTON"
, use a BUTTON form item. - Instead of
WIDGET="FIELD_BMP"
, use a BUTTONEDIT form item. - Instead of
WIDGET="RADIO"
, use a RADIOGROUP form item.
The identifier widget type is case sensitive, only uppercase letters are recognized.
When you use the WIDGET
attribute, the form cannot be properly displayed on
character based terminals, it can only be displayed on graphical front-ends.
Symbol | Effect | Other attributes |
---|---|---|
Canvas |
The field is used as a drawing area. Field must be declared as |
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:
|
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:
Important: 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. |
For example:
If the text part must include spaces, add {} curly brakets around the text:
If the For example (line breaks added for document readability):
|
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 (line breaks added for document readability):
Important: 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:
|
FIELD_BMP |
The field is presented as a normal editbox, plus a button on the right. |
For example:
|
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 (line breaks added for document readability):
If the radio texts must include spaces, add {} curly brakets around the texts (line breaks added for document readability):
If the For example (line breaks added for document readability):
|
Controlling old style widgets activation
The
following list of widgets can be enabled or disabled from programs
with a DISPLAY TO
instruction:
- Text buttons (
WIDGET="BUTTON"
) - Image buttons (
WIDGET="BMP"
) - Checkboxes of class "KEY" (
WIDGET="CHECK", CLASS="KEY"
) - Radio buttons of class "KEY" (
WIDGET="RADIO", CLASS="KEY"
)
If you display an exclamation mark in such fields, the button is enabled, but if you display a star (*), it is disabled:
DISPLAY "*" TO button1 # disables the button
DISPLAY "!" TO button1 # enables the button
Changing the text of WIDGET="BMP" fields
WIDGET="BUTTON"
) can be changed from programs with
the DISPLAY TO
instruction:DISPLAY "Click me" TO button1
# Sets text and enables the button
Changing the image of WIDGET="BMP" fields:
WIDGET="BMP"
) can be changed from programs with the
DISPLAY TO
instruction:DISPLAY "smiley.bmp" TO button1
# Sets image and enables the button
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.
Changing the text of WIDGET="LABEL" fields:
WIDGET="LABEL"
) can be changed from programs with the
DISPLAY TO
instruction:DISPLAY "Firstname" TO l_firstname
# Sets text of the label field
Using WIDGET="Canvas" fields:
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.