EDITOR phrase

Specifies that a field or variable is displayed as a text editor widget. This is especially useful for long text (CHARACTER and LONGCHAR) fields. The EDITOR phrase is an option of the VIEW-AS phrase.

Syntax

EDITOR
  {  size-phrase
      | INNER-CHARS characters INNER-LINES lines
  } 
  [ BUFFER-CHARS chars ]
  [ BUFFER-LINES lines ]
  [ LARGE ]
  [ MAX-CHARS characters ]
  [ NO-BOX ]
  [ NO-WORD-WRAP ]
  [ SCROLLBAR-HORIZONTAL ]
  [ SCROLLBAR-VERTICAL ]
  [ TOOLTIP tooltip ]
size-phrase
Specifies the outer width and height of the text editor widget in characters or pixels. This is the syntax for size-phrase:
{ SIZE | SIZE-CHARS | SIZE-PIXELS } width BY height

For more information, see the SIZE phrase reference entry.

INNER-CHARS chars INNER-LINES lines
Specifies the number of characters visible in each line of the Editor and the number of lines visible within the Editor. Both chars and lines must be integer constants.

Note that the values you supply for INNER-CHARS and INNER-LINES specify only the size of the editing area, not the overall size of the editor widget. The overall size is determined by the size of the editing area plus the sizes of the margin and border heights and widths.

BUFFER-CHARS chars
In character mode, specifies the number of characters a user can enter on each line. When the last character is typed, the text input cursor automatically wraps to the next line. This option is ignored in graphical environments.

The chars value must be an integer constant that is equal to or greater than the value specified by SIZE width or INNER-CHARS chars. If greater, horizontal scrolling is enabled. The default is the value specified by SIZE width or INNER-CHARS chars.

BUFFER-LINES lines
In character mode, specifies the number of lines a user can enter. By default, ABL does not limit the number of lines (although system limits might apply). This option is ignored in graphical environments.

The lines value must be an integer constant that is equal to or greater than the value specified by BY height or INNER-LINES lines. If equal, vertical scrolling is disabled.

LARGE
Specifies that ABL use a large editor widget rather than a normal editor widget in Windows. A normal Windows editor can contain up to 20K of data. The LARGE option allows the editor to contain data up to the limit of your system resources. However, it also consumes more internal resources and lacks some functionality. Use the LARGE option only if you have to edit very large sections of text. The LARGE option applies only to Windows; other interfaces allow for larger editors by default. This option is ignored in those other interfaces.
MAX-CHARS characters
The maximum number of characters that can be displayed or entered within the text editor widget. The value characters must be an integer constant. By default, ABL does not limit the number of characters (although system limits might apply).
NO-BOX
Specifies that the editor be displayed without a border. The default is to display the editor with a border. The NO-BOX option has no effect on the size of the editor.
NO-WORD-WRAP
Specifies that word wrap be disabled within the text editor widget. If you enable word wrap, horizontal scrolling is disabled. This option is ignored in character mode. This is the default with the LARGE option.
SCROLLBAR-HORIZONTAL
Specifies that horizontal scrolling is enabled and a horizontal scroll bar is displayed for the widget.
SCROLLBAR-VERTICAL
Specifies that a vertical scroll bar is display for the widget. Although vertical scrolling is always enabled within a text editor widget, a vertical scroll bar is displayed only if you specify this option.
TOOLTIP tooltip
Allows you to define a help text message for a text field or text variable. The AVM automatically displays this text when the user pauses the mouse button over a text field or text variable for which a tooltip is defined.

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 example uses two editor widgets. The Item.CatDescription field is viewed as an EDITOR in the item-info frame and the variable my_clipbd is viewed as an EDITOR in the clip frame. Use the EDITOR functions provided by your interface environment to copy text from CatDescription into my_clipbd. You can then subsequently copy that text into the CatDescription field of another item.

r-vaedit.p

DEFINE VARIABLE my_clipbd AS CHARACTER NO-UNDO
  VIEW-AS EDITOR SIZE 60 BY 6 SCROLLBAR-VERTICAL LABEL "Scratch Pad".

DEFINE BUTTON b_quit LABEL "Quit" AUTO-ENDKEY.

FORM
  Item.ItemNum
  Item.ItemName
  Item.Price
  Item.OnHand
  Item.Allocated
  Item.ReOrder
  Item.OnOrder
  Item.CatPage
  Item.CatDescription VIEW-AS EDITOR SIZE 35 BY 3 SCROLLBAR-VERTICAL 
  WITH FRAME item-info 1 DOWN ROW 1 CENTERED SIDE-LABELS 
  TITLE "Update Item Category Description".

FORM my_clipbd WITH FRAME clip.

DEFINE FRAME butt-frame b_quit 
  WITH CENTERED ROW 18.

ON GO OF Item.ItemNum DO:
  FIND Item USING Item.ItemNum EXCLUSIVE-LOCK.
  DISPLAY Item WITH FRAME item-info.
  ENABLE Item.CatDescription WITH FRAME item-info.
  ENABLE my_clipbd WITH FRAME clip.
END.

ON GO OF Item.CatDescription DO:
  ASSIGN Item.CatDescription.
  CLEAR FRAME item-info.
  DISABLE Item.CatDescription WITH FRAME item-info.
END.

ENABLE Item.ItemNum WITH FRAME item-info.
ENABLE b_quit WITH FRAME butt-frame.

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

Notes

See also

SIZE phrase, VIEW-AS phrase