]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/form.3x
ncurses 6.4 - patch 20240420
[ncurses.git] / man / form.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2023,2024 Thomas E. Dickey                                *
4 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
5 .\"                                                                          *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
7 .\" copy of this software and associated documentation files (the            *
8 .\" "Software"), to deal in the Software without restriction, including      *
9 .\" without limitation the rights to use, copy, modify, merge, publish,      *
10 .\" distribute, distribute with modifications, sublicense, and/or sell       *
11 .\" copies of the Software, and to permit persons to whom the Software is    *
12 .\" furnished to do so, subject to the following conditions:                 *
13 .\"                                                                          *
14 .\" The above copyright notice and this permission notice shall be included  *
15 .\" in all copies or substantial portions of the Software.                   *
16 .\"                                                                          *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24 .\"                                                                          *
25 .\" Except as contained in this notice, the name(s) of the above copyright   *
26 .\" holders shall not be used in advertising or otherwise to promote the     *
27 .\" sale, use or other dealings in this Software without prior written       *
28 .\" authorization.                                                           *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: form.3x,v 1.54 2024/03/16 15:35:01 tom Exp $
32 .TH form 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el   .ds `` ""
40 .ie t .ds '' ''
41 .el   .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n  .IP \(bu 4
46 .el    .IP \(bu 2
47 ..
48 .SH NAME
49 \fBform\fP \-
50 curses extension for programming forms
51 .SH SYNOPSIS
52 .nf
53 \fB#include <form.h>
54 .fi
55 .SH DESCRIPTION
56 The \fBform\fP library provides terminal-independent facilities for composing
57 form screens on character-cell terminals.
58 The library includes: field
59 routines, which create and modify form fields; and form routines, which group
60 fields into forms, display forms on the screen, and handle interaction with the
61 user.
62 .PP
63 The \fBform\fP library uses the \fBcurses\fP libraries.
64 To use the \fBform\fP library, link with the options
65 \fB\-lform \-lcurses\fP.
66 .PP
67 Your program should set up the locale, e.g.,
68 .sp
69      \fBsetlocale(LC_ALL, "");\fP
70 .sp
71 so that input/output processing will work.
72 .PP
73 A curses initialization routine such as \fBinitscr\fP must be called
74 before using any of these functions.
75 .
76 .SS "Current Default Values for Field Attributes"
77 .
78 The \fBform\fP library maintains a default value for field attributes.
79 You
80 can get or set this default by calling the appropriate \fBset_\fP
81 or retrieval
82 routine with a \fBNULL\fP field pointer.
83 Changing this default with a
84 \fBset_\fP function affects future field creations, but does not change the
85 rendering of fields already created.
86 .
87 .SS "Routine Name Index"
88 .
89 The following table lists each \fBform\fP routine and the name of
90 the manual page on which it is described.
91 Routines flagged with \*(``*\*(''
92 are \fI\%ncurses\fP-specific, not present in SVr4.
93 .PP
94 .TS
95 l l
96 l l .
97 \fBcurses\fP Routine Name       Manual Page Name
98 =
99 current_field   \fBform_page\fP(3X)
100 data_ahead      \fBform_data\fP(3X)
101 data_behind     \fBform_data\fP(3X)
102 dup_field       \fBform_field_new\fP(3X)
103 dynamic_field_info      \fBform_field_info\fP(3X)
104 field_arg       \fBform_field_validation\fP(3X)
105 field_back      \fBform_field_attributes\fP(3X)
106 field_buffer    \fBform_field_buffer\fP(3X)
107 field_count     \fBform_field\fP(3X)
108 field_fore      \fBform_field_attributes\fP(3X)
109 field_index     \fBform_page\fP(3X)
110 field_info      \fBform_field_info\fP(3X)
111 field_init      \fBform_hook\fP(3X)
112 field_just      \fBform_field_just\fP(3X)
113 field_opts      \fBform_field_opts\fP(3X)
114 field_opts_off  \fBform_field_opts\fP(3X)
115 field_opts_on   \fBform_field_opts\fP(3X)
116 field_pad       \fBform_field_attributes\fP(3X)
117 field_status    \fBform_field_buffer\fP(3X)
118 field_term      \fBform_hook\fP(3X)
119 field_type      \fBform_field_validation\fP(3X)
120 field_userptr   \fBform_field_userptr\fP(3X)
121 form_driver     \fBform_driver\fP(3X)
122 form_driver_w   \fBform_driver\fP(3X)*
123 form_fields     \fBform_field\fP(3X)
124 form_init       \fBform_hook\fP(3X)
125 form_opts       \fBform_opts\fP(3X)
126 form_opts_off   \fBform_opts\fP(3X)
127 form_opts_on    \fBform_opts\fP(3X)
128 form_page       \fBform_page\fP(3X)
129 form_request_by_name    \fBform_requestname\fP(3X)*
130 form_request_name       \fBform_requestname\fP(3X)*
131 form_sub        \fBform_win\fP(3X)
132 form_term       \fBform_hook\fP(3X)
133 form_userptr    \fBform_userptr\fP(3X)
134 form_win        \fBform_win\fP(3X)
135 free_field      \fBform_field_new\fP(3X)
136 free_fieldtype  \fBform_fieldtype\fP(3X)
137 free_form       \fBform_new\fP(3X)
138 link_field      \fBform_field_new\fP(3X)
139 link_fieldtype  \fBform_fieldtype\fP(3X)
140 move_field      \fBform_field\fP(3X)
141 new_field       \fBform_field_new\fP(3X)
142 new_fieldtype   \fBform_fieldtype\fP(3X)
143 new_form        \fBform_new\fP(3X)
144 new_page        \fBform_new_page\fP(3X)
145 pos_form_cursor \fBform_cursor\fP(3X)
146 post_form       \fBform_post\fP(3X)
147 scale_form      \fBform_win\fP(3X)
148 set_current_field       \fBform_page\fP(3X)
149 set_field_back  \fBform_field_attributes\fP(3X)
150 set_field_buffer        \fBform_field_buffer\fP(3X)
151 set_field_fore  \fBform_field_attributes\fP(3X)
152 set_field_init  \fBform_hook\fP(3X)
153 set_field_just  \fBform_field_just\fP(3X)
154 set_field_opts  \fBform_field_opts\fP(3X)
155 set_field_pad   \fBform_field_attributes\fP(3X)
156 set_field_status        \fBform_field_buffer\fP(3X)
157 set_field_term  \fBform_hook\fP(3X)
158 set_field_type  \fBform_field_validation\fP(3X)
159 set_field_userptr       \fBform_field_userptr\fP(3X)
160 set_fieldtype_arg       \fBform_fieldtype\fP(3X)
161 set_fieldtype_choice    \fBform_fieldtype\fP(3X)
162 set_form_fields \fBform_field\fP(3X)
163 set_form_init   \fBform_hook\fP(3X)
164 set_form_opts   \fBform_field_opts\fP(3X)
165 set_form_page   \fBform_page\fP(3X)
166 set_form_sub    \fBform_win\fP(3X)
167 set_form_term   \fBform_hook\fP(3X)
168 set_form_userptr        \fBform_userptr\fP(3X)
169 set_form_win    \fBform_win\fP(3X)
170 set_max_field   \fBform_field_buffer\fP(3X)
171 set_new_page    \fBform_new_page\fP(3X)
172 unfocus_current_field   \fBform_page\fP(3X)*
173 unpost_form     \fBform_post\fP(3X)
174 .TE
175 .SH RETURN VALUE
176 Routines that return pointers return \fBNULL\fP on error,
177 and set \fBerrno\fP to the corresponding error-code returned by functions
178 returning an integer.
179 Routines that return
180 an integer return one of the following error codes:
181 .TP 5
182 .B E_OK
183 The routine succeeded.
184 .TP 5
185 .B E_BAD_ARGUMENT
186 Routine detected an incorrect or out-of-range argument.
187 .TP 5
188 .B E_BAD_STATE
189 Routine was called from an initialization or termination function.
190 .TP 5
191 .B E_CONNECTED
192 The field is already connected to a form.
193 .TP 5
194 .B E_INVALID_FIELD
195 Contents of a field are not valid.
196 .TP 5
197 .B E_NOT_CONNECTED
198 No fields are connected to the form.
199 .TP 5
200 .B E_NOT_POSTED
201 The form has not been posted.
202 .TP 5
203 .B E_NO_ROOM
204 Form is too large for its window.
205 .TP 5
206 .B E_POSTED
207 The form is already posted.
208 .TP 5
209 .B E_REQUEST_DENIED
210 The form driver could not process the request.
211 .TP 5
212 .B E_SYSTEM_ERROR
213 System error occurred (see \fBerrno\fP(3)).
214 .TP 5
215 .B E_UNKNOWN_COMMAND
216 The form driver code saw an unknown request code.
217 .SH NOTES
218 The header file \fI\%form.h\fP itself includes \fI\%curses.h\fP.
219 .SH PORTABILITY
220 These routines emulate the System V forms library.
221 They were not supported on
222 Version 7 or BSD versions.
223 .PP
224 A form facility was documented in SVr4.2's
225 \fICharacter User Interface Programming\fP document.
226 .PP
227 It is not part of X/Open Curses.
228 .PP
229 Aside from \fI\%ncurses\fP, there are few implementations:
230 .bP
231 systems based on SVr4 source code, e.g., Solaris.
232 .bP
233 NetBSD curses.
234 .PP
235 A few functions in this implementation are extensions added for
236 \fI\%ncurses\fP,
237 but not provided by other implementations, e.g.,
238 \fBform_driver_w\fP,
239 \fBunfocus_current_field\fP.
240 .SH AUTHORS
241 Juergen Pfeifer.
242 Manual pages and adaptation for \fI\%ncurses\fP by Eric
243 S. Raymond.
244 .SH SEE ALSO
245 \fBcurses\fP(3X) and related pages whose names begin \*(``form_\*('' for
246 detailed descriptions of the entry points.