]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/form_driver.3x.html
ncurses 5.9 - patch 20150214
[ncurses.git] / doc / html / man / form_driver.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2008,2010 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   * @Id: form_driver.3x,v 1.22 2010/12/04 18:38:55 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>form_driver 3x</TITLE>
37 <link rev=made href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1>form_driver 3x</H1>
42 <HR>
43 <PRE>
44 <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>                                         <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
45
46
47
48
49 </PRE>
50 <H2><a name="h2-NAME">NAME</a></H2><PRE>
51        <STRONG>form_driver</STRONG> - command-processing loop of the form system
52
53
54 </PRE>
55 <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
56        <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
57        int form_driver(FORM *form, int c);
58
59
60 </PRE>
61 <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
62        Once a form has been posted (displayed), you should funnel
63        input events to it through <STRONG>form_driver</STRONG>.  This routine  has
64        three major input cases:
65
66        <STRONG>o</STRONG>   The  input  is  a form navigation request.  Navigation
67            request codes are constants defined in <STRONG>&lt;form.h&gt;</STRONG>, which
68            are   distinct  from  the  key-  and  character  codes
69            returned by <STRONG>wgetch</STRONG>.
70
71        <STRONG>o</STRONG>   The input is a printable character.  Printable charac-
72            ters  (which  must  be  positive,  less  than 256) are
73            checked according to the program's locale settings.
74
75        <STRONG>o</STRONG>   The input is the KEY_MOUSE special key associated with
76            an mouse event.
77
78        The form driver requests are as follows:
79
80        REQ_NEXT_PAGE
81             Move to the next page.
82
83        REQ_PREV_PAGE
84             Move to the previous page.
85
86        REQ_FIRST_PAGE
87             Move to the first page.
88
89        REQ_LAST_PAGE
90             Move to the last field.
91
92
93        REQ_NEXT_FIELD
94             Move to the next field.
95
96        REQ_PREV_FIELD
97             Move to the previous field.
98
99        REQ_FIRST_FIELD
100             Move to the first field.
101
102        REQ_LAST_FIELD
103             Move to the last field.
104
105        REQ_SNEXT_FIELD
106             Move to the sorted next field.
107
108        REQ_SPREV_FIELD
109             Move to the sorted previous field.
110
111        REQ_SFIRST_FIELD
112             Move to the sorted first field.
113
114        REQ_SLAST_FIELD
115             Move to the sorted last field.
116
117        REQ_LEFT_FIELD
118             Move left to a field.
119
120        REQ_RIGHT_FIELD
121             Move right to a field.
122
123        REQ_UP_FIELD
124             Move up to a field.
125
126        REQ_DOWN_FIELD
127             Move down to a field.
128
129
130        REQ_NEXT_CHAR
131             Move to the next char.
132
133        REQ_PREV_CHAR
134             Move to the previous char.
135
136        REQ_NEXT_LINE
137             Move to the next line.
138
139        REQ_PREV_LINE
140             Move to the previous line.
141
142        REQ_NEXT_WORD
143             Move to the next word.
144
145        REQ_PREV_WORD
146             Move to the previous word.
147
148        REQ_BEG_FIELD
149             Move to the beginning of the field.
150
151        REQ_END_FIELD
152             Move to the end of the field.
153
154        REQ_BEG_LINE
155             Move to the beginning of the line.
156
157        REQ_END_LINE
158             Move to the end of the line.
159
160        REQ_LEFT_CHAR
161             Move left in the field.
162
163        REQ_RIGHT_CHAR
164             Move right in the field.
165
166        REQ_UP_CHAR
167             Move up in the field.
168
169        REQ_DOWN_CHAR
170             Move down in the field.
171
172
173        REQ_NEW_LINE
174             Insert or overlay a new line.
175
176        REQ_INS_CHAR
177             Insert a blank at the cursor.
178
179        REQ_INS_LINE
180             Insert a blank line at the cursor.
181
182        REQ_DEL_CHAR
183             Delete character at the cursor.
184
185        REQ_DEL_PREV
186             Delete character before the cursor.
187
188        REQ_DEL_LINE
189             Delete line at the cursor.
190
191        REQ_DEL_WORD
192             Delete blank-delimited word at the cursor.
193
194        REQ_CLR_EOL
195             Clear to end of line from cursor.
196
197        REQ_CLR_EOF
198             Clear to end of field from cursor.
199
200        REQ_CLR_FIELD
201             Clear the entire field.
202
203        REQ_OVL_MODE
204             Enter overlay mode.
205
206        REQ_INS_MODE
207             Enter insert mode.
208
209
210        REQ_SCR_FLINE
211             Scroll the field forward a line.
212
213        REQ_SCR_BLINE
214             Scroll the field backward a line.
215
216        REQ_SCR_FPAGE
217             Scroll the field forward a page.
218
219        REQ_SCR_BPAGE
220             Scroll the field backward a page.
221
222        REQ_SCR_FHPAGE
223             Scroll the field forward half a page.
224
225        REQ_SCR_BHPAGE
226             Scroll the field backward half a page.
227
228
229        REQ_SCR_FCHAR
230             Scroll the field forward a character.
231
232        REQ_SCR_BCHAR
233             Scroll the field backward a character.
234
235        REQ_SCR_HFLINE
236             Horizontal scroll the field forward a line.
237
238        REQ_SCR_HBLINE
239             Horizontal scroll the field backward a line.
240
241        REQ_SCR_HFHALF
242             Horizontal scroll the field forward half a line.
243
244        REQ_SCR_HBHALF
245             Horizontal scroll the field backward half a line.
246
247
248        REQ_VALIDATION
249             Validate field.
250
251        REQ_NEXT_CHOICE
252             Display next field choice.
253
254        REQ_PREV_CHOICE
255             Display previous field choice.
256
257        If  the  second  argument  is  a  printable character, the
258        driver places it in the current position  in  the  current
259        field.   If  it is one of the forms requests listed above,
260        that request is executed.
261
262
263 </PRE>
264 <H3><a name="h3-MOUSE-HANDLING">MOUSE HANDLING</a></H3><PRE>
265        If the second argument is the KEY_MOUSE special  key,  the
266        associated mouse event is translated into one of the above
267        pre-defined requests.  Currently only clicks in  the  user
268        window  (e.g., inside the form display area or the decora-
269        tion window) are handled.
270
271        If you click above the display region of the form:
272
273           a REQ_PREV_FIELD is generated for a single click,
274
275           a REQ_PREV_PAGE is generated for a double-click and
276
277           a REQ_FIRST_FIELD is generated for a triple-click.
278
279        If you click below the display region of the form:
280
281           a REQ_NEXT_FIELD is generated for a single click,
282
283           a REQ_NEXT_PAGE is generated for a double-click and
284
285           a REQ_LAST_FIELD is generated for a triple-click.
286
287        If you click at an field inside the display  area  of  the
288        form:
289
290           <STRONG>o</STRONG>   the form cursor is positioned to that field.
291
292           <STRONG>o</STRONG>   If  you  double-click  a  field, the form cursor is
293               positioned to that field and  <STRONG>E_UNKNOWN_COMMAND</STRONG>  is
294               returned.  This return value makes sense, because a
295               double click usually means that  an  field-specific
296               action  should be returned.  It is exactly the pur-
297               pose of this return value to signal that an  appli-
298               cation specific command should be executed.
299
300           <STRONG>o</STRONG>   If   a   translation   into  a  request  was  done,
301               <STRONG>form_driver</STRONG> returns the result of this request.
302
303        If you clicked outside the user window or the mouse  event
304        could   not   be   translated   into  a  form  request  an
305        <STRONG>E_REQUEST_DENIED</STRONG> is returned.
306
307
308 </PRE>
309 <H3><a name="h3-APPLICATION-DEFINED-COMMANDS">APPLICATION-DEFINED COMMANDS</a></H3><PRE>
310        If the second argument is neither printable nor one of the
311        above  pre-defined form requests, the driver assumes it is
312        an application-specific command and returns <STRONG>E_UNKNOWN_COM-</STRONG>
313        <STRONG>MAND</STRONG>.  Application-defined commands should be defined rel-
314        ative to <STRONG>MAX_COMMAND</STRONG>, the  maximum  value  of  these  pre-
315        defined requests.
316
317
318 </PRE>
319 <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
320        <STRONG>form_driver</STRONG> returns one of the following error codes:
321
322        <STRONG>E_OK</STRONG> The routine succeeded.
323
324        <STRONG>E_BAD_ARGUMENT</STRONG>
325             Routine  detected  an incorrect or out-of-range argu-
326             ment.
327
328        <STRONG>E_BAD_STATE</STRONG>
329             Routine was called from an initialization or termina-
330             tion function.
331
332        <STRONG>E_NOT_POSTED</STRONG>
333             The form has not been posted.
334
335        <STRONG>E_INVALID_FIELD</STRONG>
336             Contents of field is invalid.
337
338        <STRONG>E_REQUEST_DENIED</STRONG>
339             The form driver could not process the request.
340
341        <STRONG>E_SYSTEM_ERROR</STRONG>
342             System error occurred (see <STRONG>errno</STRONG>).
343
344        <STRONG>E_UNKNOWN_COMMAND</STRONG>
345             The form driver code saw an unknown request code.
346
347
348 </PRE>
349 <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
350        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>.
351
352
353 </PRE>
354 <H2><a name="h2-NOTES">NOTES</a></H2><PRE>
355        The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the header
356        files <STRONG>&lt;curses.h&gt;</STRONG>.
357
358
359 </PRE>
360 <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
361        These routines emulate the System V forms  library.   They
362        were not supported on Version 7 or BSD versions.
363
364
365 </PRE>
366 <H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
367        Juergen  Pfeifer.   Manual  pages  and  adaptation for new
368        curses by Eric S. Raymond.
369
370
371
372                                                         <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
373 </PRE>
374 <div class="nav">
375 <ul>
376 <li><a href="#h2-NAME">NAME</a></li>
377 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
378 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
379 <ul>
380 <li><a href="#h3-MOUSE-HANDLING">MOUSE HANDLING</a></li>
381 <li><a href="#h3-APPLICATION-DEFINED-COMMANDS">APPLICATION-DEFINED COMMANDS</a></li>
382 </ul>
383 </li>
384 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
385 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
386 <li><a href="#h2-NOTES">NOTES</a></li>
387 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
388 <li><a href="#h2-AUTHORS">AUTHORS</a></li>
389 </ul>
390 </div>
391 </BODY>
392 </HTML>