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
- If
you specify the SCROLLBAR-VERTICAL option in, a vertical scroll
bar appears on the side of the Editor. The user can then use the
scroll bar to scroll within the widget. Whether or not you specify SCROLLBAR-VERTICAL,
the user can scroll vertically by using the up and down arrow keys
to move above or below the displayed text.
- If you use the SIZE phrase to specify the dimensions of the
Editor, the AVM uses a portion of this overall space (thereby shrinking
the size of the editing area) for any scroll bars you specify. Use
the INNER-CHARS and INNER-LINES options if you want a fixed size
for the editing area, regardless of the presence of scroll bars.
- In Windows, the editor widget supports lines of up to 255 characters only.
- By default, the editor widget supports text wrap. This means
that when you reach the end of a line within the widget, text wraps
to the next line rather than scrolling to the right. In graphical
interfaces, you can enable horizontal scrolling by specifying either
the NO-WORD-WRAP or SCROLLBAR-HORIZONTAL options. If you specify SCROLLBAR-HORIZONTAL,
a horizontal scroll bar appears. If you specify NO-WORD-WRAP, but
not SCROLLBAR-HORIZONTAL, the user can scroll horizontally by using
the left and right arrow keys at the edge of the displayed text.
- Windows allows a user to transfer focus to the editor by pressing ALT and one of the letters in the
label. This is called a mnemonic.
- The character-mode editor does not support the tab character.
When the AVM reads a file that contains tabs into an editor widget,
it replaces the tabs with eight spaces. When it writes the file,
the tabs are not restored and the file is permanently changed.
- When you specify the LARGE option, the following attributes
and methods no longer apply to the editor:
- CONVERT-TO-OFFSET
method
- CURSOR-OFFSET attribute
- LENGTH attribute
- MAX-CHARS attribute
- SELECTION-END attribute
- SELECTION-START attribute
- SET-SELECTION method
- WORD-WRAP attribute
- For SpeedScript, the only valid options are: size-phrase,
INNER-CHARS, INNER-LINES, MAX-CHARS, NO-BOX, NO-WORD-WRAP.