Next: Data type validation for fields, Previous: Making or breaking connections between forms and fields, Up: The curses form library [Contents][Index]
The procedure set-field-fore!
sets the attributes of the contents
of a field, and set-field-back!
set the attributes of the unused
portion of a field.
They return the constants E_OK
on success, E_BAD_ARGUMENT
,
or E_SYSTEM_ERROR
.
The procedure field-fore
returns the attributes of the contents
of a field, and field-back
returns the attributes of the unused
portion of a field.
The procedure set-field-pad!
sets the character used as blank in
the field to the codepoint pad
.
They return the constants E_OK
on success, E_BAD_ARGUMENT
,
or E_SYSTEM_ERROR
.
The procedure field-pad
returns the codepoint used as the blank
in field
.
There are functions to set and get the text in a field, as well as to check if that field has been modified.
The function set-field-buffer!
sets the numbered buffer of the
given field to contain a given string. Buffer 0 is the displayed
value of the field; other numbered buffers may be allocated by
applications through the nbuf argument of new-field
but are not manipulated by the forms library.
Returns a string that is the contents of the field.
buffer zero is the visible buffer on the screen. A field may
have other buffers if so allocated when the field was created using
new-field
.
The returns the field status of field. The field status is set to a non-zero value whenever the field changes.
Sets the field status of field to status, a boolean.
This procedure sets the maximum size for a dynamic field. An argument of zero turns off any maximum size threshold for that field.
The procedure returns a six-element list of information about the field. The elements of the list are: height, width, row of upper-left corner, column of upper-left corner, number of off-screen rows, and number of working buffers. This information was stored when the field was created, and rows and columns may not be accurate.
This procedure returns of the actual size of the field and its maximum size as a list. The elements of the list are: rows, column, and max size.
This procedure sets the justification attribute of a field to one of
NO_JUSTIFICATION
, JUSTIFY_RIGHT
, JUSTIFY_LEFT
, or
JUSTIFY_CENTER
.
This procedure returns the justification attribute of field. It
is one of NO_JUSTIFICATION
, JUSTIFY_RIGHT
,
JUSTIFY_LEFT
, or JUSTIFY_CENTER
.
The function new-field
allocates a new field and initializes it
from the parameters given: height, width, row of upper-left corner,
column of upper-left corner, number off-screen rows, and number of
additional working buffers.
The function dup-field duplicates a field at a new location. Most attributes (including current contents, size, validation type, buffer count, growth threshold, justification, foreground, background, pad character, options, and user pointer) are copied. Field status and the field page bit are not copied.
This explicitly releases the buffer in field, instead of waiting for the garbage collector to take care of it.
The function set-field-opts!
sets all the given field’s option
bits (field option bits may be logically-OR’ed together).
The function field-opts-on!
turns on the given option bits, and
leaves others alone.
The function field-opts-off!
turns off the given option bits, and leaves
others alone.
The function field-opts
returns the field’s current option
bits.
The following options are defined. All are on by default
O_VISIBLE
The field is displayed. If this option is off, display of the field is suppressed.
O_ACTIVE
The field is visited during processing. If this option is off, the field will not be reachable by navigation keys. Please notice that an invisible field appears to be inactive also.
O_PUBLIC
The field contents are displayed as data is entered.
O_EDIT
The field can be edited.
O_WRAP
Words that do not fit on a line are wrapped to the next line. Words are blank-separated.
O_BLANK
The field is cleared whenever a character is entered at the first position.
O_AUTOSKIP
Skip to the next field when this one fills.
O_NULLOK
Allow a blank field.
O_STATIC
Field buffers are fixed to field’s original size. Turn this option off to create a dynamic field.
O_PASSOK
Validate field only if modified by user.