Sfairadora

  • Reference Guide

Text Editor

The text editor is used to display and edit plain text with multiple lines (Text type).
The use of the text editor is explained in a separate chapter.

Display

Item
Description
Frame style
Appearance of the editor frame:
none
no frame
simple
simple line (usually black; the color depends on Windows settings).
deep
three-dimensional frame that appears sunken (the standard appearance of a field for editing in Windows).
auto
the frame depends on the editor location.
Borders
The spaces left between the frame and the editor content. Values for all directions can be specified individually. If no value is specified, borders are determined automatically according to the editor location.
Minimum width
The minimum width of the displayed editor. The unit of measurement is the average character width of the font type used in the editor.
The editor may always be wider if the longest line exceeds this width.

Functionality

Item
Description
Object name
Name of the object where the edited data is located. You can select one of the objects provided by parent dispels.
Data reference
Reference to a data item within the above identified object.
The identified data must be scalar, or else the editor displays an error. The text editor may in principle edit non-scalar data as well, but this is usually impractical. Moreover, there is a danger that the text representation of the data will be too long, and data display will take and inadequate amount of time. If you need to edit non-scalar data, you must specify a getter function as described below, e.g. as [Text][String]val (that is, as an explicit type conversion of the value into text).
Other
Data type
The data type to be saved by the editor into the respective data item. Usually, it need not be specified – it is determined automatically from the actual type of the edited data item. However, if the type of the edited data item is Union, it may be necessary to specify the value type to be saved by the editor.
Getter function
This function is used to convert edited data to text that is to be displayed in the editor and edited. If no function is present, standard type conversion is used.
The function is specified in the Enki language.
Function parameters:
val
the value to be edited. Its type corresponds to the edited data item type. If data is absent, NONE value is passed.
Result type: Text.
Setter function
This function is used to convert the edited text to a value that is to be saved into the edited data item. If no function is present, standard type conversion is used.
The function is specified in the Enki language.
Function parameters:
val
value of the Text type – content of the text editor that is to be saved.
Result: the value that will be saved into the data item. If the result type fails to match the type of the data item in which it should be stored, a type conversion is performed. If the function returns the NONE or NOT_PRESENT constant, and the edited data item is optional, its value is removed. If the function returns the Error type, the error message contained in the error is displayed. The editing does not end until the user corrects the error. This feature can be used to test the validity of the entered value.
Enki language editor
This option allows you to specify that the edited text is an Enki language source text. This information is used to update the Insert menu so that it contains Enki language constructs to enable their easy use in the text.
Tab switches to next dispel
If checked, the Tab key switches to the next dispel. If not, a tab character is inserted into the text.
Editor can be abandoned in horizontal direction
If checked, and the cursor is at the right border of the text, pressing the → key switches activity to the nearest dispel on the right (and analogically if the cursor is at the left end).
If unchecked, the cursor stops at the editor border.
Write immediately
If checked, the text is saved into the underlying data item upon every modification. If not, it is saved only when editing ends. You can enforce saving the text by pressing Shift+Enter.
If the text is being saved on a continuous basis, and an error occurs during saving (e.g. a setter function error), the text is not saved, but the error message is not displayed until the user attempts to end the editing.
Immediate edit
If checked, the editor immediately switches into the editing mode when activated (the cursor appears in the text). If unchecked, the user must press, for example, the Enter key to start editing.
Disable closing volatile window
If the editor is in a menu window or in another volatile window, and the option is checked, the window is not closed when editing ends (normally, it is closed).
Definition type: Text_editor_def