Deprecated
Description: This statement displays an editor on the screen.
Returns: Nothing
Usage: Steady State
Format: Editor(Left, Bottom, Right, Top, EditorValue, FocusID, Font [, Info])
Parameters: Left { numeric } { required } { no default: }
Any numeric expression that defines the left hand side of the square area where the editor will operate.
Bottom { numeric } { required } { no default: }
Any numeric expression that defines the bottom of the square area where the editor will operate.
Right { numeric } { required } { no default: }
Any numeric expression that defines the right hand side of the square area where the editor will operate.
Top { numeric } { required } { no default: }
Any numeric expression that defines the top of the square area where the editor will operate.
EditorValue { Editor } { required } { no default: }
An editor value that has been created by MakeEditor which contains the text contents for the editor.
FocusID { numeric } { required } { no default: }
Any numeric expression giving the focus number of the graphic. If FocusID is zero, this graphic cannot receive the input focus.
Font { Font } { required } { no default: }
Any expression that returns a (fixed pitch) font value. If the font supplied is not fixed pitch, the system font is used.
Info { array } { optional } { no default: }
An optional parameter that is a one-dimensional array where information on the editor will be recorded, as follows:
|
Info |
Information |
|
0 |
Current line number |
|
1 |
Current column number |
|
2 |
Total number of lines in editor |
|
3 |
Number of lines in view mode |
|
4 |
Current block mode (1 – line mode, 2 – column mode) |
Comments: If this statement has the focus it will allow you to enter text into the editor. Initial text can be added to the editor by the use of AddEditorText. The text can be read out of the editor by using stream functions. The editor can be forced to do certain actions by the use of ForceEvent. The default key map is as follows:
|
Action |
Default Keys |
|
Cursor left |
Cursor left |
|
Cursor right |
Cursor right |
|
Cursor up |
Cursor up |
|
Cursor down |
Cursor down |
|
Enter |
Enter |
|
Delete the next character |
Del |
|
Delete the previous character |
Backspace |
|
Move to start of line |
Home |
|
Move up one page |
Page up |
|
Move down one page |
Page down |
|
Move to start of the editor |
Shift-Home |
|
Move to end of the editor |
Shift-End |
|
Move the selection block left one character |
Shift-Cursor-Left |
|
Move the selection block right one character |
Shift-Cursor-Right |
|
Move the selection block up one line |
Shift-Cursor-Up |
|
Move the selection block down one line |
Shift-Cursor-Down |
|
Cut the selection block to the clipboard |
Ctrl-Del or Ctrl-X |
|
Copy the selection block to the clipboard |
Ctrl-Ins or Ctrl-C |
|
Insert text from the clipboard |
Shift-Ins or Ctrl-V |
|
Toggle selection line, column mode |
Ctrl-B |
In the case of the optional Info parameter, the variable must be an array; however, it need not have all 5 elements – any information that is normally stored in an element beyond the upper limit of the array will be ignored.
Example:
myEditor = MakeEditor();
ZBox(10, 110, 210, 10, 1);
Editor(10, 110, 210, 10 { Outline of editor },
myEditor { Which editor to use },
3 { Focus ID },
Font("Courier" { Font name },
0, 12 { Character set, height in points },
0 { No rotation },
7 { Weight (somewhat bold) },
0, 1 { Not italicized, fixed pitch })
infoArray { Information on the editor });
These statements create an editor that is displayed in a 100 x 200 area of the window in the upper left corner; this and other information will be stored in the array infoArray, whose data will be updated every time that one of the elements' values changes. Notice that the editor has been outlined by a dark blue box, which although not required, makes the boundaries of the editor obvious to the user.
See Also:
AddEditorText | CurrentLine | ForceEvent | GoToOffset | MakeEditor | SetEditMode