2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a *
6 .\" copy of this software and associated documentation files (the *
7 .\" "Software"), to deal in the Software without restriction, including *
8 .\" without limitation the rights to use, copy, modify, merge, publish, *
9 .\" distribute, distribute with modifications, sublicense, and/or sell *
10 .\" copies of the Software, and to permit persons to whom the Software is *
11 .\" furnished to do so, subject to the following conditions: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" Except as contained in this notice, the name(s) of the above copyright *
25 .\" holders shall not be used in advertising or otherwise to promote the *
26 .\" sale, use or other dealings in this Software without prior written *
28 .\"***************************************************************************
30 .\" $Id: form.3x,v 1.24 2010/12/04 18:40:45 tom Exp $
33 \fBform\fR \- curses extension for programming forms
35 \fB#include <form.h>\fR
38 The \fBform\fR library provides terminal-independent facilities for composing
39 form screens on character-cell terminals. The library includes: field
40 routines, which create and modify form fields; and form routines, which group
41 fields into forms, display forms on the screen, and handle interaction with the
44 The \fBform\fR library uses the \fBcurses\fR libraries.
45 To use the \fBform\fR library, link with the options
46 \fB\-lform \-lcurses\fR.
48 Your program should set up the locale, e.g.,
50 \fBsetlocale(LC_ALL, "");\fP
52 so that input/output processing will work.
54 A curses initialization routine such as \fBinitscr\fR must be called
55 before using any of these functions.
57 .SS Current Default Values for Field Attributes
59 The \fBform\fR library maintains a default value for field attributes. You
60 can get or set this default by calling the appropriate \fBset_\fR
62 routine with a \fBNULL\fR field pointer. Changing this default with a
63 \fBset_\fR function affects future field creations, but does not change the
64 rendering of fields already created.
66 .SS Routine Name Index
68 The following table lists each \fBform\fR routine and the name of
69 the manual page on which it is described.
74 \fBcurses\fR Routine Name Manual Page Name
76 current_field \fBform_page\fR(3)
77 data_ahead \fBform_data\fR(3)
78 data_behind \fBform_data\fR(3)
79 dup_field \fBform_field_new\fR(3)
80 dynamic_field_info \fBform_field_info\fR(3)
81 field_arg \fBform_field_validation\fR(3)
82 field_back \fBform_field_attributes\fR(3)
83 field_buffer \fBform_field_buffer\fR(3)
84 field_count \fBform_field\fR(3)
85 field_fore \fBform_field_attributes\fR(3)
86 field_index \fBform_page\fR(3)
87 field_info \fBform_field_info\fR(3)
88 field_init \fBform_hook\fR(3)
89 field_just \fBform_field_just\fR(3)
90 field_opts \fBform_field_opts\fR(3)
91 field_opts_off \fBform_field_opts\fR(3)
92 field_opts_on \fBform_field_opts\fR(3)
93 field_pad \fBform_field_attributes\fR(3)
94 field_status \fBform_field_buffer\fR(3)
95 field_term \fBform_hook\fR(3)
96 field_type \fBform_field_validation\fR(3)
97 field_userptr \fBform_field_userptr\fR(3)
98 form_driver \fBform_driver\fR(3)
99 form_fields \fBform_field\fR(3)
100 form_init \fBform_hook\fR(3)
101 form_opts \fBform_opts\fR(3)
102 form_opts_off \fBform_opts\fR(3)
103 form_opts_on \fBform_opts\fR(3)
104 form_page \fBform_page\fR(3)
105 form_request_by_name \fBform_requestname\fR(3)
106 form_request_name \fBform_requestname\fR(3)
107 form_sub \fBform_win\fR(3)
108 form_term \fBform_hook\fR(3)
109 form_userptr \fBform_userptr\fR(3)
110 form_win \fBform_win\fR(3)
111 free_field \fBform_field_new\fR(3)
112 free_fieldtype \fBform_fieldtype\fR(3)
113 free_form \fBform_new\fR(3)
114 link_field \fBform_field_new\fR(3)
115 link_fieldtype \fBform_fieldtype\fR(3)
116 move_field \fBform_field\fR(3)
117 new_field \fBform_field_new\fR(3)
118 new_fieldtype \fBform_fieldtype\fR(3)
119 new_form \fBform_new\fR(3)
120 new_page \fBform_new_page\fR(3)
121 pos_form_cursor \fBform_cursor\fR(3)
122 post_form \fBform_post\fR(3)
123 scale_form \fBform_win\fR(3)
124 set_current_field \fBform_page\fR(3)
125 set_field_back \fBform_field_attributes\fR(3)
126 set_field_buffer \fBform_field_buffer\fR(3)
127 set_field_fore \fBform_field_attributes\fR(3)
128 set_field_init \fBform_hook\fR(3)
129 set_field_just \fBform_field_just\fR(3)
130 set_field_opts \fBform_field_opts\fR(3)
131 set_field_pad \fBform_field_attributes\fR(3)
132 set_field_status \fBform_field_buffer\fR(3)
133 set_field_term \fBform_hook\fR(3)
134 set_field_type \fBform_field_validation\fR(3)
135 set_field_userptr \fBform_field_userptr\fR(3)
136 set_fieldtype_arg \fBform_fieldtype\fR(3)
137 set_fieldtype_choice \fBform_fieldtype\fR(3)
138 set_form_fields \fBform_field\fR(3)
139 set_form_init \fBform_hook\fR(3)
140 set_form_opts \fBform_field_opts\fR(3)
141 set_form_page \fBform_page\fR(3)
142 set_form_sub \fBform_win\fR(3)
143 set_form_term \fBform_hook\fR(3)
144 set_form_userptr \fBform_userptr\fR(3)
145 set_form_win \fBform_win\fR(3)
146 set_max_field \fBform_field_buffer\fR(3)
147 set_new_page \fBform_new_page\fR(3)
148 unpost_form \fBform_post\fR(3)
151 Routines that return pointers return \fBNULL\fR on error,
152 and set errno to the corresponding error-code returned by functions
153 returning an integer.
155 an integer return one of the following error codes:
158 The routine succeeded.
161 Routine detected an incorrect or out-of-range argument.
164 Routine was called from an initialization or termination function.
167 The field is already connected to a form.
170 Contents of a field are not valid.
173 No fields are connected to the form.
176 The form has not been posted.
179 Form is too large for its window.
182 The form is already posted.
185 The form driver could not process the request.
188 System error occurred (see \fBerrno\fR).
191 The form driver code saw an unknown request code.
193 \fBcurses\fR(3) and related pages whose names begin "form_" for detailed
194 descriptions of the entry points.
196 The header file \fB<form.h>\fR automatically includes the header files
197 \fB<curses.h>\fR and \fB<eti.h>\fR.
199 In your library list, libform.a should be before libncurses.a; that is,
200 you want to say `\-lform \-lncurses', not the other way around (which would
201 give you a link error using most linkers).
203 These routines emulate the System V forms library. They were not supported on
204 Version 7 or BSD versions.
206 Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric
209 This describes \fBncurses\fR
210 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).