130 lines
4.2 KiB
Groff
130 lines
4.2 KiB
Groff
.\" $NetBSD: form_field_opts.3,v 1.8 2003/04/16 13:35:04 wiz Exp $
|
|
.\"
|
|
.\" Copyright (c) 2001
|
|
.\" Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au
|
|
.\"
|
|
.\" This code is donated to The NetBSD Foundation by the author.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. The name of the Author may not be used to endorse or promote
|
|
.\" products derived from this software without specific prior written
|
|
.\" permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.Dd January 1, 2001
|
|
.Dt FORMS 3
|
|
.Os
|
|
.Sh NAME
|
|
.Nm field_opts ,
|
|
.Nm field_opts_off ,
|
|
.Nm field_opts_on ,
|
|
.Nm set_field_opts
|
|
.Nd form library
|
|
.Sh LIBRARY
|
|
.Lb libform
|
|
.Sh SYNOPSIS
|
|
.In form.h
|
|
.Ft Form_Options
|
|
.Fn field_opts "FIELD *field"
|
|
.Ft int
|
|
.Fn field_opts_off "FIELD *field" "Form_Options options"
|
|
.Ft int
|
|
.Fn field_opts_on "FIELD *field" "Form_Options options"
|
|
.Ft int
|
|
.Fn set_field_opts "FIELD *field" "Form_Options options"
|
|
.Sh DESCRIPTION
|
|
The function
|
|
.Fn field_opts
|
|
returns the current options settings for the given field.
|
|
The
|
|
.Fn field_opts_off
|
|
will turn the options given in
|
|
.Fa options
|
|
off for the given field, options not specified in
|
|
.Fa options
|
|
will remain unchanged.
|
|
Conversely, the function
|
|
.Fn field_opts_on
|
|
will turn on the options given in
|
|
.Fa options
|
|
for the specified field, again, any options not specified will remain
|
|
unchanged.
|
|
The options for a field may be set to a specific set of
|
|
options by calling the
|
|
.Fn set_field_opts
|
|
function.
|
|
Options may only be changed if the field given is not the
|
|
currently active one.
|
|
.Sh PARAMETERS
|
|
The following options are available for a field:
|
|
.Pp
|
|
.Bl -tag -width O_AUTOSKIP -compact
|
|
.It O_VISIBLE
|
|
The field is visible, hence is displayed when the form is posted.
|
|
.It O_ACTIVE
|
|
The field is active in the form, meaning that it can be visited during
|
|
form processing.
|
|
.It O_PUBLIC
|
|
The contents of the field are echoed to the screen.
|
|
.It O_EDIT
|
|
The contents of the field can be modified
|
|
.It O_WRAP
|
|
The contents of the field are wrapped on a word boundary, if this
|
|
option is off then the field will be wrapped on a character boundary.
|
|
.It O_BLANK
|
|
Blank the field on new data being entered if and only if the field
|
|
cursor is at the left hand side of the field.
|
|
.It O_AUTOSKIP
|
|
Skip to the next field when the current field reaches its maximum
|
|
size.
|
|
.It O_NULLOK
|
|
The field is allowed to contain no data
|
|
.It O_STATIC
|
|
The field is not dynamic, it has a fixed size.
|
|
.It O_PASSOK
|
|
An unmodified field is allowed.
|
|
.El
|
|
.Pp
|
|
The following options are on by default for a field: O_VISIBLE,
|
|
O_ACTIVE, O_PUBLIC, O_EDIT, O_WRAP, O_BLANK, O_AUTOSKIP, O_NULLOK,
|
|
O_PASSOK and O_STATIC.
|
|
.Sh RETURN VALUES
|
|
Functions returning pointers will return NULL if an error is detected.
|
|
The functions that return an int will return one of the following error
|
|
values:
|
|
.Pp
|
|
.Bl -tag -width E_UNKNOWN_COMMAND -compact
|
|
.It Er E_OK
|
|
The function was successful.
|
|
.It Er E_CURRENT
|
|
The field specified is the currently active one in the form.
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr curses 3 ,
|
|
.Xr forms 3
|
|
.Sh NOTES
|
|
The header
|
|
.Pa \*[Lt]form.h\*[Gt]
|
|
automatically includes both
|
|
.Pa \*[Lt]curses.h\*[Gt]
|
|
and
|
|
.Pa \*[Lt]eti.h\*[Gt] .
|