Progress
Language Reference


VIEW-AS Phrase

Interfaces
OS
SpeedScript
All
All
No

Defines a static widget to represent a field or variable on the screen.

SYNTAX

VIEW-AS 
  {    combo-box-phrase
     |  editor-phrase
     |  FILL-IN
          [ NATIVE ]
          [ size-phrase ]
          [ TOOLTIP tooltip ]
     |  radio-set-phrase
     |  selection-list-phrase
     |  slider-phrase
     |  TEXT
          [ size-phrase ]
          [ TOOLTIP tooltip ]
     |  TOGGLE-BOX
          [ size-phrase ]
          [ TOOLTIP tooltip ]
  } 

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 for combo-box-phrase.

SYNTAX
VIEW-AS COMBO-BOX
  [ LIST-ITEMS item-list | LIST-ITEM-PAIRS item-pair-list ]
  [ INNER-LINES lines ] [ size-phrase ] [ SORT ]
  [ TOOLTIP tooltip ]
  [ SIMPLE | DROP-DOWN | DROP-DOWN-LIST ]
  [ MAX-CHARS characters ] 
  [ AUTO-COMPLETION [ UNIQUE-MATCH ] ] 

For more information, see the COMBO-BOX Phrase reference entry.

editor-phrase

Specifies that a CHARACTER 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 for editor-phrase.

SYNTAX
EDITOR 
  {     size-phrase
     |  INNER-CHARS char INNER-LINES lines 
  }
  [ BUFFER-CHARS chars ]
  [ BUFFER-LINES lines ]
  [ LARGE ]
  [ MAX-CHARS characters ]
  [ NO-BOX ]
  [ NO-WORD-WRAP ]
  [ SCROLLBAR-HORIZONTAL ]
  [ SCROLLBAR-VERTICAL ]
  [ TOOLTIP tooltip ] 

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, INTEGER, DECIMAL, DATE, 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 Progress 4GL fill-in field under any interface. Native fill-in fields provide better consistency with other applications in graphical environments, but do not support some Progress constructs such as the UPDATE statement with the TEXT option or the CHOOSE statement.

When a non-NATIVE (Progress 4GL) 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 a radio-set-phrase for any group of CHARACTER, INTEGER, DECIMAL, DATE, or LOGICAL values (with or without extents). This is the syntax for radio-set-phrase.

SYNTAX
RADIO-SET
  [ HORIZONTAL [ EXPAND ] | VERTICAL ]
  [ size-phrase ]
  RADIO-BUTTONS label , value [ , label, value ... ] 
  [ TOOLTIP tooltip ] 

NOTE: If two or more buttons of a radio set use the same label, the Progress 4GL 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 the selection-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.

SYNTAX
SELECTION-LIST 
  [ SINGLE | MULTIPLE ]
  [ NO-DRAG ]
  [ LIST-ITEMS item-list ]
  [ SCROLLBAR-HORIZONTAL ]
  [ SCROLLBAR-VERTICAL ]
  { size-phrase | INNER-CHARS cols INNER-LINES rows }
  [ SORT ]
  [ TOOLTIP tooltip ] 

For more information, see the SELECTION-LIST Phrase reference entry.

slider-phrase

Specifies that the field or variable is viewed as a slider. Specify the slider-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.

SYNTAX
VIEW-AS SLIDER 
  MAX-VALUE max-value MIN-VALUE min-value
  [ HORIZONTAL | VERTICAL ]
  [ NO-CURRENT-VALUE ]
  [ LARGE-TO-SMALL ]
  [ TIC-MARKS
      { NONE | TOP | BOTTOM | LEFT | RIGHT | BOTH }
      [ FREQUENCY n ]
  ]
  [ TOOLTIP tooltip ]
  [ size-phrase ] 

For more information, see the SLIDER Phrase reference entry.

TEXT [ size-phrase ]

Specifies that the field or variable is viewed as read-only text. In a graphical environment, a text field takes up less space on the screen than a native fill-in field.

You can specify TEXT for any CHARACTER, INTEGER, DECIMAL, DATE, or LOGICAL value (with or without extents).

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.

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.

TOOLTIP tooltip

Allows you to define a help text message for a toggle box. Progress 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.

EXAMPLE

The 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.

r-viewas.p
DEFINE VARIABLE test   AS CHARACTER INITIAL "Now is the time"
          FORMAT "x(30)".

DISPLAY test VIEW-AS TEXT LABEL "Labels cannot be changed"
  WITH FRAME a SIDE-LABELS.
   
PAUSE.

UPDATE test VIEW-AS FILL-IN
      LABEL "But fillins can, please enter a new value"
       WITH FRAME b SIDE-LABELS.
   
UPDATE test VIEW-AS EDITOR
  INNER-CHARS 16 INNER-LINES 2 MAX-CHARS 70
  LABEL  "As can editors, please enter a new value:"
  WITH FRAME c. 
   
DISPLAY test VIEW-AS TEXT FORMAT "x(70)"
  LABEL "The final value is:"
  WITH FRAME d. 

For additional examples, see the COMBO-BOX Phrase, EDITOR Phrase, RADIO-SET Phrase, SELECTION-LIST Phrase, and SLIDER Phrase reference entries.

NOTES

SEE ALSO

COMBO-BOX Phrase, EDITOR Phrase, RADIO-SET Phrase, SELECTION-LIST Phrase, SIZE Phrase, SLIDER Phrase


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095