|
|
ETI provides form options regulating how specific user requests are handled. These functions enable you to set the options and read their settings.
SYNOPSIS
int set_form_opts (form, opts) FORM form; OPTIONS opts;Note that function set_form_opts automatically turns off all form options not referenced in its second argument. By default, all options are on.OPTIONS form_opts (form) FORM form;
options: O_NL_OVERLOAD O_BS_OVERLOAD
The effects of the options are as follows:
In insert mode, the REQ_NEW_LINE request first inserts a new line after the current line. It then moves the text on the current line starting at the cursor position to the beginning of the new line. The cursor is repositioned to the beginning of the new line.
In overlay mode, the REQ_NEW_LINE request erases all data from the cursor position to the end of the line. It then repositions the cursor at the beginning of the next line.
If the field option O_STATIC if off and there is no maximum growth specified for the field, the overloaded form driver request REQ_NEW_LINE will operate the same way regardless of the setting of the O_NL_OVERLOAD form option. If a field can grow without bound, there is no last line, so REQ_NEW_LINE will never implicitly generate a REQ_NEXT_FIELD. If a maximum growth limit is specified and the O_NL_OVERLOAD form option is on, REQ_NEW_LINE will only implicitly generate REQ_NEXT_FIELD if the field has grown to its maximum size and the user is on the last line.
In insert mode, if the cursor is at the beginning of any line except the first and the text on the line will fit at the end of the previous line, the text is appended to the previous line and the current line is deleted. If not, the REQ_DEL_PREV request simply deletes the previous character, if there is one. If the cursor is at the first character of the field, the form driver simply returns E_REQUEST_DENIED.
In overlay mode, the REQ_DEL_PREV request simply deletes the previous character, if there is one.
FORM * f0, * f1;ETI provides two more functions to turn options on and off.set_form_opts (f0, form_opts (f0) & ~O_NL_OVERLOAD); /* turn option off */ set_form_opts (f1, form_opts (f1) | O_NL_OVERLOAD); /* turn option on */
SYNOPSIS
int form_opts_on (form, opts) FORM form; OPTIONS opts;Unlike function set_form_opts, these functions do not affect options unreferenced in their second argument.int form_opts_off (form, opts) FORM form; OPTIONS opts;
Another way to turn off option O_NL_OVERLOAD on form f0 and turn it on on form f1 is to write
FORM * f0, * f1;If functions set_form_opts, form_opts_off, or form_opts_on encounter an error, they return the following:form_opts_off (f0, O_NL_OVERLOAD); /* turn option off */ form_opts_on (f1, O_NL_OVERLOAD); /* turn option on */
form_opts_off( (FORM *) 0, O_NL_OVERLOAD);