|
NAMEform_driver, form_driver_w - command-processing loop of the form systemSYNOPSIS#include <form.h>int form_driver(FORM *form, int c); int form_driver_w(FORM *form, int c, wchar_t wch); DESCRIPTIONform_driverOnce a form has been posted (displayed), you should funnel input events to it through form_driver. This routine has three major input cases:
form_driver_wThis extension simplifies the use of the forms library using wide characters. The input is either a key code (a request) or a wide character returned by get_wch(3X). The type must be passed as well, to enable the library to determine whether the parameter is a wide character or a request.Form-driver requestsThe form driver requests are as follows:
If the second argument is a printable character, the driver places it in the current position in the current field. If it is one of the forms requests listed above, that request is executed. Field validationThe form library makes updates to the window associated with form fields rather than directly to the field buffers.The form driver provides low-level control over updates to the form fields. The form driver also provides for validating modified fields to ensure that the contents meet whatever constraints an application may attach using set_field_type. You can validate a field without making any changes to it using REQ_VALIDATION. The form driver also validates a field in these cases:
In each case, the move fails if the field is invalid. If the modified field is valid, the form driver copies the modified data from the window associated with the field to the field buffer. Mouse handlingIf the second argument is the KEY_MOUSE special key, the associated mouse event is translated into one of the above pre-defined requests. Currently only clicks in the user window (e.g., inside the form display area or the decoration window) are handled.If you click above the display region of the form:
If you click below the display region of the form:
If you click at an field inside the display area of the form:
If you clicked outside the user window or the mouse event could not be translated into a form request an E_REQUEST_DENIED is returned. Application-defined commandsIf the second argument is neither printable nor one of the above pre-defined form requests, the driver assumes it is an application-specific command and returns E_UNKNOWN_COMMAND. Application-defined commands should be defined relative to MAX_COMMAND, the maximum value of these pre-defined requests.RETURN VALUEform_driver returns one of the following error codes:
SEE ALSOcurses(3X), form(3X), form_field_buffer(3X), form_field_validation(3X), form_fieldtype(3X), form_variables(3X), getch(3X).NOTESThe header file <form.h> automatically includes the header files <curses.h>.PORTABILITYThese routines emulate the System V forms library. They were not supported on Version 7 or BSD versions.AUTHORSJuergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. Visit the GSP FreeBSD Man Page Interface. |