Progress
Language Tutorial
for Character


Working with Editors

An editor widget presents the user with a large rectangular area for manipulating text. Actually, the Procedure Editor is a Progress application based on the editor widget. Figure 7–9 shows the parts of an editor.

Figure 7–9: Parts of an Editor

The editor serves as a means to display and update lengthy CHARACTER data. However, you could also use the editor widget as the basis for a word processor. This section sticks to the basic functionality, which is essential for many applications. See the Progress Programming Handbook for information on the sophisticated applications of the editor widget.

This is the VIEW-AS syntax for creating a simple editor.

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

Table 7–11 describes the editor syntax components.

Table 7–11: Editor Syntax
Component
Description
size-phrase
You might want to use the size phrase with an editor to fit an editor into a particular area of a display. In this case, use this syntax:
SIZE-CHARS WIDTH cols HEIGHT rows
Where cols and rows are integer constants.
INNER-CHARS
Instead of the size phrase, you can use the INNER-CHARS option with an integer constant to specify the number of characters that the editor can display on one line.
INNER-LINES
Use INNER-LINES with an integer constant to specify the number of lines for the editor to display.
BUFFER-CHARS
Use the two buffer options when the text area of an editor widget is larger than the rectangular area set up by the previous options. In this case, the editor rectangle shows only part of the text area at one time.
Use BUFFER-CHARS with an integer constant to specify the number of characters that one line of the editor can hold.
BUFFER-LINES
Use BUFFER-LINES with an integer constant to specify the number of lines that the editor can hold.
LARGE
Specifies that Progress uses 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 enables 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
Use this option to establish a maximum number of characters that the editor can hold.
SCROLLBAR-VERTICAL
When an editor can hold more lines than it can display, use this option to enable a vertical scrollbar.
NO-WORD-WRAP
The editor has default behavior to prevent words from splitting across line breaks. If a word cannot fit on the previous line, the editor moves it to the beginning of the new line as the user types. Specifying this option prevents word wrap. The editor instead scrolls horizontally until the user enters a line break.
SCROLLBAR-HORIZONTAL
When you use the NO-WORD-WRAP option, you can specify a horizontal scrollbar with SCROLLBAR-HORIZONTAL.
TOOLTIP tooltip
You can optionally define a text message string that automatically displays when the mouse pointer pauses over the editor.


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