]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/form.3x
ncurses 6.1 - patch 20190720
[ncurses.git] / man / form.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.              *
4 .\"                                                                          *
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:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
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.                               *
23 .\"                                                                          *
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       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: form.3x,v 1.32 2019/01/20 20:31:42 tom Exp $
31 .TH form 3X ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de bP
37 .ie n  .IP \(bu 4
38 .el    .IP \(bu 2
39 ..
40 .SH NAME
41 \fBform\fR \- curses extension for programming forms
42 .SH SYNOPSIS
43 \fB#include <form.h>\fR
44 .br
45 .SH DESCRIPTION
46 The \fBform\fR library provides terminal-independent facilities for composing
47 form screens on character-cell terminals.
48 The library includes: field
49 routines, which create and modify form fields; and form routines, which group
50 fields into forms, display forms on the screen, and handle interaction with the
51 user.
52 .PP
53 The \fBform\fR library uses the \fBcurses\fR libraries.
54 To use the \fBform\fR library, link with the options
55 \fB\-lform \-lcurses\fR.
56 .PP
57 Your program should set up the locale, e.g.,
58 .sp
59      \fBsetlocale(LC_ALL, "");\fP
60 .sp
61 so that input/output processing will work.
62 .PP
63 A curses initialization routine such as \fBinitscr\fR must be called
64 before using any of these functions.
65 .
66 .SS Current Default Values for Field Attributes
67 .
68 The \fBform\fR library maintains a default value for field attributes.
69 You
70 can get or set this default by calling the appropriate \fBset_\fR
71 or retrieval
72 routine with a \fBNULL\fR field pointer.
73 Changing this default with a
74 \fBset_\fR function affects future field creations, but does not change the
75 rendering of fields already created.
76 .
77 .SS Routine Name Index
78 .
79 The following table lists each \fBform\fR routine and the name of
80 the manual page on which it is described.
81 .
82 .TS
83 l l
84 l l .
85 \fBcurses\fR Routine Name       Manual Page Name
86 =
87 current_field   \fBform_page\fR(3X)
88 data_ahead      \fBform_data\fR(3X)
89 data_behind     \fBform_data\fR(3X)
90 dup_field       \fBform_field_new\fR(3X)
91 dynamic_field_info      \fBform_field_info\fR(3X)
92 field_arg       \fBform_field_validation\fR(3X)
93 field_back      \fBform_field_attributes\fR(3X)
94 field_buffer    \fBform_field_buffer\fR(3X)
95 field_count     \fBform_field\fR(3X)
96 field_fore      \fBform_field_attributes\fR(3X)
97 field_index     \fBform_page\fR(3X)
98 field_info      \fBform_field_info\fR(3X)
99 field_init      \fBform_hook\fR(3X)
100 field_just      \fBform_field_just\fR(3X)
101 field_opts      \fBform_field_opts\fR(3X)
102 field_opts_off  \fBform_field_opts\fR(3X)
103 field_opts_on   \fBform_field_opts\fR(3X)
104 field_pad       \fBform_field_attributes\fR(3X)
105 field_status    \fBform_field_buffer\fR(3X)
106 field_term      \fBform_hook\fR(3X)
107 field_type      \fBform_field_validation\fR(3X)
108 field_userptr   \fBform_field_userptr\fR(3X)
109 form_driver     \fBform_driver\fR(3X)
110 form_driver_w   \fBform_driver\fR(3X)*
111 form_fields     \fBform_field\fR(3X)
112 form_init       \fBform_hook\fR(3X)
113 form_opts       \fBform_opts\fR(3X)
114 form_opts_off   \fBform_opts\fR(3X)
115 form_opts_on    \fBform_opts\fR(3X)
116 form_page       \fBform_page\fR(3X)
117 form_request_by_name    \fBform_requestname\fR(3X)
118 form_request_name       \fBform_requestname\fR(3X)
119 form_sub        \fBform_win\fR(3X)
120 form_term       \fBform_hook\fR(3X)
121 form_userptr    \fBform_userptr\fR(3X)
122 form_win        \fBform_win\fR(3X)
123 free_field      \fBform_field_new\fR(3X)
124 free_fieldtype  \fBform_fieldtype\fR(3X)
125 free_form       \fBform_new\fR(3X)
126 link_field      \fBform_field_new\fR(3X)
127 link_fieldtype  \fBform_fieldtype\fR(3X)
128 move_field      \fBform_field\fR(3X)
129 new_field       \fBform_field_new\fR(3X)
130 new_fieldtype   \fBform_fieldtype\fR(3X)
131 new_form        \fBform_new\fR(3X)
132 new_page        \fBform_new_page\fR(3X)
133 pos_form_cursor \fBform_cursor\fR(3X)
134 post_form       \fBform_post\fR(3X)
135 scale_form      \fBform_win\fR(3X)
136 set_current_field       \fBform_page\fR(3X)
137 set_field_back  \fBform_field_attributes\fR(3X)
138 set_field_buffer        \fBform_field_buffer\fR(3X)
139 set_field_fore  \fBform_field_attributes\fR(3X)
140 set_field_init  \fBform_hook\fR(3X)
141 set_field_just  \fBform_field_just\fR(3X)
142 set_field_opts  \fBform_field_opts\fR(3X)
143 set_field_pad   \fBform_field_attributes\fR(3X)
144 set_field_status        \fBform_field_buffer\fR(3X)
145 set_field_term  \fBform_hook\fR(3X)
146 set_field_type  \fBform_field_validation\fR(3X)
147 set_field_userptr       \fBform_field_userptr\fR(3X)
148 set_fieldtype_arg       \fBform_fieldtype\fR(3X)
149 set_fieldtype_choice    \fBform_fieldtype\fR(3X)
150 set_form_fields \fBform_field\fR(3X)
151 set_form_init   \fBform_hook\fR(3X)
152 set_form_opts   \fBform_field_opts\fR(3X)
153 set_form_page   \fBform_page\fR(3X)
154 set_form_sub    \fBform_win\fR(3X)
155 set_form_term   \fBform_hook\fR(3X)
156 set_form_userptr        \fBform_userptr\fR(3X)
157 set_form_win    \fBform_win\fR(3X)
158 set_max_field   \fBform_field_buffer\fR(3X)
159 set_new_page    \fBform_new_page\fR(3X)
160 unfocus_current_field   \fBform_page\fR(3X)
161 unpost_form     \fBform_post\fR(3X)
162 .TE
163 .SH RETURN VALUE
164 Routines that return pointers return \fBNULL\fR on error,
165 and set errno to the corresponding error-code returned by functions
166 returning an integer.
167 Routines that return
168 an integer return one of the following error codes:
169 .TP 5
170 .B E_OK
171 The routine succeeded.
172 .TP 5
173 .B E_BAD_ARGUMENT
174 Routine detected an incorrect or out-of-range argument.
175 .TP 5
176 .B E_BAD_STATE
177 Routine was called from an initialization or termination function.
178 .TP 5
179 .B E_CONNECTED
180 The field is already connected to a form.
181 .TP 5
182 .B E_INVALID_FIELD
183 Contents of a field are not valid.
184 .TP 5
185 .B E_NOT_CONNECTED
186 No fields are connected to the form.
187 .TP 5
188 .B E_NOT_POSTED
189 The form has not been posted.
190 .TP 5
191 .B E_NO_ROOM
192 Form is too large for its window.
193 .TP 5
194 .B E_POSTED
195 The form is already posted.
196 .TP 5
197 .B E_REQUEST_DENIED
198 The form driver could not process the request.
199 .TP 5
200 .B E_SYSTEM_ERROR
201 System error occurred (see \fBerrno\fR(3)).
202 .TP 5
203 .B E_UNKNOWN_COMMAND
204 The form driver code saw an unknown request code.
205 .SH NOTES
206 The header file \fB<form.h>\fR automatically includes the header files
207 \fB<curses.h>\fR and \fB<eti.h>\fR.
208 .PP
209 In your library list, libform.a should be before libncurses.a; that is,
210 you want to say \*(``\-lform \-lncurses\*('', not the other way around
211 (which would give you a link error when using static libraries).
212 .SH PORTABILITY
213 These routines emulate the System V forms library.
214 They were not supported on
215 Version 7 or BSD versions.
216 .PP
217 The menu facility was documented in SVr4.2 in
218 \fICharacter User Interface Programming (UNIX SVR4.2)\fP.
219 .PP
220 It is not part of X/Open Curses.
221 .PP
222 Aside from ncurses, there are few implementations:
223 .bP
224 systems based on SVr4 source code, e.g., Solaris.
225 .bP
226 NetBSD curses.
227 .PP
228 A few functions in this implementation are extensions added for ncurses,
229 but not provided by other implementations, e.g.,
230 \fBform_driver_w\fP,
231 \fBunfocus_current_field\fP.
232 .SH AUTHORS
233 Juergen Pfeifer.
234 Manual pages and adaptation for ncurses by Eric
235 S. Raymond.
236 .SH SEE ALSO
237 \fBcurses\fR(3X) and related pages whose names begin "form_" for detailed
238 descriptions of the entry points.
239 .PP
240 This describes \fBncurses\fR
241 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).