VIEW-AS phrase
Defines a compile-time defined (static) widget to represent a field or variable on the screen.
Note: Does not apply to SpeedScript programming.Syntax
Use the following syntax to specify the type of widget to use for displaying values in a browse column:
combo-box-phrase
Specifies that a field or variable is viewed as a combo box widget. You can use a combo box to represent a value of any data type. This is the syntax forcombo-box-phrase
:
Use the following syntax to specify a combo-box widget for displaying values in a browse column:
For more information, see the COMBO-BOX phrase reference entry.editor-phrase
Specifies that a CHARACTER or LONGCHAR field or variable is viewed as a text editor widget. A text editor widget supports cut, paste, word-wrap, and auto-indent features. This is the syntax foreditor-phrase
:
For more information, see the EDITOR phrase reference entry.FILL-IN [ NATIVE ] [size-phrase
]
Specifies that the field or variable is viewed as a fill-in widget. In a fill-in field, the literal value of the field or variable is displayed. On update, the user types the literal value into the fill-in field.You can specify FILL-IN for any CHARACTER, INT64, INTEGER, DECIMAL, DATE, DATETIME, DATETIME-TZ, or LOGICAL value (with or without extents). FILL-IN is the default representation for those values.Note that Windows allows a user to transfer focus to the fill-in field by pressing ALT and one of the letters in the label. For more information on specifying a label using the LABEL option, see the Format phrase reference entry.If you specify NATIVE, then the field behaves like a native fill-in field under the current user interface. A non-NATIVE field behaves like a default ABL fill-in field under any interface. Native fill-in fields provide better consistency with other applications in graphical environments, but do not support some ABL constructs such as the UPDATE statement with the TEXT option or the CHOOSE statement.When a non-NATIVE (ABL) fill-in is disabled, the border disappears, but the text does not gray out. When a NATIVE fill-in is disabled, the text grays out.Like the other static widgets that can be defined using the VIEW-AS phrase, you can specify ToolTips for the fill-in widget using the TOOLTIP option.radio-set-phrase
Specifies that the field or variable is viewed as a radio set widget. A radio button set is a series of buttons, of which only one can be TRUE at a time. When the user sets one of the buttons to TRUE, the others are set to FALSE. You can specify aradio-set-phrase
for any group of CHARACTER, INT64, INTEGER, DECIMAL, DATE, or LOGICAL values (with or without extents). This is the syntax forradio-set-phrase
:
Note: If two or more buttons of a radio set use the same label, the AVM uses only the value of the first button.For more information, see the RADIO-SET phrase reference entry.selection-list-phrase
Specifies that the field or variable is viewed as a selection list widget. You can only specify theselection-list-phrase
for a character-string value. A selection list is a scrollable list of CHARACTER values. If the field is enabled for input, the user can select one or more values from the list. This is the syntax forselection-list-phrase
:
For more information, see the SELECTION-LIST phrase reference entry.slider-phrase
Specifies that the field or variable is viewed as a slider. Specify theslider-phrase
for an integer value only. A slider is a graphical representation of a numeric range. It is composed of a rectangular area that contains a trackbar. You can change the current value within a defined range by moving the pointer that resides on the trackbar. This is the syntax forslider-phrase
:
For more information, see the SLIDER phrase reference entry.TEXT [size-phrase
]TOGGLE-BOX [size-phrase
]
Specifies that the field or variable is viewed as a toggle box widget. A toggle box is a small box that is either marked or not marked to indicate a TRUE or FALSE value, respectively. You can specify TOGGLE-BOX for any LOGICAL value, or any calculated value whose expression evaluates to a LOGICAL value.Note that Windows allows a user to select a toggle-box item by pressing ALT and one of the letters in the side label. For more information on specifying a label using the LABEL option, see the Format phrase reference entry.For toggle-box browse columns, the toggle-box always appears whether it is enabled or not. A solid outline appears to indicate that a cell in a toggle-box column currently has focus. The toggle-box is always centered within the column. You cannot specifysize-phrase
for toggle-box browse columns.TOOLTIPtooltip
Allows you to define a help text message for a toggle box. The AVM automatically displays this text when the user pauses the mouse over the toggle-box.You can add or change the TOOLTIP option at any time. If TOOLTIP is set to "" or the Unknown value (?
), then the ToolTip is removed. No ToolTip is the default. The TOOLTIP option is supported in Windows only.ExampleThe following procedure defines a character variable and views it in succession as a text widget, a fill-in widget, an editor widget, and finally as a text widget again. The procedure shows that you can represent a character variable in several ways, as long as each representation appears in a separate frame.
For additional examples, see the COMBO-BOX phrase, EDITOR phrase, RADIO-SET phrase, SELECTION-LIST phrase, and SLIDER phrase reference entries.
Notes
- To create a static widget, you must define a static frame that contains the widget. Each frame you define that contains the widget creates an additional instance of that widget for the underlying field or variable. The handle for a static widget is not available until the widget is created.
- You can also use the VIEW-AS option in the Frame phrase and MESSAGE statement to indicate a dialog box and alert box, respectively.
- In Windows, if no font is specified for a fill-in field, ABL uses two default fonts:
The AVM looks for these fonts in the current environment, which may be the registry (Windows only) or an initialization file. If the current environment does not define these fonts, the AVM uses the system default fixed and proportional fonts. For more information on environments, see OpenEdge Deployment: Managing ABL Applications.See alsoCOMBO-BOX phrase, EDITOR phrase, RADIO-SET phrase, SELECTION-LIST phrase, SIZE phrase, SLIDER phrase
OpenEdge Release 10.2B
|