Sfairadora

  • Reference Guide

Rich Text Editor

The rich text editor is used to display and edit formatted text with multiple lines (Rich_text type).
The use of the rich 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.
Ruler placement
Determines the ruler location:
hidden
the ruler is not displayed.
by editor
the ruler is always displayed by the top of the editor. If the text is long so that the top of the editor is beyond the window edge, the ruler is not displayed.
by window edge
the ruler is always displayed by the upper edge of the window regardless of whether there are other dispels above the editor – they are placed between the ruler and the editor. This option is appropriate if there is a single rich text editor in the window.
always visible
combination of the by editor and by window edge options – if the top of the editor fits into the window, the ruler is there. As soon as the top of the editor moves beyond the window border, the ruler is displayed by the upper edge of the window so that it always remains visible. (Default setting.)
Ruler only when edited
If checked, the ruler is displayed only when the editor content is being edited.
Show page breaks
If checked, the editor determines page break positions and displays them as a gray horizontal dashed lines.

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 rich 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 [Rich_text]val (that is, as an explicit type conversion of the value into formatted text).
Other
Data type
The data type that should 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 into 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: Rich_text.
Setter function
This function is used to convert the edited text into 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 Rich_text type – content of the rich text editor that should 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 is to 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, an 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.
Enkidu language editor
This option allows you to specify that the edited text is an Enkidu language source text. This information is used to update the Insert menu so that it contains Enkidu language constructs to enable their easy use in the text.
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 of 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, and 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.
Definition type: Rich_text_editor_def