]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/dialog/dialog.3
Merge ACPICA 20110413.
[FreeBSD/FreeBSD.git] / contrib / dialog / dialog.3
1 .\" $Id: dialog.3,v 1.49 2010/02/23 10:33:59 tom Exp $
2 .\" Copyright 2005-2009,2010  Thomas E. Dickey
3 .\"
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU Lesser General Public License, version 2.1
6 .\" as published by the Free Software Foundation.
7 .\"
8 .\" This program is distributed in the hope that it will be useful, but
9 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 .\" Lesser General Public License for more details.
12 .\"
13 .\" You should have received a copy of the GNU Lesser General Public
14 .\" License along with this program; if not, write to
15 .\"     Free Software Foundation, Inc.
16 .\"     51 Franklin St., Fifth Floor
17 .\"     Boston, MA 02110, USA.
18 .TH DIALOG 3 "" "$Date: 2010/02/23 10:33:59 $"
19 .SH NAME
20 dialog \- widgets and utilities for the dialog program
21 .SH SYNOPSIS
22 .B cc [ flag ... ] file ...  -ldialog [ library ... ]
23
24 .B #include <dialog.h>
25 .PP
26 \fBDialog\fP
27 is a program that will let you to present a variety of questions or
28 display messages using dialog boxes from a shell script.
29 It is built from the \fBdialog\fP library,
30 which consists of several widgets
31 as well as utility functions that are used by the widgets
32 or the main program.
33 .
34 .SH DESCRIPTION
35 This manpage documents the features from \fI<dialog.h>\fP which
36 are likely to be important to developers using the widgets directly.
37 Some hints are also given for developing new widgets.
38 .
39 .\" ************************************************************************
40 .SH DEFINITIONS
41 Exit codes (passed back to the main program for its use)
42 are defined with a "\fIDLG_EXIT_\fP prefix.
43 The defined constants can be mapped using environment variables
44 as described in \fBdialog\fP(1),
45 e.g., \fIDLG_EXIT_OK\fP corresponds to \fI$DIALOG_OK\fP.
46 .PP
47 Useful character constants which correspond to user input
48 are named with the "\fICHR_\fP" prefix, e.g.,
49 \fICHR_BACKSPACE\fP.
50 .PP
51 Colors and video attributes are categorized and associated with
52 settings in the configuration file
53 (see the discussion of \fI$DIALOGRC\fP in \fBdialog\fP(1)).
54 The \fIDIALOG_ATR(n)\fP macro is used for defining the references
55 to the combined color and attribute table \fIdlg_color_table[]\fP.
56 .PP
57 The \fBdialog\fP application passes its command-line parameters
58 to the widget functions.  Some of those parameters are single values,
59 but some of the widgets accept data as an array of values.
60 Those include checklist/radiobox, menubox and formbox.
61 When the \fB--item-help\fP option is given, an extra column
62 of data is expected.
63 The USE_ITEM_HELP(), CHECKBOX_TAGS, MENUBOX_TAGS and FORMBOX_TAGS
64 macros are used to hide this difference from the calling application.
65 .PP
66 Most of the other definitions found in \fI<dialog.h>\fP
67 are used for convenience in building the library or main program.
68 These include definitions based on the generated \fI<dlg_config.h>\fP header.
69
70 .\" ************************************************************************
71 .SH DATA STRUCTURES
72 All of the global data for the \fBdialog\fP library is stored in
73 a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
74 The corresponding \fIdialog_state\fP, \fIdialog_vars\fP and \fIdlg_color_table\fP
75 global variables should be initialized to zeros,
76 and then populated with the data to use.
77 A few of these must be nonzero for the corresponding widgets to function.
78 As as the case with function names,
79 variables beginning with "\fIdialog_\fP"
80 are designed for use by the calling application
81 while variables beginning with "\fIdlg_\fP"
82 are intended for lower levels, e.g., by the \fBdialog\fP library.
83 .\" ---------------------------------------------------------------------------
84 .IP \fIDIALOG_STATE.all_windows
85 This is a linked list of all windows created by the library.
86 The \fBdlg_del_window\fP function uses this to locate windows which
87 may be redrawn after deleting a window.
88 .\" ---------------------------------------------------------------------------
89 .IP \fIDIALOG_STATE.aspect_ratio
90 This corresponds to the command-line option "\fB--aspect-ratio\fP".
91 The value gives the application
92 some control over the box dimensions when using auto
93 sizing (specifying 0 for height and width).
94 It represents width / height.
95 The default is 9, which means 9 characters wide to every 1 line high.
96 .\" ---------------------------------------------------------------------------
97 .IP \fIDIALOG_STATE.getc_callbacks
98 This is setup in \fIui_getc.c\fP to record windows which must be polled
99 for input, e.g,. to handle the background tailbox widget.
100 One window is designated as the foreground or control window.
101 .\" ---------------------------------------------------------------------------
102 .IP \fIDIALOG_STATE.getc_redirect
103 If the control window for \fIDIALOG_STATE.getc_callbacks\fP is
104 closed, the list is transferred to this variable.
105 Closing all windows causes the application to exit.
106 .\" ---------------------------------------------------------------------------
107 .IP \fIDIALOG_STATE.output
108 This is set in the \fBdialog\fP application to the stream on
109 which the application and library functions may write text results.
110 Normally that is the standard error,
111 since the curses library prefers to write its data to the standard output.
112 Some scripts, trading portability for convenience,
113 prefer to write results to the standard output,
114 e.g., by using the "\fB--stdout\fP" option.
115 .\" ---------------------------------------------------------------------------
116 .IP \fIDIALOG_STATE.output_count
117 This is incremented by \fIdlg_does_output\fP,
118 which is called by each widget that writes text to the output.
119 The \fBdialog\fP application uses that to decide if it should
120 also write a separator, i.e.,
121 \fIDIALOG_STATE.separate_str\fP,
122 between calls to each widget.
123 .\" ---------------------------------------------------------------------------
124 .IP \fIDIALOG_STATE.pipe_input
125 This is set in \fIinit_dialog\fP to a stream which can be used by the
126 \fBgauge\fP widget, which must be the application's standard input.
127 The \fBdialog\fP application calls \fIinit_dialog\fP normally with
128 \fIinput\fP set to the standard input, but optionally based on the
129 "\fB--input-fd\fP" option.
130 Since the application cannot read from
131 a pipe (standard input) and at the same time read
132 the curses input from the standard input,
133 it must allow for reopening the latter from either
134 a specific file descriptor,
135 or directly from the terminal.
136 The adjusted pipe stream value is stored in this variable.
137 .\" ---------------------------------------------------------------------------
138 .IP \fIDIALOG_STATE.screen_initialized
139 This is set in \fIinit_dialog\fP and
140 reset in \fIend_dialog\fP.
141 It is used to check if curses has been initialized,
142 and if the \fIendwin\fP function must be called on exit.
143 .\" ---------------------------------------------------------------------------
144 .IP \fIDIALOG_STATE.screen_output
145 This is set in \fIinit_dialog\fP to the output stream used
146 by the curses library.
147 Normally that is the standard output,
148 unless that happens to not be a terminal (and if \fIinit_dialog\fP can
149 successfully open the terminal directly).
150 .\" ---------------------------------------------------------------------------
151 .IP \fIDIALOG_STATE.separate_str
152 This corresponds to the command-line option "\fB--separate-widget\fP".
153 The given string
154 specifies a string that will separate the output on \fBdialog\fP's output from
155 each widget.
156 This is used to simplify parsing the result of a dialog with several widgets.
157 If this option is not given,
158 the default separator string is a tab character.
159 .\" ---------------------------------------------------------------------------
160 .IP \fIDIALOG_STATE.tab_len
161 This corresponds to the command-line option "\fB--tab-len\fP \fInumber\fP".
162 Specify the number of spaces that a tab character occupies if the
163 "\fB--tab-correct\fP"
164 option is given.
165 The default is 8.
166 .\" ---------------------------------------------------------------------------
167 .IP \fIDIALOG_STATE.use_colors
168 This is set in \fIinit_dialog\fP if the curses implementation supports color.
169 .\" ---------------------------------------------------------------------------
170 .IP \fIDIALOG_STATE.use_scrollbar
171 This corresponds to the command-line option "\fB--scrollbar\fP".
172 If true,
173 draw a scrollbar to make windows holding scrolled data more readable.
174 .\" ---------------------------------------------------------------------------
175 .IP \fIDIALOG_STATE.use_shadow
176 This corresponds to the command-line option "\fB--no-shadow\fP".
177 This is set in \fIinit_dialog\fP if the curses implementation supports color.
178 If true,
179 suppress shadows that would be drawn to the right and bottom of each dialog box.
180 .\" ---------------------------------------------------------------------------
181 .IP \fIDIALOG_STATE.visit_items
182 This corresponds to the command-line option "\fB--visit-items\fP".
183 .\" ---------------------------------------------------------------------------
184 .PP
185 The \fBdialog\fP application resets the \fIdialog_vars\fP data before
186 accepting options to invoke each widget.
187 Most of the \fIDIALOG_VARS\fP members are set directly from \fBdialog\fP's
188 command-line options:
189 .\" ---------------------------------------------------------------------------
190 .IP \fIDIALOG_VARS.ascii_lines
191 .\" ---------------------------------------------------------------------------
192 .IP \fIDIALOG_VARS.backtitle
193 This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP".
194 It specifies a
195 \fIbacktitle\fP
196 string to be displayed on the backdrop, at the top of the screen.
197 .\" ---------------------------------------------------------------------------
198 .IP \fIDIALOG_VARS.beep_after_signal
199 This corresponds to the command-line option "\fB--beep-after\fP".
200 If true, beep after a user has completed a widget by pressing one of the buttons.
201 .\" ---------------------------------------------------------------------------
202 .IP \fIDIALOG_VARS.beep_signal
203 This corresponds to the command-line option "\fB--beep\fP".
204 It is obsolete.
205 .\" ---------------------------------------------------------------------------
206 .IP \fIDIALOG_VARS.begin_set
207 This is true if the command-line option "\fB--begin y x\fP" was used.
208 It specifies the position of the upper left corner of a dialog box on the screen.
209 .\" ---------------------------------------------------------------------------
210 .IP \fIDIALOG_VARS.begin_x
211 This corresponds to the \fIx\fP value from
212 the command-line option "\fB--begin\fP \fIy x\fP" (second value).
213 .\" ---------------------------------------------------------------------------
214 .IP \fIDIALOG_VARS.begin_y
215 This corresponds to the \fIy\fP value from
216 the command-line option "\fB--begin\fP \fIy x\fP" (first value).
217 .\" ---------------------------------------------------------------------------
218 .IP \fIDIALOG_VARS.cancel_label
219 This corresponds to the command-line option "\fB--cancel-label\fP \fIstring\fP".
220 The given \fIstring\fP overrides the label used for "Cancel" buttons.
221 .\" ---------------------------------------------------------------------------
222 .IP \fIDIALOG_VARS.cant_kill
223 This corresponds to the command-line option "\fB--no-kill\fP".
224 If true, this tells
225 \fBdialog\fP
226 to put the
227 \fBtailboxbg\fP
228 box in the background,
229 printing its process id to \fBdialog\fP's output.
230 SIGHUP is disabled for the background process.
231 .\" ---------------------------------------------------------------------------
232 .IP \fIDIALOG_VARS.colors
233 This corresponds to the command-line option "\fB--colors\fP".
234 If true, interpret embedded "\\Z" sequences in the dialog text
235 by the following character,
236 which tells dialog to set colors or video attributes:
237 0 through 7 are the ANSI codes used in curses:
238 black,
239 red,
240 green,
241 yellow,
242 blue,
243 magenta,
244 cyan and
245 white respectively.
246 Bold is set by 'b', reset by 'B'.
247 Reverse is set by 'r', reset by 'R'.
248 Underline is set by 'u', reset by 'U'.
249 The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
250 bright red.
251 Restore normal settings with "\\Zn".
252 .\" ---------------------------------------------------------------------------
253 .IP \fIDIALOG_VARS.column_separator
254 .\" ---------------------------------------------------------------------------
255 .IP \fIDIALOG_VARS.cr_wrap
256 This corresponds to the command-line option "\fB--cr-wrap\fP".
257 If true,
258 interpret embedded newlines in the dialog text as a newline on the screen.
259 Otherwise, \fBdialog\fR will only wrap lines where needed to fit inside the text box.
260 Even though you can control line breaks with this,
261 \fBdialog\fR will still wrap any lines that are too long for the width of the box.
262 Without cr-wrap, the layout of your text may be formatted to look nice
263 in the source code of your script without affecting the way it will
264 look in the dialog.
265 .\" ---------------------------------------------------------------------------
266 .IP \fIDIALOG_VARS.date_format
267 This corresponds to the command-line option "\fB--date-format\fP \fIstring\fP".
268 If the host provides \fBstrftime\fP, and the value is nonnull,
269 the calendar widget uses this to format its output.
270 .\" ---------------------------------------------------------------------------
271 .IP \fIDIALOG_VARS.default_item
272 This corresponds to the command-line option "\fB--default-item\fP \fIstring\fP".
273 The given string is used as
274 the default item in a checklist, form or menu box.
275 Normally the first item in the box is the default.
276 .IP \fIDIALOG_VARS.defaultno
277 This corresponds to the command-line option "\fB--defaultno\fP".
278 If true,
279 make the default value of the
280 \fByes/no\fP
281 box a
282 .BR No .
283 Likewise, make the default button of widgets that provide "OK" and "Cancel"
284 a \fBCancel\fP.
285 If \fB--nocancel\fP was given that option overrides this,
286 making the default button always "Yes" (internally the same as "OK").
287 .\" ---------------------------------------------------------------------------
288 .IP \fIDIALOG_VARS.dlg_clear_screen
289 This corresponds to the command-line option "\fB--clear\fP".
290 This option is implemented in the main program, not the library.
291 If true,
292 the screen will be cleared on exit.
293 This may be used alone, without other options.
294 .\" ---------------------------------------------------------------------------
295 .IP \fIDIALOG_VARS.exit_label
296 This corresponds to the command-line option "\fB--exit-label string\fP".
297 The given string overrides the label used for "EXIT" buttons.
298 .\" ---------------------------------------------------------------------------
299 .IP \fIDIALOG_VARS.extra_button
300 This corresponds to the command-line option "\fB--extra-button\fP".
301 If true, some widgets show an extra button,
302 between "OK" and "Cancel" buttons.
303 .\" ---------------------------------------------------------------------------
304 .IP \fIDIALOG_VARS.extra_label
305 This corresponds to the command-line option "\fB--extra-label\fP \fIstring\fP".
306 The given string overrides the label used for "Extra" buttons.
307 Note: for inputmenu widgets, this defaults to "Rename".
308 .\" ---------------------------------------------------------------------------
309 .IP \fIDIALOG_VARS.formitem_type
310 This is set by the command-line option "\fB--passwordform\fP"
311 to tell the form widget that its text fields should be treated like
312 password widgets.
313 .\" ---------------------------------------------------------------------------
314 .IP \fIDIALOG_VARS.help_button
315 This corresponds to the command-line option "\fB--help-button\fP".
316 If true, some widgets show a help-button after "OK" and "Cancel" buttons,
317 i.e., in checklist, radiolist and menu boxes.
318 If \fB--item-help\fR is also given, on exit
319 the return status will be the same as for the "OK" button,
320 and the item-help text will be written to \fBdialog\fP's output after the token "HELP".
321 Otherwise, the return status will indicate that the Help button was pressed,
322 and no message printed.
323 .\" ---------------------------------------------------------------------------
324 .IP \fIDIALOG_VARS.help_label
325 This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP".
326 The given string overrides the label used for "Help" buttons.
327 .\" ---------------------------------------------------------------------------
328 .IP \fIDIALOG_VARS.help_status
329 This corresponds to the command-line option "\fB--help-status\fP".
330 If true, and the the help-button is selected,
331 writes the checklist or radiolist information
332 after the item-help "HELP" information.
333 This can be used to reconstruct the state of a checklist after processing
334 the help request.
335 .\" ---------------------------------------------------------------------------
336 .IP \fIDIALOG_VARS.input_length
337 This is nonzero if \fIDIALOG_VARS.input_result\fP is allocated,
338 versus being a pointer to the user's local variables.
339 .\" ---------------------------------------------------------------------------
340 .IP \fIDIALOG_VARS.input_menu
341 This flag is set to denote whether the menubox widget
342 implements a menu versus a inputmenu widget.
343 .\" ---------------------------------------------------------------------------
344 .IP \fIDIALOG_VARS.input_result
345 If \fIDIALOG_VARS.input_length\fP is zero,
346 this is a pointer to user buffer (on the stack, or static).
347 When \fIDIALOG_VARS.input_length\fP is nonzero,
348 this is a dynamically-allocated buffer used by the widgets to return
349 printable results to the calling application.
350 .\" ---------------------------------------------------------------------------
351 .IP \fIDIALOG_VARS.insecure
352 This corresponds to the command-line option "\fB--insecure\fP".
353 If true, make the password widget friendlier but less secure,
354 by echoing asterisks for each character.
355 .\" ---------------------------------------------------------------------------
356 .IP \fIDIALOG_VARS.item_help
357 This corresponds to the command-line option "\fB--item-help\fP".
358 If true,
359 interpret the tags data for checklist, radiolist and menu boxes
360 adding a column whose text is displayed in the bottom line of the
361 screen, for the currently selected item.
362 .\" ---------------------------------------------------------------------------
363 .IP \fIDIALOG_VARS.keep_tite
364 This is set by the command-line option "\fB--keep-tite\fP"
365 to tell \fBdialog\fP to not attempt to cancel the terminal initialization
366 (termcap \fIti\fP/\fIte\fP) sequences which correspond to xterm's alternate-screen
367 switching.
368 Normally \fBdialog\fP does this to avoid flickering when run several times
369 in a script.
370 .\" ---------------------------------------------------------------------------
371 .IP \fIDIALOG_VARS.keep_window
372 This corresponds to the command-line option "\fB--keep-window\fP".
373 If true, do not remove/repaint the window on exit.
374 This is useful for keeping the window contents visible when several
375 widgets are run in the same process.
376 Note that curses will clear the screen when starting a new process.
377 .\" ---------------------------------------------------------------------------
378 .IP \fIDIALOG_VARS.max_input
379 This corresponds to the command-line option "\fB--max-input\fP \fIsize\fP".
380 Limit input strings to the given size.
381 If not specified, the limit is 2048.
382 .\" ---------------------------------------------------------------------------
383 .IP \fIDIALOG_VARS.no_label
384 This corresponds to the command-line option "\fB--no-label\fP \fIstring\fP".
385 The given string overrides the label used for "No" buttons.
386 .\" ---------------------------------------------------------------------------
387 .IP \fIDIALOG_VARS.no_lines
388 .\" ---------------------------------------------------------------------------
389 .IP \fIDIALOG_VARS.nocancel
390 This corresponds to the command-line option "\fB--no-cancel\fP".
391 If true,
392 suppress the "Cancel" button in checklist, inputbox and menu box modes.
393 A script can still test if the user pressed the ESC key to cancel to quit.
394 .\" ---------------------------------------------------------------------------
395 .IP \fIDIALOG_VARS.nocollapse
396 This corresponds to the command-line option "\fB--no-collapse\fP".
397 Normally \fBdialog\fR converts tabs to spaces and reduces multiple
398 spaces to a single space for text which is displayed in a message boxes, etc.
399 It true, that feature is disabled.
400 Note that \fBdialog\fR will still wrap text, subject to the \fB--cr-wrap\fR
401 option.
402 .\" ---------------------------------------------------------------------------
403 .IP \fIDIALOG_VARS.nook
404 .\" ---------------------------------------------------------------------------
405 .IP \fIDIALOG_VARS.ok_label
406 This corresponds to the command-line option "\fB--ok-label\fP \fIstring\fP".
407 The given string overrides the label used for "OK" buttons.
408 .\" ---------------------------------------------------------------------------
409 .IP \fIDIALOG_VARS.print_siz
410 This corresponds to the command-line option "\fB--print-size\fP".
411 If true,
412 each widget prints its size to \fBdialog\fP's output when it is invoked.
413 .\" ---------------------------------------------------------------------------
414 .IP \fIDIALOG_VARS.quoted
415 .\" ---------------------------------------------------------------------------
416 .IP \fIDIALOG_VARS.separate_output
417 This corresponds to the command-line option "\fB--separate-output\fP".
418 If true,
419 checklist widgets output result one line at a time, with no quoting.
420 This facilitates parsing by another program.
421 .\" ---------------------------------------------------------------------------
422 .IP \fIDIALOG_VARS.single_quoted
423 This corresponds to the command-line option "\fB--single-quoted\fP".
424 If true,
425 Use single-quoting as needed (and no quotes if unneeded) for the
426 output of checklist's as well as the item-help text.
427 If this option is not set, \fBdialog\fP uses double quotes around each item.
428 That requires occasional use of backslashes to make the output useful in
429 shell scripts.
430 .IP \fIDIALOG_VARS.size_err
431 This corresponds to the command-line option "\fB--size-err\fP".
432 If true,
433 check the resulting size of a dialog box before trying to use it,
434 printing the resulting size if it is larger than the screen.
435 (This option is obsolete, since all new-window calls are checked).
436 .\" ---------------------------------------------------------------------------
437 .IP \fIDIALOG_VARS.sleep_secs
438 This corresponds to the command-line option "\fB--sleep\fP \fIsecs\fP".
439 This option is implemented in the main program, not the library.
440 If nonzero, this is the number of seconds after to delay after processing a dialog box.
441 .\" ---------------------------------------------------------------------------
442 .IP \fIDIALOG_VARS.tab_correct
443 This corresponds to the command-line option "\fB--tab-correct\fP".
444 If true, convert each tab character of the text to one or more spaces.
445 Otherwise, tabs are rendered according to the curses library's interpretation.
446 .\" ---------------------------------------------------------------------------
447 .IP \fIDIALOG_VARS.time_format
448 This corresponds to the command-line option "\fB--time-format\fP \fIstring\fP".
449 If the host provides \fBstrftime\fP, and the value is nonnull,
450 the timebox widget uses this to format its output.
451 .\" ---------------------------------------------------------------------------
452 .IP \fIDIALOG_VARS.timeout_secs
453 This corresponds to the command-line option "\fB--timeout\fP \fIsecs\fP".
454 If nonzero, timeout input requests (exit with error code)
455 if no user response within the given number of seconds.
456 .\" ---------------------------------------------------------------------------
457 .IP \fIDIALOG_VARS.title
458 This corresponds to the command-line option "\fB--title\fP \fItitle\fP".
459 Specifies a
460 \fItitle\fP
461 string to be displayed at the top of the dialog box.
462 .\" ---------------------------------------------------------------------------
463 .IP \fIDIALOG_VARS.trim_whitespace
464 This corresponds to the command-line option "\fB--trim\fP".
465 If true, eliminate leading blanks,
466 trim literal newlines and repeated blanks from message text.
467 .\" ---------------------------------------------------------------------------
468 .IP \fIDIALOG_VARS.visit_items
469 This corresponds to the command-line option "\fB--visit-items\fP".
470 Modify the tab-traversal of checklist, radiobox, menubox and inputmenu
471 to include the list of items as one of the states.
472 This is useful as a visual aid,
473 i.e., the cursor position helps some users.
474 .\" ---------------------------------------------------------------------------
475 .IP \fIDIALOG_VARS.yes_label
476 This corresponds to the command-line option "\fB--yes-label\fP \fIstring\fP".
477 The given string overrides the label used for "Yes" buttons.
478 .
479 .\" ************************************************************************
480 .\" ************************************************************************
481 .SH WIDGETS
482 Functions that implement major functionality for the command-line \fBdialog\fP
483 program, e.g., widgets, have names beginning "\fIdialog_\fP".
484
485 All dialog boxes have at least three parameters:
486 .TP 5
487 \fItitle\fP
488 the caption for the box, shown on its top border.
489 .TP 5
490 \fIheight\fP
491 the height of the dialog box.
492 .TP 5
493 \fIwidth\fP
494 the width of the dialog box.
495 .PP
496 Other parameters depend on the box type.
497 .
498 .\" ************************************************************************
499 .IP \fBdialog_calendar
500 implements the "\fB--calendar\fP" option.
501 .RS
502 .IP title
503 is the title on the top of the widget.
504 .IP subtitle
505 is the prompt text shown within the widget.
506 .IP height
507 is the height excluding the fixed-height calendar grid.
508 .IP width
509 is the overall width of the box,
510 which is adjusted up to the calendar grid's minimum width if needed.
511 .IP day
512 is the initial day of the week shown,
513 counting zero as Sunday.
514 If the value is negative,
515 the current day of the week is used.
516 .IP month
517 is the initial month of the year shown,
518 counting one as January.
519 If the value is negative,
520 the current month of the year is used.
521 .IP year
522 is the initial year shown.
523 If the value is negative,
524 the current year is used.
525 .RE
526 .\" ************************************************************************
527 .IP \fBdialog_checklist
528 implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
529 depending on the \fIflag\fP parameter.
530 .RS
531 .IP title
532 is the title on the top of the widget.
533 .IP cprompt
534 is the prompt text shown within the widget.
535 .IP height
536 is the desired height of the box.
537 If zero, the height is adjusted to use the available screen size.
538 .IP width
539 is the desired width of the box.
540 If zero, the height is adjusted to use the available screen size.
541 .IP list_height
542 is the minimum height to reserve for displaying the list.
543 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
544 .IP item_no
545 is the number of rows in \fIitems\fP.
546 .IP items
547 is an array of strings which is viewed either as a list of rows
548 .RS
549 \fItag item status \fR
550 .RE
551 .IP
552 or
553 .RS
554 \fItag item status help\fR
555 .RE
556 .IP
557 depending on whether \fIdialog_vars.item_help\fP is set.
558 .IP flag
559 is either \fIFLAG_CHECK\fP, for checklists,
560 or \fIFLAG_RADIO\fP for radiolists.
561 .RE
562 .\" ************************************************************************
563 .IP \fBdialog_dselect
564 implements the "\fB--dselect\fP" option.
565 .RS
566 .IP title
567 is the title on the top of the widget.
568 .IP path
569 is the preselected value to show in the input-box,
570 which is used also to set the directory- and file-windows.
571 .IP height
572 is the height excluding the minimum needed to show the dialog box framework.
573 If zero, the height is based on the screen size.
574 .IP width
575 is the desired width of the box.
576 If zero, the height is based on the screen size.
577 .RE
578 .\" ************************************************************************
579 .IP \fBdialog_editbox
580 implements the "\fB--editbox\fP" option.
581 .RS
582 .IP title
583 is the title on the top of the widget.
584 .IP file
585 is the name of the file from which to read.
586 .IP height
587 is the desired height of the box.
588 If zero, the height is adjusted to use the available screen size.
589 .IP width
590 is the desired width of the box.
591 If zero, the height is adjusted to use the available screen size.
592 .RE
593 .\" ************************************************************************
594 .IP \fBdialog_form
595 implements the "\fB--form\fP" option.
596 .RS
597 .IP title
598 is the title on the top of the widget.
599 .IP cprompt
600 is the prompt text shown within the widget.
601 .IP height
602 is the desired height of the box.
603 If zero, the height is adjusted to use the available screen size.
604 .IP width
605 is the desired width of the box.
606 If zero, the height is adjusted to use the available screen size.
607 .IP form_height
608 is the minimum height to reserve for displaying the list.
609 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
610 .IP item_no
611 is the number of rows in \fIitems\fP.
612 .IP items
613 is an array of strings which is viewed either as a list of rows
614 .RS
615 \fIName NameY NameX Text TextY TextX FLen ILen\fR
616 .RE
617 .IP
618 or
619 .RS
620 \fIName NameY NameX Text TextY TextX FLen ILen Help\fR
621 .RE
622 .IP
623 depending on whether \fIdialog_vars.item_help\fP is set.
624 .RE
625 .\" ************************************************************************
626 .IP \fBdialog_fselect
627 implements the "\fB--fselect\fP" option.
628 .RS
629 .IP title
630 is the title on the top of the widget.
631 .IP path
632 is the preselected value to show in the input-box,
633 which is used also to set the directory- and file-windows.
634 .IP height
635 is the height excluding the minimum needed to show the dialog box framework.
636 If zero, the height is based on the screen size.
637 .IP width
638 is the desired width of the box.
639 If zero, the height is based on the screen size.
640 .RE
641 .\" ************************************************************************
642 .IP \fBdialog_gauge
643 implements the "\fB--gauge\fP" option.
644 .RS
645 .IP title
646 is the title on the top of the widget.
647 .IP cprompt
648 is the prompt text shown within the widget.
649 .IP height
650 is the desired height of the box.
651 If zero, the height is based on the screen size.
652 .IP width
653 is the desired width of the box.
654 If zero, the height is based on the screen size.
655 .IP percent
656 is the percentage to show in the progress bar.
657 .RE
658 .\" ************************************************************************
659 .IP \fBdialog_inputbox
660 implements the "\fB--inputbox\fP" or
661 "\fB--password\fP" option, depending on the value of \fIpassword\fP.
662 .RS
663 .IP title
664 is the title on the top of the widget.
665 .IP cprompt
666 is the prompt text shown within the widget.
667 .IP height
668 is the desired height of the box.
669 If zero, the height is based on the screen size.
670 .IP width
671 is the desired width of the box.
672 If zero, the height is based on the screen size.
673 .IP init
674 is the initial value of the input box, whose length is taken into account
675 when auto-sizing the width of the dialog box.
676 .IP password
677 if true, causes typed input to be echoed as asterisks.
678 .RE
679 .\" ************************************************************************
680 .IP \fBdialog_menu
681 implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
682 depending on whether \fIdialog_vars.input_menu\fP is set.
683 .RS
684 .IP title
685 is the title on the top of the widget.
686 .IP cprompt
687 is the prompt text shown within the widget.
688 .IP height
689 is the desired height of the box.
690 If zero, the height is based on the screen size.
691 .IP width
692 is the desired width of the box.
693 If zero, the height is based on the screen size.
694 .IP menu_height
695 is the minimum height to reserve for displaying the list.
696 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
697 .IP item_no
698 is the number of rows in \fIitems\fP.
699 .IP items
700 is an array of strings which is viewed either as a list of rows
701 .RS
702 \fItag item\fR
703 .RE
704 .IP
705 or
706 .RS
707 \fItag item help\fR
708 .RE
709 .IP
710 depending on whether \fIdialog_vars.item_help\fP is set.
711 .RE
712 .\" ************************************************************************
713 .IP \fBdialog_mixedform
714 implements the "\fB--mixedform\fP" option.
715 .RS
716 .IP title
717 is the title on the top of the widget.
718 .IP cprompt
719 is the prompt text shown within the widget.
720 .IP height
721 is the desired height of the box.
722 If zero, the height is adjusted to use the available screen size.
723 .IP width
724 is the desired width of the box.
725 If zero, the height is adjusted to use the available screen size.
726 .IP form_height
727 is the minimum height to reserve for displaying the list.
728 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
729 .IP item_no
730 is the number of rows in \fIitems\fP.
731 .IP items
732 is an array of strings which is viewed either as a list of rows
733 .RS
734 \fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
735 .RE
736 .IP
737 or
738 .RS
739 \fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
740 .RE
741 .IP
742 depending on whether \fIdialog_vars.item_help\fP is set.
743 .RE
744 .\" ************************************************************************
745 .IP \fBdialog_mixedgauge
746 implements the "\fB--mixedgauge\fP" option
747 .RS
748 .IP title
749 is the title on the top of the widget.
750 .IP cprompt
751 is the caption text shown within the widget.
752 .IP height
753 is the desired height of the box.
754 If zero, the height is based on the screen size.
755 .IP width
756 is the desired width of the box.
757 If zero, the height is based on the screen size.
758 .IP percent
759 is the percentage to show in the progress bar.
760 .IP item_no
761 is the number of rows in \fIitems\fP.
762 .IP items
763 is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
764 The \fItag\fP values are listed, one per row, in the list at the top of
765 the widget.
766 .IP
767 The \fIitem\fP values are decoded: digits 0-9 are the following strings
768 .RS
769 .IP 0
770 Succeeded
771 .IP 1
772 Failed
773 .IP 2
774 Passed
775 .IP 3
776 Completed
777 .IP 4
778 Checked
779 .IP 5
780 Done
781 .IP 6
782 Skipped
783 .IP 7
784 In Progress
785 .IP 8
786 (blank)
787 .IP 9
788 N/A
789 .RE
790 .IP
791 A string with a leading "-" character is centered, marked with "%".
792 For example, "-75" is displayed as "75%".
793 Other strings are displayed as is.
794 .RE
795 .\" ************************************************************************
796 .IP \fBdialog_msgbox
797 implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
798 depending on whether \fIpauseopt\fP is set.
799 .RS
800 .IP title
801 is the title on the top of the widget.
802 .IP cprompt
803 is the prompt text shown within the widget.
804 .IP height
805 is the desired height of the box.
806 If zero, the height is based on the screen size.
807 .IP width
808 is the desired width of the box.
809 If zero, the height is based on the screen size.
810 .IP pauseopt
811 if true, an "OK" button will be shown,
812 and the dialog will wait for it to complete.
813 With an "OK" button, it is denoted a "msgbox",
814 without an "OK" button, it is denoted an "infobox".
815 .RE
816 .\" ************************************************************************
817 .IP \fBdialog_pause
818 implements the "\fB--pause\fP" option.
819 .RS
820 .IP title
821 is the title on the top of the widget.
822 .IP height
823 is the desired height of the box.
824 If zero, the height is based on the screen size.
825 .IP width
826 is the desired width of the box.
827 If zero, the height is based on the screen size.
828 .IP seconds
829 is the timeout to use for the progress bar.
830 .RE
831 .\" ************************************************************************
832 .IP \fBdialog_progressbox
833 implements the "\fB--progressbox\fP" option.
834 .RS
835 .IP title
836 is the title on the top of the widget.
837 .IP cprompt
838 is the prompt text shown within the widget.
839 If empty or null, no prompt is shown.
840 .IP height
841 is the desired height of the box.
842 If zero, the height is based on the screen size.
843 .IP width
844 is the desired width of the box.
845 If zero, the height is based on the screen size.
846 .RE
847 .\" ************************************************************************
848 .IP \fBdialog_tailbox
849 implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
850 depending on whether \fIbg_task\fP is set.
851 .RS
852 .IP title
853 is the title on the top of the widget.
854 .IP file
855 is the name of the file to display in the dialog.
856 .IP height
857 is the desired height of the box.
858 If zero, the height is based on the screen size.
859 .IP width
860 is the desired width of the box.
861 If zero, the height is based on the screen size.
862 .IP bg_task
863 if true,
864 the window is added to the callback list in \fIdialog_state\fP,
865 and the application will poll for the window to be updated.
866 Otherwise an "OK" button is added to the window,
867 and it will be closed when the button is activated.
868 .RE
869 .\" ************************************************************************
870 .IP \fBdialog_textbox
871 implements the "\fB--textbox\fP" option.
872 .RS
873 .IP title
874 is the title on the top of the widget.
875 .IP file
876 is the name of the file to display in the dialog.
877 .IP height
878 is the desired height of the box.
879 If zero, the height is based on the screen size.
880 .IP width
881 is the desired width of the box.
882 If zero, the height is based on the screen size.
883 .RE
884 .\" ************************************************************************
885 .IP \fBdialog_timebox
886 implements the "\fB--timebox\fP" option.
887 .RS
888 .IP title
889 is the title on the top of the widget.
890 .IP subtitle
891 is the prompt text shown within the widget.
892 .IP height
893 is the desired height of the box.
894 If zero, the height is based on the screen size.
895 .IP width
896 is the desired width of the box.
897 If zero, the height is based on the screen size.
898 .IP hour
899 is the initial hour shown.
900 If the value is negative,
901 the current hour is used.
902 .IP minute
903 is the initial minute shown.
904 If the value is negative,
905 the current minute is used.
906 .IP second
907 is the initial second shown.
908 If the value is negative,
909 the current second is used.
910 .RE
911 .\" ************************************************************************
912 .IP \fBdialog_yesno
913 implements the "\fB--yesno\fP" option.
914 .RS
915 .IP title
916 is the title on the top of the widget.
917 .IP cprompt
918 is the prompt text shown within the widget.
919 .IP height
920 is the desired height of the box.
921 If zero, the height is based on the screen size.
922 .IP width
923 is the desired width of the box.
924 If zero, the height is based on the screen size.
925 .RE
926 .
927 .\" ************************************************************************
928 .SH UTILITY FUNCTIONS
929 Most functions that implement lower-level
930 functionality for the command-line \fBdialog\fP
931 program or widgets, have names beginning "\fIdlg_\fP".
932 Bowing to longstanding usage, the functions that initialize the
933 display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
934 .PP
935 The only non-widget function whose name begins with "\fIdialog_\fP"
936 is \fIdialog_version\fP, which returns the version number of the
937 library as a string.
938 .
939 .PP
940 Here is a brief summary of the utility functions and their parameters:
941 .\" ---------------------------------------------------------------------------
942 .TP 5
943 .B dlg_add_callback
944 Add a callback, used to allow polling input from multiple tailbox
945 widgets.
946 .RS
947 .TP 5
948 .B DIALOG_CALLBACK *\fIp\fP
949 contains the callback information.
950 .RE
951 .\" ---------------------------------------------------------------------------
952 .TP 5
953 .B dlg_add_callback_ref
954 Like \fBdlg_add_callback\fP, but passes a reference to the \fBDIALOG_CALLBACK\fP
955 as well as a pointer to a cleanup function which will be called when the
956 associated input ends.
957 .RS
958 .TP 5
959 .B DIALOG_CALLBACK **\fIp\fP
960 points to the callback information.
961 This is a reference to the pointer so that the caller's pointer can be
962 zeroed when input ends.
963 .TP 5
964 .B DIALOG_FREEBACK \fIfunc\fP
965 function to call when input ends, e.g., to free caller's additional data.
966 .RE
967 .\" ---------------------------------------------------------------------------
968 .TP 5
969 .B dlg_add_quoted
970 Add a quoted string to the result buffer (see \fBdlg_add_result\fP).
971 .RS
972 .TP 5
973 .B char * \fIstring
974 is the string to add.
975 .RE
976 .\" ---------------------------------------------------------------------------
977 .TP 5
978 .B dlg_add_result
979 Add a quoted string to the result buffer \fBdialog_vars.input_result\fP.
980 .RS
981 .TP 5
982 .B char * \fIstring
983 is the string to add.
984 .RE
985 .\" ---------------------------------------------------------------------------
986 .TP 5
987 .B dlg_add_separator
988 Add an output-separator to the result buffer \fBdialog_vars.input_result\fP.
989 If \fBdialog_vars.output_separator\fP is set, use that.
990 Otherwise, if \fBdialog_vars.separate_output\fP is set, use newline. 
991 If neither is set, use a space.
992 .\" ---------------------------------------------------------------------------
993 .TP 5
994 .B dlg_add_string
995 Add a quoted or unquoted string to the result buffer
996 (see \fBdlg_add_quoted\fP) and \fBdlg_add_result\fP),
997 according to whether \fBdialog_vars.quoted\fP is true.
998 .RS
999 .TP 5
1000 .B char * \fIstring
1001 is the string to add.
1002 .RE
1003 .\" ---------------------------------------------------------------------------
1004 .TP 5
1005 .B dlg_align_columns
1006 Copy and reformat an array of pointers to strings, aligning according to
1007 the column separator \fBdialog_vars.column_separator\fP.
1008 If no column separator is set, the array will be unmodified;
1009 otherwise it is copied and reformatted.
1010 .IP
1011 Caveat: This function is only implemented for 8-bit characters.
1012 .RS
1013 .TP 5
1014 .B char **\fItarget
1015 This is the array to reformat.
1016 It points to the first string to modify.
1017 .TP 5
1018 .B int \fIper_row
1019 This is the size of the struct for each row of the array.
1020 .TP 5
1021 .B int \fInum_rows
1022 This is the number of rows in the array.
1023 .RE
1024 .\" ---------------------------------------------------------------------------
1025 .TP 5
1026 .B dlg_asciibox
1027 returns its parameter transformed to the
1028 corresponding "+" or "-", etc. for the line-drawing characters used in \fBdialog\fP.
1029 If the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns 0.
1030 .RE
1031 .\" ---------------------------------------------------------------------------
1032 .TP 5
1033 .B dlg_attr_clear
1034 Set window to the given attribute.
1035 .RS
1036 .TP 5
1037 .B WINDOW * \fIwin
1038 is the window to update.
1039 .TP 5
1040 .B int \fIheight
1041 is the number of rows to update.
1042 .TP 5
1043 .B int \fIwidth
1044 is the number of columns to update.
1045 .TP 5
1046 .B chtype \fIattr
1047 is the attribute, e.g., \fBA_BOLD\fP.
1048 .RE
1049 .\" ---------------------------------------------------------------------------
1050 .TP 5
1051 .B dlg_auto_size
1052 Automatically size the window used for a widget.
1053 If the given height or width are zero,
1054 justify the \fIprompt\fP text and return the actual limits.
1055 .RS
1056 .TP 5
1057 .B const char * \fItitle
1058 is the title string to display at the top of the widget.
1059 .TP 5
1060 .B const char * \fIprompt
1061 is the message text which will be displayed in the widget,
1062 used here to determine how large the widget should be.
1063 .TP 5
1064 .B int * \fIheight
1065 is the nominal height.
1066 .TP 5
1067 .B int * \fIwidth
1068 is the nominal width.
1069 .TP 5
1070 .B int \fIboxlines
1071 is the number of lines to reserve in the vertical direction.
1072 .TP 5
1073 .B int \fImincols
1074 is the minimum number of columns to use.
1075 .RE
1076 .\" ---------------------------------------------------------------------------
1077 .TP 5
1078 .B dlg_auto_sizefile
1079 Like \fBdlg_auto_size\fP, but use a file contents to decide how large
1080 the widget should be.
1081 .RS
1082 .TP 5
1083 .B const char * \fItitle
1084 is the title string to display at the top of the widget.
1085 .TP 5
1086 .B const char * \fIfile
1087 is the name of the file.
1088 .TP 5
1089 .B int * \fIheight
1090 is the nominal height.
1091 If it is -1, use the screen's height after subtracting \fBdialog_vars.begin_y\fP
1092 if \fBdialog_vars.begin_set\fP is true.
1093 .TP 5
1094 .B int \fI*width
1095 is the nominal width.
1096 If it is -1, use the screen's width after subtracting \fBdialog_vars.begin_x\fP
1097 if \fBdialog_vars.begin_set\fP is true.
1098 .TP 5
1099 .B int \fIboxlines
1100 is the number of lines to reserve on the screen for drawing boxes.
1101 .TP 5
1102 .B int \fImincols
1103 is the number of columns to reserve on the screen for drawing boxes.
1104 .RE
1105 .\" ---------------------------------------------------------------------------
1106 .TP 5
1107 .B dlg_beeping
1108 If \fBdialog_vars.beep_signal\fP is nonzero,
1109 this calls \fBbeep\fP once and sets
1110 \fBdialog_vars.beep_signal\fP to zero.
1111 .\" ---------------------------------------------------------------------------
1112 .TP 5
1113 .B dlg_boxchar
1114 returns its parameter transformed as follows:
1115 .RS
1116 .TP 3
1117 .B -
1118 if neither \fBdialog_vars.ascii_lines\fP nor \fBdialog_vars.no_lines\fP is set.
1119 .TP 3
1120 .B -
1121 if \fBdialog_vars.ascii_lines\fP is set, returns the corresponding "+" or "-", etc. for the line-drawing characters used in \fBdialog\fP.
1122 .TP 3
1123 .B -
1124 otherwise, if \fBdialog_vars.no_lines\fP is set, returns a space for the line-drawing characters.
1125 .TP 3
1126 .B -
1127 if the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns the parameter unchanged.
1128 .RE
1129 .\" ---------------------------------------------------------------------------
1130 .TP 5
1131 .B dlg_box_x_ordinate
1132 returns a suitable x-ordinate (column) for a new widget.
1133 If \fBdialog_vars.begin_set\fP is 1,
1134 use \fBdialog_vars.begin_x\fP;
1135 otherwise center the widget on the screen (using the \fIwidth\fP parameter).
1136 .RS
1137 .TP 5
1138 .B int \fIwidth
1139 is the width of the widget.
1140 .RE
1141 .\" ---------------------------------------------------------------------------
1142 .TP 5
1143 .B dlg_box_y_ordinate
1144 returns a suitable y-ordinate (row) for a new widget.
1145 If \fBdialog_vars.begin_set\fP is 1,
1146 use \fBdialog_vars.begin_y\fP;
1147 otherwise center the widget on the screen (using the \fIheight\fP parameter).
1148 .RS
1149 .TP 5
1150 .B int \fIheight
1151 is the height of the widget.
1152 .RE
1153 .\" ---------------------------------------------------------------------------
1154 .TP 5
1155 .B dlg_button_count
1156 Count the buttons in the list.
1157 .RS
1158 .TP 5
1159 .B const char ** \fIlabels
1160 is a list of (pointers to) button labels terminated by a null pointer.
1161 .RE
1162 .\" ---------------------------------------------------------------------------
1163 .TP 5
1164 .B dlg_button_layout
1165 Make sure there is enough space for the buttons by
1166 computing the width required for their labels,
1167 adding margins and limiting based on the screen size.
1168 .RS
1169 .TP 5
1170 .B const char ** \fIlabels
1171 is a list of (pointers to) button labels terminated by a null pointer.
1172 .TP 5
1173 .B int * \fIlimit
1174 the function sets the referenced \fIlimit\fP to the width required for
1175 the buttons (limited by the screen size)
1176 if that is wider than the passed-in limit.
1177 .RE
1178 .\" ---------------------------------------------------------------------------
1179 .TP 5
1180 .B dlg_button_sizes
1181 Compute the size of the button array in columns.
1182 .RS
1183 .TP 5
1184 .B const char ** \fIlabels
1185 is a list of (pointers to) button labels terminated by a null pointer.
1186 .TP 5
1187 .B int \fIvertical
1188 is true if the buttons are arranged in a column rather than a row.
1189 .TP 5
1190 .B int * \fIlongest
1191 Return the total number of columns in the referenced location.
1192 .TP 5
1193 .B int * \fIlength
1194 Return the longest button's columns in the referenced location.
1195 .RE
1196 .\" ---------------------------------------------------------------------------
1197 .TP 5
1198 .B dlg_button_x_step
1199 Compute the step-size needed between elements of the button array.
1200 .RS
1201 .TP 5
1202 .B const char ** \fIlabels
1203 is a list of (pointers to) button labels terminated by a null pointer.
1204 .TP 5
1205 .B int \fIlimit
1206 is the maximum number of columns to allow for the buttons.
1207 .TP 5
1208 .B int * \fIgap
1209 store the nominal gap between buttons in the referenced location.
1210 This is constrained to be at least one.
1211 .TP 5
1212 .B int * \fImargin
1213 store the left+right total margins (for the list of buttons) in the referenced
1214 location.
1215 .TP 5
1216 .B int * \fIstep
1217 store the step-size in the referenced location.
1218 .RE
1219 .\" ---------------------------------------------------------------------------
1220 .TP 5
1221 .B dlg_button_to_char
1222 Find the first uppercase character in the label, which we may use for an
1223 abbreviation.
1224 If the label is empty, return -1.
1225 If no uppercase character is found, return 0.
1226 Otherwise return the uppercase character.
1227 .RS
1228 .TP 5
1229 .B const char * \fIlabel
1230 is the label to test.
1231 .RE
1232 .\" ---------------------------------------------------------------------------
1233 .TP 5
1234 .B dlg_calc_list_width
1235 Calculate the minimum width for the list, assuming none of the items
1236 are truncated.
1237 .RS
1238 .TP 5
1239 .B int \fIitem_no
1240 is the number of \fIitems\fP.
1241 .TP 5
1242 .B DIALOG_LISTITEM * \fIitems
1243 contains a \fIname\fP and \fItext\fP field,
1244 e.g., for checklists or radiobox lists.
1245 The function returns the sum of the widest columns
1246 needed for of each of these fields.
1247 .RE
1248 .\" ---------------------------------------------------------------------------
1249 .TP 5
1250 .B dlg_calc_listh
1251 Calculate new height and list_height values.
1252 .RS
1253 .TP 5
1254 .B int * \fIheight
1255 on input, is the height without adding the list-height.
1256 On return, this contains the total list-height and is the
1257 actual widget's height.
1258 .TP 5
1259 .B int * \fIlist_height
1260 on input, is the requested list-height.
1261 On return, this contains the number of rows available for displaying
1262 the list after taking into account the screen size and
1263 the \fBdialog_vars.begin_set\fP and \fBdialog_vars.begin_y\fP variables.
1264 .TP 5
1265 .B int \fIitem_no
1266 is the number of \fIitems\fP in the list.
1267 .RE
1268 .\" ---------------------------------------------------------------------------
1269 .TP 5
1270 .B dlg_calc_listw
1271 This function is obsolete, provided for library-compatibility.
1272 It is replaced by \fIdlg_calc_list_width\fP.
1273 .RS
1274 .TP 5
1275 .B int \fIitem_no
1276 is the number of \fIitems\fP.
1277 .TP 5
1278 .B char ** \fIitems
1279 is a list of character pointers.
1280 .TP 5
1281 .B int \fIgroup
1282 is the number of items in each group, e.g., the second array index.
1283 .RE
1284 .\" ---------------------------------------------------------------------------
1285 .TP 5
1286 .B dlg_char_to_button
1287 Given a list of button labels,
1288 and a character which may be the abbreviation for one, find it, if it exists.
1289 An abbreviation will be the first character
1290 which happens to be capitalized in the label.
1291 If the character is found, return its index within the list of \fIlabels\fP.
1292 Otherwise, return \fBDLG_EXIT_UNKNOWN\fP.
1293 .RS
1294 .TP 5
1295 .B int \fIch
1296 is the character to find.
1297 .TP 5
1298 .B const char ** \fIlabels
1299 is a list of (pointers to) button labels terminated by a null pointer.
1300 .RE
1301 .\" ---------------------------------------------------------------------------
1302 .TP 5
1303 .B dlg_checklist
1304 This entrypoint provides the \fB--checklist\fP or \fP--radiolist\fP
1305 functionality without the limitations of \fBdialog\fP's command-line syntax
1306 (compare to \fBdialog_checklist\fP).
1307 .RS
1308 .TP 5
1309 .B const char * \fItitle
1310 is the title string to display at the top of the widget.
1311 .TP 5
1312 .B const char * \fIcprompt
1313 is the prompt text shown within the widget.
1314 .TP 5
1315 .B int \fIheight
1316 is the desired height of the box.
1317 If zero, the height is adjusted to use the available screen size.
1318 .TP 5
1319 .B int \fIwidth
1320 is the desired width of the box.
1321 If zero, the height is adjusted to use the available screen size.
1322 .TP 5
1323 .B int \fIlist_height
1324 is the minimum height to reserve for displaying the list.
1325 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1326 .TP 5
1327 .B int \fIitem_no
1328 is the number of \fIitems\fP.
1329 .TP 5
1330 .B DIALOG_LISTITEM * \fIitems
1331 This is a list of the items to display in the checklist.
1332 .TP 5
1333 .B const char * \fIstates
1334 This is a list of characters to display for the given states.
1335 Normally a checklist provides true (1) and false (0) values,
1336 which the widget displays as "*" and space, respectively.
1337 An application may set this parameter to an arbitrary null-terminated string.
1338 The widget determines the number of states from the length of this string,
1339 and will cycle through the corresponding display characters as the user
1340 presses the space-bar.
1341 .TP 5
1342 .B int \fIflag
1343 This is should be one of \fBFLAG_CHECK\fP or \fPFLAG_RADIO\fP,
1344 depending on whether the widget should act as a checklist or radiobox.
1345 .TP 5
1346 .B int * \fIcurrent_item
1347 The widget sets the referenced location to the index of the current display
1348 item (cursor) when it returns.
1349 .RE
1350 .\" ---------------------------------------------------------------------------
1351 .TP 5
1352 .B dlg_check_scrolled
1353 given a function key (or other key that was mapped to a function key),
1354 check if it is one of the up/down scrolling functions:
1355 .sp
1356 .RS
1357         DLGK_PAGE_FIRST,
1358 .br
1359         DLGK_PAGE_LAST,
1360 .br
1361         DLGK_GRID_UP,
1362 .br
1363         DLGK_GRID_DOWN,
1364 .br
1365         DLGK_PAGE_PREV or
1366 .br
1367         DLGK_PAGE_NEXT.
1368 .RE
1369 .fi
1370 .IP
1371 Some widgets use these key bindings for scrolling the prompt-text up and
1372 down, to allow for display in very small windows.
1373 .IP
1374 The function returns 0 (zero) if it finds one of these keys,
1375 and -1 if not.
1376 .RS
1377 .TP 5
1378 .B int \fIkey
1379 is the function-key to check
1380 .TP 5
1381 .B int \fIlast
1382 is the number of lines
1383 which would be used to display the scrolled prompt in
1384 an arbitrarily tall window.
1385 It is used here to check limits for the \fIoffset\fP value.
1386 .TP 5
1387 .B int \fIpage
1388 this is the available height for writing scrolled text,
1389 which is smaller than the window if it contains buttons.
1390 .TP 5
1391 .B bool * \fIshow
1392 on return, holds TRUE if \fBdlg_print_scrolled\fP should be used to redisplay
1393 the prompt text.
1394 .TP 5
1395 .B int * \fIoffset
1396 on entry, holds the starting line number (counting from zero)
1397 last used for \fBdlg_print_scrolled\fP.
1398 On return, holds the updated starting line number.
1399 .RE
1400 .\" ---------------------------------------------------------------------------
1401 .TP 5
1402 .B dlg_clear
1403 Set window to the default dialog screen attribute.
1404 This is set in the rc-file with \fBscreen_color\fP.
1405 .\" ---------------------------------------------------------------------------
1406 .TP 5
1407 .B dlg_clr_result
1408 Free storage used for the result buffer (\fBdialog_vars.input_result\fP).
1409 .\" ---------------------------------------------------------------------------
1410 .TP 5
1411 .B dlg_color_count
1412 Return the number of colors that can be configured in \fBdialog\fP.
1413 .\" ---------------------------------------------------------------------------
1414 .TP 5
1415 .B dlg_color_setup
1416 Initialize the color pairs used in \fBdialog\fP.
1417 .\" ---------------------------------------------------------------------------
1418 .TP 5
1419 .B dlg_count_columns
1420 Returns the number of columns used for a string.
1421 This is not necessarily the number of bytes in a string.
1422 .RS
1423 .TP 5
1424 .B const char * \fIstring
1425 is the string to measure.
1426 .RE
1427 .\" ---------------------------------------------------------------------------
1428 .TP 5
1429 .B dlg_count_wchars
1430 Returns the number of wide-characters in the string.
1431 .RS
1432 .TP 5
1433 .B const char * \fIstring
1434 is the string to measure.
1435 .RE
1436 .\" ---------------------------------------------------------------------------
1437 .TP 5
1438 .B dlg_create_rc
1439 Create a configuration file,
1440 i.e., write internal tables to a file which can be read back by \fBdialog\fP
1441 as an rc-file.
1442 .RS
1443 .TP 5
1444 .B const char * \fIfilename
1445 is the name of the file to write to.
1446 .RE
1447 .\" ---------------------------------------------------------------------------
1448 .TP 5
1449 .B dlg_ctl_size
1450 If \fBdialog_vars.size_err\fP is true,
1451 check if the given window size is too large to fit on the screen.
1452 If so, exit with an error reporting the size of the window.
1453 .RS
1454 .TP 5
1455 .B int \fIheight
1456 is the window's height
1457 .TP 5
1458 .B int \fIwidth
1459 is the window's width
1460 .RE
1461 .\" ---------------------------------------------------------------------------
1462 .TP 5
1463 .B dlg_default_formitem
1464 If \fBdialog_vars.default_item\fP is not null,
1465 find that name by matching the \fIname\fP field in the list of form \fIitems\fP.
1466 If found, return the index of that item in the list.
1467 Otherwise, return zero.
1468 .RS
1469 .TP 5
1470 .B DIALOG_FORMITEM * \fIitems
1471 is the list of items to search.
1472 It is terminated by an entry with a null \fIname\fP field.
1473 .RE
1474 .\" ---------------------------------------------------------------------------
1475 .TP 5
1476 .B dlg_default_item
1477 This function is obsolete, provided for library-compatibility.
1478 It is replaced by \fIdlg_default_formitem\fP and \fIdlg_default_listitem\fP.
1479 .RS
1480 .TP 5
1481 .B char ** \fIitems
1482 is the list of items to search.
1483 .TP 5
1484 .B int \fIllen
1485 is the number of items in each group, e.g., the second array index.
1486 .RE
1487 .\" ---------------------------------------------------------------------------
1488 .TP 5
1489 .B dlg_defaultno_button
1490 If \fBdialog_vars.defaultno\fP is true, and \fBdialog_vars.nocancel\fP is not,
1491 find the button-index for the "Cancel" button.
1492 Otherwise, return the index for "OK" (always zero).
1493 .\" ---------------------------------------------------------------------------
1494 .TP 5
1495 .B dlg_del_window
1496 Remove a window, repainting everything else.
1497 .RS
1498 .TP 5
1499 .B WINDOW * \fIwin
1500 is the window to remove.
1501 .RE
1502 .\" ---------------------------------------------------------------------------
1503 .TP 5
1504 .B dlg_does_output
1505 This is called each time a widget is invoked which may do output.
1506 It increments \fBdialog_state.output_count\fP,
1507 so the output function in \fBdialog\fP can test this and add a separator.
1508 .\" ---------------------------------------------------------------------------
1509 .TP 5
1510 .B dlg_draw_arrows
1511 Draw up/down arrows on a window, e.g., for scrollable lists.
1512 It calls \fBdlg_draw_arrows2\fP using the
1513 \fImenubox_color\fP and \fImenubox_border_color\fP attributes.
1514 .RS
1515 .TP 5
1516 .B WINDOW * \fIdialog
1517 is the window on which to draw an arrow.
1518 .TP 5
1519 .B int \fItop_arrow
1520 is true if an up-arrow should be drawn at the top of the window.
1521 .TP 5
1522 .B int \fIbottom_arrow
1523 is true if an down-arrow should be drawn at the bottom of the window.
1524 .TP 5
1525 .B int \fIx
1526 is the zero-based column within the window on which to draw arrows.
1527 .TP 5
1528 .B int \fItop
1529 is the zero-based row within the window on which to draw up-arrows
1530 as well as a horizontal line to show the window's top.
1531 .TP 5
1532 .B int \fIbottom
1533 is the zero-based row within the window on which to draw down-arrows
1534 as well as a horizontal line to show the window's bottom.
1535 .RE
1536 .\" ---------------------------------------------------------------------------
1537 .TP 5
1538 .B dlg_draw_arrows2
1539 Draw up/down arrows on a window, e.g., for scrollable lists.
1540 .RS
1541 .TP 5
1542 .B WINDOW * \fIdialog
1543 is the window on which to draw an arrow.
1544 .TP 5
1545 .B int \fItop_arrow
1546 is true if an up-arrow should be drawn at the top of the window.
1547 .TP 5
1548 .B int \fIbottom_arrow
1549 is true if an down-arrow should be drawn at the bottom of the window.
1550 .TP 5
1551 .B int \fIx
1552 is the zero-based column within the window on which to draw arrows.
1553 .TP 5
1554 .B int \fItop
1555 is the zero-based row within the window on which to draw up-arrows
1556 as well as a horizontal line to show the window's top.
1557 .TP 5
1558 .B int \fIbottom
1559 is the zero-based row within the window on which to draw down-arrows
1560 as well as a horizontal line to show the window's bottom.
1561 .TP 5
1562 .B chtype \fIattr
1563 is the window's background attribute.
1564 .TP 5
1565 .B chtype \fIborderattr
1566 is the window's border attribute.
1567 .RE
1568 .\" ---------------------------------------------------------------------------
1569 .TP 5
1570 .B dlg_draw_bottom_box
1571 Draw a partial box at the bottom of a window,
1572 e.g., to surround a row of buttons.
1573 It is designed to merge with an existing box around
1574 the whole window, so it uses tee-elements rather than corner-elements
1575 on the top corners of this box.
1576 .RS
1577 .TP 5
1578 .B WINDOW * \fIwin
1579 is the window to update.
1580 .RE
1581 .\" ---------------------------------------------------------------------------
1582 .TP 5
1583 .B dlg_draw_box
1584 Draw a rectangular box with line drawing characters.
1585 .RS
1586 .TP 5
1587 .B WINDOW * \fIwin
1588 is the window to update.
1589 .TP 5
1590 .B int \fIy
1591 is the top row of the box.
1592 .TP 5
1593 .B int \fIx
1594 is the left column of the box.
1595 .TP 5
1596 .B int \fIheight
1597 is the height of the box.
1598 .TP 5
1599 .B int \fIwidth
1600 is the width of the box.
1601 .TP 5
1602 .B chtype \fIboxchar
1603 is used to color the right/lower edges.
1604 It also is fill-color used for the box contents.
1605 .TP 5
1606 .B chtype \fIborderchar
1607 is used to color the upper/left edges.
1608 .RE
1609 .\" ---------------------------------------------------------------------------
1610 .TP 5
1611 .B dlg_draw_buttons
1612 Print a list of buttons at the given position.
1613 .RS
1614 .TP 5
1615 .B WINDOW * \fIwin
1616 is the window to update.
1617 .TP 5
1618 .B int \fIy
1619 is the starting row.
1620 .TP 5
1621 .B int \fIx
1622 is the starting column.
1623 .TP 5
1624 .B const char ** \fIlabels
1625 is a list of (pointers to) button labels terminated by a null pointer.
1626 .TP 5
1627 .B int \fIselected
1628 is the index within the list of the selected button.
1629 .TP 5
1630 .B int \fIvertical
1631 is true if the buttons are arranged in a column rather than a row.
1632 .TP 5
1633 .B int \fIlimit
1634 is the number of columns (or rows if \fIvertical\fP) allowed for the display.
1635 .RE
1636 .\" ---------------------------------------------------------------------------
1637 .TP 5
1638 .B dlg_draw_scrollbar
1639 If \fBdialog_state.use_scrollbar\fP is set,
1640 draw a scrollbar on the right margin of windows holding scrollable data.
1641 Also (whether or not the scrollbar is drawn),
1642 annotate the bottom margin of the window with the percentage of data
1643 by the bottom of that window,
1644 and call \fBdlg_draw_arrows2\fP to put markers on the window showing
1645 when more data is available.
1646 .RS
1647 .TP 5
1648 .B WINDOW * \fIwin
1649 is the window in which the data is scrolled.
1650 Because \fIleft\fP, \fIright\fP, \fItop\fP, \fIbottom\fP
1651 are passed as parameters, this window can contain additional data.
1652 .TP 5
1653 .B long \fIfirst_data
1654 is the zero-based index to the first row of data in the current window.
1655 .TP 5
1656 .B long \fIthis_data
1657 is the zero-based index to the current row of data.
1658 .TP 5
1659 .B long \fInext_data
1660 is the zero-based index to the next data after the current row.
1661 .TP 5
1662 .B long \fItotal_data
1663 is the total number of rows of data.
1664 .TP 5
1665 .B int \fIleft
1666 is the zero-based left margin/column of the window.
1667 The up/down arrows are draw inset by 5 columns from this point.
1668 .TP 5
1669 .B int \fIright
1670 is the zero-based right margin/column of the window.
1671 The scrollbar is drawn flush against this column.
1672 .TP 5
1673 .B int \fItop
1674 is the zero-based row within the window on which to draw up-arrows
1675 as well as a horizontal line to show the window's top.
1676 .TP 5
1677 .B int \fIbottom
1678 is the zero-based row within the window on which to draw down-arrows
1679 as well as a horizontal line to show the window's bottom.
1680 .TP 5
1681 .B chtype \fIattr
1682 is the window's background attribute.
1683 .TP 5
1684 .B chtype \fIborderattr
1685 is the window's border attribute.
1686 .RE
1687 .\" ---------------------------------------------------------------------------
1688 .TP 5
1689 .B dlg_draw_shadow
1690 Draw shadows along the right and bottom edge of a window to give it
1691 a 3-dimensional look.
1692 (The height, etc., may not be the same as the window's actual values).
1693 .RS
1694 .TP 5
1695 .B WINDOW * \fIwin
1696 is the window to update.
1697 .TP 5
1698 .B int \fIheight
1699 is the height of the window.
1700 .TP 5
1701 .B int \fIwidth
1702 is the width of the window.
1703 .TP 5
1704 .B int \fIy
1705 is the top row of the window.
1706 .TP 5
1707 .B int \fIx
1708 is the left column of the window.
1709 .RE
1710 .\" ---------------------------------------------------------------------------
1711 .TP 5
1712 .B dlg_draw_title
1713 Draw a title centered at the top of the window.
1714 .RS
1715 .TP 5
1716 .B WINDOW * \fIwin
1717 is the window to update.
1718 .TP 5
1719 .B const char * \fItitle
1720 is the title string to display at the top of the widget.
1721 .RE
1722 .\" ---------------------------------------------------------------------------
1723 .TP 5
1724 .B dlg_dump_keys
1725 Write all user-defined key-bindings to the given stream,
1726 e.g., as part of \fBdlg_create_rc\fP.
1727 .RS
1728 .TP 5
1729 .B FILE * \fIfp
1730 is the stream on which to write the bindings.
1731 .RE
1732 .\" ---------------------------------------------------------------------------
1733 .TP 5
1734 .B dlg_edit_offset
1735 Given the character-offset in the string,
1736 returns the display-offset where
1737 dialog should position the cursor.
1738 In this context, "characters" may be multicolumn,
1739 since the string can be a multibyte character string.
1740 .RS
1741 .TP 5
1742 .B char * \fIstring
1743 is the string to analyze
1744 .TP 5
1745 .B int \fIoffset
1746 is the character-offset
1747 .TP 5
1748 .B int \fIx_last
1749 is a limit on the column positions that can be used,
1750 e.g., the window's size.
1751 .RE
1752 .\" ---------------------------------------------------------------------------
1753 .TP 5
1754 .B dlg_edit_string
1755 Updates the string and character-offset, given various editing characters
1756 or literal characters which are inserted at the character-offset.
1757 Returns true if an editing change was made (and the display should
1758 be updated), and false if the key was something like KEY_ENTER,
1759 which is a non-editing action outside this function.
1760 .RS
1761 .TP 5
1762 .B char * \fIstring
1763 is the (multibyte) string to update
1764 .TP 5
1765 .B int * \fIoffset
1766 is the character-offset
1767 .TP 5
1768 .B int \fIkey
1769 is the editing key
1770 .TP 5
1771 .B int \fIfkey
1772 is true if the editing key is a function-key
1773 .TP 5
1774 .B bool \fIforce
1775 is used in a special loop case by calling code to force the return
1776 value of this function when a function-key code 0 is passed in.
1777 .RE
1778 .\" ---------------------------------------------------------------------------
1779 .TP 5
1780 .B dlg_exit
1781 Given an internal exit code,
1782 check if the corresponding environment variable is set.
1783 If so, remap the exit code to match the environment variable.
1784 Finally call \fBexit\fP with the resulting exit code.
1785 .RS
1786 .TP 5
1787 .B int \fIcode
1788 is the internal exit code, e.g., \fBDLG_EXIT_OK\fP,
1789 which may be remapped.
1790 .RE
1791 .IP
1792 The \fBdialog\fP program uses this function
1793 to allow shell scripts to remap the exit codes so they can distinguish ESC
1794 from ERROR.
1795 .\" ---------------------------------------------------------------------------
1796 .TP 5
1797 .B dlg_exit_buttoncode
1798 Map the given button index for \fBdlg_exit_label\fP into dialog's exit-code.
1799 .RS
1800 .TP 5
1801 .B int \fIbutton
1802 is the button index
1803 .RE
1804 .\" ---------------------------------------------------------------------------
1805 .TP 5
1806 .B dlg_exit_label
1807 Return a list of button labels.
1808 If dialog_var.extra_button is true, return the result of \fBdlg_ok_labels\fP.
1809 Otherwise, return a list with the "Exit" label and (if \fBdialog_vars.help_button\fP
1810 is set) the "Help" button as well.
1811 .\" ---------------------------------------------------------------------------
1812 .TP 5
1813 .B dlg_exiterr
1814 Quit program killing all \fBtailboxbg\fP widgets.
1815 .RS
1816 .TP 5
1817 .B const char * \fIfmt
1818 is the format of the \fBprintf\fP-like message to write.
1819 .TP 5
1820 .
1821 are the variables to apply to the \fIfmt\fP format.
1822 .RE
1823 .\" ---------------------------------------------------------------------------
1824 .TP 5
1825 .B dlg_find_index
1826 Given the character-offset to find in the list, return the corresponding
1827 array index.
1828 .RS
1829 .TP 5
1830 .B const int *\fIlist
1831 contains a list of character-offsets,
1832 i.e., indices into a string that denote the beginning of multibyte characters.
1833 .TP 5
1834 .B int \fIlimit
1835 is the last index into \fBlist\fP to search.
1836 .TP 5
1837 .B int \fIto_find
1838 is the character-offset to find.
1839 .RE
1840 .\" ---------------------------------------------------------------------------
1841 .TP 5
1842 .B dlg_flush_getc
1843 Cancel the local data saved by \fBdlg_last_getc\fP.
1844 .\" ---------------------------------------------------------------------------
1845 .IP dlg_editbox
1846 This entrypoint provides the \fB--editbox\fP
1847 functionality without the limitations of \fBdialog\fP's command-line syntax
1848 (compare to \fBdialog_editbox\fP).
1849 .RS
1850 .TP 5
1851 .B const char * \fItitle
1852 is the title string to display at the top of the widget.
1853 .TP 5
1854 .B char *** \fIlist
1855 is a pointer to an array of \fBchar\ *\fP pointers.
1856 The array is allocated by the caller,
1857 and so are the strings to which it points.
1858 The \fBdlg_editbox\fP function may reallocate the
1859 array and the strings.
1860 .TP 5
1861 .B int * \fIrows
1862 points to the nominal length of \fIlist\fP.
1863 The referenced value is updated if\fIlist\fP is reallocated.
1864 .TP 5
1865 .B int \fIheight
1866 is the desired height of the box.
1867 If zero, the height is adjusted to use the available screen size.
1868 .TP 5
1869 .B int \fIwidth
1870 is the desired width of the box.
1871 If zero, the height is adjusted to use the available screen size.
1872 .RE
1873 .\" ---------------------------------------------------------------------------
1874 .TP 5
1875 .B dlg_form
1876 This entrypoint provides the \fB--form\fP
1877 functionality without the limitations of \fBdialog\fP's command-line syntax
1878 (compare to \fBdialog_form\fP).
1879 .RS
1880 .TP 5
1881 .B const char * \fItitle
1882 is the title string to display at the top of the widget.
1883 .TP 5
1884 .B const char * \fIcprompt
1885 is the prompt text shown within the widget.
1886 .TP 5
1887 .B int \fIheight
1888 is the desired height of the box.
1889 If zero, the height is adjusted to use the available screen size.
1890 .TP 5
1891 .B int \fIwidth
1892 is the desired width of the box.
1893 If zero, the height is adjusted to use the available screen size.
1894 .TP 5
1895 .B int \fIform_height
1896 is the minimum height to reserve for displaying the list.
1897 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1898 .TP 5
1899 .B int \fIitem_no
1900 is the number of \fIitems\fP.
1901 .TP 5
1902 .B DIALOG_FORMITEM * \fIitems
1903 This is a list of the items to display in the form.
1904 .TP 5
1905 .B int * \fIcurrent_item
1906 The widget sets the referenced location to the index of the current display
1907 item (cursor) when it returns.
1908 .RE
1909 .\" ---------------------------------------------------------------------------
1910 .TP 5
1911 .B dlg_free_columns
1912 Free data allocated by \fBdlg_align_columns\fP.
1913 .RS
1914 .TP 5
1915 .B char **\fItarget
1916 This is the array which was reformatted.
1917 It points to the first string to free.
1918 .TP 5
1919 .B int \fIper_row
1920 This is the size of the struct for each row of the array.
1921 .TP 5
1922 .B int \fInum_rows
1923 This is the number of rows in the array.
1924 .RE
1925 .\" ---------------------------------------------------------------------------
1926 .TP 5
1927 .B dlg_free_formitems
1928 Free memory owned by a list of DIALOG_FORMITEM's.
1929 .RS
1930 .TP 5
1931 .B DIALOG_FORMITEM * \fIitems
1932 is the list to free.
1933 .RE
1934 .\" ---------------------------------------------------------------------------
1935 .TP 5
1936 .B dlg_getc
1937 Read a character from the given window.
1938 Handle repainting here (to simplify
1939 things in the calling application).
1940 Also, if input-callback(s) are set up,
1941 poll the corresponding files and handle the updates,
1942 e.g., for displaying a tailbox.
1943 Returns the key-code.
1944 .RS
1945 .TP 5
1946 .B WINDOW * \fIwin
1947 is the window within which to read.
1948 .TP 5
1949 .B int * \fIfkey
1950 as a side-effect, set this to true if the key-code is really a function-key.
1951 .RE
1952 .\" ---------------------------------------------------------------------------
1953 .TP 5
1954 .B dlg_getc_callbacks
1955 passes the given key-code \fIch\fP to the current window that
1956 has established a callback.
1957 If the callback returns zero, remove it and try the next window.
1958 If no more callbacks remain, return.
1959 If any callbacks were found, return true, otherwise false.
1960 .RS
1961 .TP 5
1962 .B int \fIch
1963 is the key-code
1964 .TP 5
1965 .B int \fIfkey
1966 is true if the key is a function-key
1967 .TP 5
1968 .B int * \fIresult
1969 is used to pass an exit-code to the caller,
1970 which should pass that via \fBdlg_exit\fP.
1971 .RE
1972 .\" ---------------------------------------------------------------------------
1973 .TP 5
1974 .B dlg_index_columns
1975 Build a list of the display-columns for the given multibyte string's characters.
1976 .RS
1977 .TP 5
1978 .B const char * \fIstring
1979 is the string to analyze
1980 .RE
1981 .\" ---------------------------------------------------------------------------
1982 .TP 5
1983 .B dlg_index_wchars
1984 Build an index of the wide-characters in the string,
1985 so the caller can easily tell
1986 which byte-offset begins a given wide-character.
1987 .RS
1988 .TP 5
1989 .B const char * \fIstring
1990 is the string to analyze
1991 .RE
1992 .\" ---------------------------------------------------------------------------
1993 .TP 5
1994 .B dlg_item_help
1995 Draw the string for the \fBdialog_vars.item_help\fP feature.
1996 .RS
1997 .TP 5
1998 .B const char * \fItxt
1999 is the help-message
2000 .RE
2001 .\" ---------------------------------------------------------------------------
2002 .TP 5
2003 .B dlg_killall_bg
2004 If \fBdialog\fP has callbacks active,
2005 purge the list of all that are not marked
2006 to keep in the background.
2007 If any remain, run those in a background process.
2008 .RS
2009 .TP 5
2010 .B int * \fIretval
2011 stores the exit-code to pass back to the caller.
2012 .RE
2013 .\" ---------------------------------------------------------------------------
2014 .TP 5
2015 .B dlg_last_getc
2016 returns the most recent character that was read via \fBdlg_getc\fP.
2017 .\" ---------------------------------------------------------------------------
2018 .TP 5
2019 .B dlg_limit_columns
2020 Given a column limit,
2021 count the number of wide characters that can fit into that limit.
2022 The offset is used to skip over a leading character
2023 that was already written.
2024 .RS
2025 .TP 5
2026 .B const char * \fIstring
2027 is the string to analyze
2028 .TP 5
2029 .B int \fIlimit
2030 is the column limit
2031 .TP 5
2032 .B int \fIoffset
2033 is the starting offset from which analysis should continue
2034 .RE
2035 .\" ---------------------------------------------------------------------------
2036 .TP 5
2037 .B dlg_lookup_key
2038 Check for a key-binding.
2039 If there is no binding associated with the widget, it simply returns
2040 the given curses-key.
2041 Otherwise, it returns the result of the binding
2042 .RS
2043 .TP 5
2044 .B WINDOW * \fIwin
2045 is the window on which the binding is checked
2046 .TP 5
2047 .B int \fIcurses_key
2048 is the curses key-code
2049 .TP 5
2050 .B int * \fIdialog_key
2051 is the corresponding dialog internal code
2052 (see \fBDLG_KEYS_ENUM\fP in dlg_key.h).
2053 .RE
2054 .\" ---------------------------------------------------------------------------
2055 .TP 5
2056 .B dlg_max_input
2057 Limit the parameter according to \fBdialog_vars.max_input\fP
2058 .RS
2059 .TP 5
2060 .B int \fImax_len
2061 is the value to limit
2062 .RE
2063 .\" ---------------------------------------------------------------------------
2064 .TP 5
2065 .B dlg_match_char
2066 Match a given character against the beginning of the string,
2067 ignoring case of the given character.
2068 The matching string must begin with an uppercase character.
2069 .RS
2070 .TP 5
2071 .B int \fIch
2072 is the character to check
2073 .TP 5
2074 .B const char * \fIstring
2075 is the string to search
2076 .RE
2077 .\" ---------------------------------------------------------------------------
2078 .TP 5
2079 .B dlg_menu
2080 This entrypoint provides the \fB--menu\fP
2081 functionality without the limitations of \fBdialog\fP's command-line syntax
2082 (compare to \fBdialog_menu\fP).
2083 .RS
2084 .TP 5
2085 .B const char * \fItitle
2086 is the title string to display at the top of the widget.
2087 .TP 5
2088 .B const char * \fIcprompt
2089 is the prompt text shown within the widget.
2090 .TP 5
2091 .B int \fIheight
2092 is the desired height of the box.
2093 If zero, the height is adjusted to use the available screen size.
2094 .TP 5
2095 .B int \fIwidth
2096 is the desired width of the box.
2097 If zero, the height is adjusted to use the available screen size.
2098 .TP 5
2099 .B int \fImenu_height
2100 is the minimum height to reserve for displaying the list.
2101 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
2102 .TP 5
2103 .B int \fIitem_no
2104 is the number of \fIitems\fP.
2105 .TP 5
2106 .B DIALOG_LISTITEM * \fIitems
2107 This is a list of the items to display in the form.
2108 .TP 5
2109 .B int * \fIcurrent_item
2110 The widget sets the referenced location to the index of the current display
2111 item (cursor) when it returns.
2112 .TP 5
2113 .B DIALOG_INPUTMENU \fIrename_menutext
2114 .RE
2115 .\" ---------------------------------------------------------------------------
2116 .TP 5
2117 .B dlg_move_window
2118 Moves/resizes the given window to the given position and size.
2119 .RS
2120 .TP 5
2121 .B WINDOW *\fIwin
2122 is the window to move/resize.
2123 .TP 5
2124 .B WINDOW *\fIheight
2125 is the height of the resized window.
2126 .TP 5
2127 .B WINDOW *\fIwidth
2128 is the width of the resized window.
2129 .TP 5
2130 .B WINDOW *\fIy
2131 y-ordinate to use for the repositioned window.
2132 .TP 5
2133 .B WINDOW *\fIx
2134 x-ordinate to use for the repositioned window.
2135 .RE
2136 .\" ---------------------------------------------------------------------------
2137 .TP 5
2138 .B dlg_mouse_bigregion
2139 Retrieve the big-region under the pointer.
2140 .RS
2141 .TP 5
2142 .B int \fIy
2143 is the row on which the mouse click occurred
2144 .TP 5
2145 .B int \fIx
2146 is the column on which the mouse click occurred
2147 .RE
2148 .\" ---------------------------------------------------------------------------
2149 .TP 5
2150 .B dlg_mouse_free_regions
2151 Free the memory associated with mouse regions.
2152 .\" ---------------------------------------------------------------------------
2153 .TP 5
2154 .B dlg_mouse_mkbigregion
2155 Creates a region on which the mouse-clicks will return a specifed code.
2156 .RS
2157 .TP 5
2158 .B int \fIy
2159 is the top-row of the region.
2160 .TP 5
2161 .B int \fIx
2162 is the left-column of the region.
2163 .TP 5
2164 .B int \fIheight
2165 is the height of the region.
2166 .TP 5
2167 .B int \fIwidth
2168 is the width of the region.
2169 .TP 5
2170 .B int \fIcode
2171 is a code used to make the region unique within a widget
2172 .TP 5
2173 .B int \fIstep_x
2174 is used in modes 2 (columns) and 3 (cells) to determine the width
2175 of a column/cell.
2176 .TP 5
2177 .B int \fIstep_y
2178 is currently unused
2179 .TP 5
2180 .B int \fImode
2181 is used to determine how the mouse position is translated into
2182 a code (like a function-key):
2183 .RS
2184 .TP
2185 1
2186 index by lines
2187 .TP
2188 2
2189 index by columns
2190 .TP
2191 3
2192 index by cells
2193 .RE
2194 .RE
2195 .\" ---------------------------------------------------------------------------
2196 .TP 5
2197 .B dlg_mouse_mkregion
2198 .RS
2199 .TP 5
2200 .B int \fIy
2201 is the top-row of the region.
2202 .TP 5
2203 .B int \fIx
2204 is the left-column of the region.
2205 .TP 5
2206 .B int \fIheight
2207 is the height of the region.
2208 .TP 5
2209 .B int \fIwidth
2210 is the width of the region.
2211 .TP 5
2212 .B int \fIcode
2213 is a code used to make the region unique within a widget
2214 .RE
2215 .\" ---------------------------------------------------------------------------
2216 .TP 5
2217 .B dlg_mouse_region
2218 Retrieve the frame under the mouse pointer
2219 .RS
2220 .TP 5
2221 .B int \fIy
2222 is the row of the mouse-click
2223 .TP 5
2224 .B int \fIx
2225 is the column of the mouse-click
2226 .RE
2227 .\" ---------------------------------------------------------------------------
2228 .TP 5
2229 .B dlg_mouse_setbase
2230 Sets a base for subsequent calls to \fBdlg_mouse_mkregion\fP,
2231 so they can make regions relative to the start of a given window.
2232 .RS
2233 .TP 5
2234 .B int \fIx
2235 is the left-column for the base
2236 .TP 5
2237 .B int \fIy
2238 is the top-row for the base
2239 .RE
2240 .\" ---------------------------------------------------------------------------
2241 .TP 5
2242 .B dlg_mouse_wgetch
2243 is a wrapper for \fBdlg_getc\fP which additionally maps mouse-clicks
2244 (if the curses library supports those) into extended function-keys
2245 which encode the position according to the \fImode\fP in
2246 \fBdlg_mouse_mkbigregion\fP.
2247 Returns the corresponding key-code.
2248 .RS
2249 .TP 5
2250 .B WINDOW * \fIwin
2251 is the window on which to perform the input
2252 .TP 5
2253 .B int * \fIfkey
2254 the referenced location is set to true if the key-code is an actual
2255 or extended (mouse) function-key.
2256 .RE
2257 .\" ---------------------------------------------------------------------------
2258 .TP 5
2259 .B dlg_mouse_wgetch_nowait
2260 This is a non-blocking variant of \fBdlg_mouse_wgetch\fP.
2261 .RS
2262 .TP 5
2263 .B WINDOW * \fIwin
2264 is the window on which to perform the input
2265 .TP 5
2266 .B int * \fIfkey
2267 the referenced location is set to true if the key-code is an actual
2268 or extended (mouse) function-key.
2269 .RE
2270 .\" ---------------------------------------------------------------------------
2271 .TP 5
2272 .B dlg_need_separator
2273 Check if an output-separator is needed.
2274 If \fBdialog_vars.output_separator\fP is set, return true.
2275 Otherwise, if \fBdialog_vars.input_result\fP is nonempty, return true.
2276 If neither, return false.
2277 .\" ---------------------------------------------------------------------------
2278 .TP 5
2279 .B dlg_new_modal_window
2280 Create a modal window, optionally with a shadow.
2281 The shadow is created if \fBdialog_state.use_shadow\fP is true.
2282 .RS
2283 .TP 5
2284 .B WINDOW * \fIparent
2285 is the parent window (usually the top-level window of a widget)
2286 .TP 5
2287 .B int \fIheight
2288 is the window's height
2289 .TP 5
2290 .B int \fIwidth
2291 is the window's width
2292 .TP 5
2293 .B int \fIy
2294 is the window's top-row
2295 .TP 5
2296 .B int \fIx
2297 is the window's left-column
2298 .RE
2299 .\" ---------------------------------------------------------------------------
2300 .TP 5
2301 .B dlg_new_window
2302 Create a window, optionally with a shadow.
2303 The shadow is created if \fBdialog_state.use_shadow\fP is true.
2304 .RS
2305 .TP 5
2306 .B int \fIheight
2307 is the window's height
2308 .TP 5
2309 .B int \fIwidth
2310 is the window's width
2311 .TP 5
2312 .B int \fIy
2313 is the window's top-row
2314 .TP 5
2315 .B int \fIx
2316 is the window's left-column
2317 .RE
2318 .\" ---------------------------------------------------------------------------
2319 .TP 5
2320 .B dlg_next_button
2321 Return the next index in the list of labels.
2322 .RS
2323 .TP 5
2324 .B const char ** \fIlabels
2325 is a list of (pointers to) button labels terminated by a null pointer.
2326 .TP 5
2327 .B int \fIbutton
2328 is the current button-index.
2329 .RE
2330 .\" ---------------------------------------------------------------------------
2331 .TP 5
2332 .B dlg_next_ok_buttonindex
2333 Assuming that the caller is using \fBdlg_ok_labels\fP to list buttons,
2334 find the next index in the list of buttons.
2335 .RS
2336 .TP 5
2337 .B int \fIcurrent
2338 is the current index in the list of buttons
2339 .TP 5
2340 .B int \fIextra
2341 if negative, provides a way to enumerate extra active areas on the widget.
2342 .RE
2343 .\" ---------------------------------------------------------------------------
2344 .TP 5
2345 .B dlg_ok_buttoncode
2346 Map the given button index for \fBdlg_ok_labels\fP
2347 into \fBdialog\fP's exit-code.
2348 .RS
2349 .TP 5
2350 .B int \fIbutton
2351 is the button-index (which is not necessarily the same as the index
2352 in the list of labels).
2353 .RE
2354 .\" ---------------------------------------------------------------------------
2355 .TP 5
2356 .B dlg_ok_label
2357 Returns a list with the "Ok" label,
2358 and if \fBdialog_vars.help_button\fP is true, the "Help" label as well.
2359 .\" ---------------------------------------------------------------------------
2360 .TP 5
2361 .B dlg_ok_labels
2362 Return a list of button labels for the OK/Cancel group of widgets.
2363 .\" ---------------------------------------------------------------------------
2364 .TP 5
2365 .B dlg_ordinate
2366 Decode the string as an integer, decrement if greater than zero to make
2367 a curses-ordinate from a dialog-ordinate.
2368 .\" ---------------------------------------------------------------------------
2369 .TP 5
2370 .B dlg_parse_bindkey
2371 Parse the parameters of the "bindkeys" configuration-file entry.  This
2372 expects widget name which may be "*", followed by curses key definition and
2373 then dialog key definition.
2374 .RS
2375 .TP 5
2376 .B char * \fIparams
2377 is the parameter string to parse.
2378 .RE
2379 .\" ---------------------------------------------------------------------------
2380 .TP 5
2381 .B dlg_parse_rc
2382 Parse the configuration file and set up variables.
2383 .\" ---------------------------------------------------------------------------
2384 .TP 5
2385 .B dlg_prev_button
2386 Return the previous index in the list of labels.
2387 .RS
2388 .TP 5
2389 .B const char ** \fIlabels
2390 is a list of (pointers to) button labels terminated by a null pointer.
2391 .TP 5
2392 .B int \fIbutton
2393 is the current button index
2394 .RE
2395 .\" ---------------------------------------------------------------------------
2396 .TP 5
2397 dlg_print_scrolled
2398 This is a wrapper for \fBdlg_print_autowrap\fP which allows the user
2399 to scroll too-long prompt text up/down.
2400 .IP
2401 See \fBdlg_check_scrolled\fP for a function which updates the \fIoffset\fP
2402 variable used as a parameter here.
2403 It complements this function; you need both.
2404 If \fIpauseopt\fP is set, this function returns an updated \fIlast\fP
2405 parameter, needed for \fBdlg_check_scrolled\fP calls.
2406 .RS
2407 .TP 5
2408 .B WINDOW * \fIwin
2409 is the window to update.
2410 .TP 5
2411 .B const char * \fIprompt
2412 is the string to print
2413 .TP 5
2414 .B int \fIoffset
2415 is the starting line-number to write wrapped text.
2416 .TP 5
2417 .B int \fIheight
2418 is the available height for writing the wrapped text
2419 .TP 5
2420 .B int \fIwidth
2421 is the width that the wrapping should occur in
2422 .TP 5
2423 .B int \fIpauseopt
2424 is true if the extra functionality for scrolling should be enabled.
2425 If false, this calls \fBdlg_print_autowrap\fP without doing any scrolling.
2426 .RE
2427 .\" ---------------------------------------------------------------------------
2428 .TP 5
2429 .B dlg_print_line
2430 Print one line of the prompt in the window within the limits of the
2431 specified right margin.
2432 The line will end on a word boundary and a pointer
2433 to the start of the next line is returned, or a NULL pointer if the end of
2434 *prompt is reached.
2435 .RS
2436 .TP 5
2437 .B WINDOW *\fIwin
2438 is the window to update.
2439 .TP 5
2440 .B chtype *\fIattr
2441 holds the starting attributes, and is updated to reflect the final attributes
2442 applied to the string.
2443 .TP 5
2444 .B const char *\fIprompt
2445 is the string to print
2446 .TP 5
2447 .B int \fIlm
2448 is the left margin.
2449 .TP 5
2450 .B int \fIrm
2451 is the right margin
2452 .TP 5
2453 .B int *\fIx
2454 returns the ending x-ordinate.
2455 .RE
2456 .\" ---------------------------------------------------------------------------
2457 .TP 5
2458 .B dlg_prev_ok_buttonindex
2459 Find the previous button index in the list from \fBdlg_ok_labels\fP.
2460 .RS
2461 .TP 5
2462 .B int \fIcurrent
2463 is the current index
2464 .TP 5
2465 .B int \fIextra
2466 if negative provides a way to enumerate extra active areas on the widget.
2467 .RE
2468 .\" ---------------------------------------------------------------------------
2469 .TP 5
2470 .B dlg_print_autowrap
2471 Print a string of text in a window, automatically wrap around to the next
2472 line if the string is too long to fit on one line.
2473 Note that the string may contain embedded newlines.
2474 The text is written starting at the top of the window.
2475 .RS
2476 .TP 5
2477 .B WINDOW * \fIwin
2478 is the window to update.
2479 .TP 5
2480 .B const char * \fIprompt
2481 is the string to print
2482 .TP 5
2483 .B int \fIheight
2484 is the nominal height the wrapped string is limited to
2485 .TP 5
2486 .B int \fIwidth
2487 is the width that the wrapping should occur in
2488 .RE
2489 .\" ---------------------------------------------------------------------------
2490 .TP 5
2491 .B dlg_print_size
2492 If \fBdialog_vars.print_siz\fP is true,
2493 print the given height/width (from a widget)
2494 to \fBdialog_state.output\fP, e.g.,
2495 \fBSize: height, width\fP.
2496 .RS
2497 .TP 5
2498 .B int \fIheight
2499 is the window's height
2500 .TP 5
2501 .B int \fIwidth
2502 is the window's width
2503 .RE
2504 .\" ---------------------------------------------------------------------------
2505 .TP 5
2506 .B dlg_print_text
2507 Print up to \fIcols\fP columns from \fBtext\fP,
2508 optionally rendering \fBdialog\fP's escape sequences for attributes and color.
2509 .RS
2510 .TP 5
2511 .B WINDOW * \fIwin
2512 is the window to update.
2513 .TP 5
2514 .B const char * \fItxt
2515 is the string to print
2516 .TP 5
2517 .B int \fIcol
2518 is the column limit
2519 .TP 5
2520 .B chtype * \fIattr
2521 holds the starting attributes, and is updated to reflect the final attributes
2522 applied to the string.
2523 .RE
2524 .\" ---------------------------------------------------------------------------
2525 .TP 5
2526 .B dlg_put_backtitle
2527 Display the background title if \fBdialog_vars.backtitle\fP is non-null.
2528 The background title is shown at the top of the screen.
2529 .\" ---------------------------------------------------------------------------
2530 .TP 5
2531 .B dlg_register_buttons
2532 The widget developer should call this function after \fBdlg_register_window\fP,
2533 for the list of button labels associated with the widget.
2534 One may bind a key to a button, e.g., "OK" for \fBDLGK_OK\fP,
2535 .RS
2536 .TP 5
2537 .B WINDOW * \fIwin
2538 is the window with which to associate the buttons
2539 .TP 5
2540 .B const char * \fIname
2541 is the widget's binding name (usually the name of the widget).
2542 .TP 5
2543 .B const char ** \fIbuttons
2544 is the list of buttons
2545 .RE
2546 .\" ---------------------------------------------------------------------------
2547 .TP 5
2548 .B dlg_register_window
2549 For a given named widget's window, associate a binding table.
2550 .RS
2551 .TP 5
2552 .B WINDOW * \fIwin
2553 is the window with which to associate the buttons
2554 .TP 5
2555 .B const char * \fIname
2556 is the widget's binding name (usually the name of the widget).
2557 .TP 5
2558 .B DLG_KEYS_BINDING * \fIbinding
2559 is the binding table
2560 .RE
2561 .\" ---------------------------------------------------------------------------
2562 .TP 5
2563 .B dlg_remove_callback
2564 Remove a callback.
2565 .RS
2566 .TP 5
2567 .B DIALOG_CALLBACK \fI* p
2568 contains the callback information.
2569 .RE
2570 .\" ---------------------------------------------------------------------------
2571 .TP 5
2572 .B dlg_restore_vars
2573 Restore dialog's variables from the given variable (see \fBdialog_save_vars\fP).
2574 .RS
2575 .TP 5
2576 .B DIALOG_VARS * \fIsave
2577 is the variable from which to restore.
2578 .RE
2579 .\" ---------------------------------------------------------------------------
2580 .TP 5
2581 .B dlg_result_key
2582 Test a dialog internal keycode to see if it corresponds to one of the push
2583 buttons on the widget such as "OK".
2584 This is only useful if there are user-defined key bindings, since there are
2585 no built-in bindings that map directly to \fBDLGK_OK\fP, etc.
2586 Return true if a mapping was done.
2587 .RS
2588 .TP 5
2589 .B int \fIdialog_key
2590 is the dialog key to test
2591 .TP 5
2592 .B int \fIfkey
2593 is true if this is a function key
2594 .TP 5
2595 .B int * \fIresultp
2596 store the result of the mapping in the referenced location.
2597 .RE
2598 .\" ---------------------------------------------------------------------------
2599 .TP 5
2600 .B dlg_save_vars
2601 Save dialog's variables into the given variable (see \fBdialog_restore_vars\fP).
2602 .RS
2603 .TP 5
2604 .B DIALOG_VARS * \fIsave
2605 is the variable into which to save.
2606 .RE
2607 .\" ---------------------------------------------------------------------------
2608 .TP 5
2609 .B dlg_set_focus
2610 Set focus on the given window,
2611 making it display above other windows on the screen.
2612 .RS
2613 .TP 5
2614 .B WINDOW * \fIparent
2615 is the parent window (usually the top-level window of a widget)
2616 .TP 5
2617 .B WINDOW * \fIwin
2618 is the window on which to place focus (usually a subwindow of a widget)
2619 .RE
2620 .\" ---------------------------------------------------------------------------
2621 .TP 5
2622 .B dlg_set_result
2623 Setup a fixed-buffer for the result in \fBdialog_vars.input_result\fP 
2624 .RS
2625 .TP 5
2626 .B const char * \fIstring
2627 is the new contents for the result
2628 .RE
2629 .\" ---------------------------------------------------------------------------
2630 .TP 5
2631 .B dlg_show_string
2632 Displays the string, shifted as necessary, to fit within the box and show
2633 the current character-offset.
2634 .RS
2635 .TP 5
2636 .B WINDOW * \fIwin
2637 is the window within which to display
2638 .TP 5
2639 .B const char * \fIstring
2640 is the string to display
2641 .TP 5
2642 .B int \fIoffset
2643 is the starting (character, not bytes) offset
2644 .TP 5
2645 .B chtype \fIattr
2646 is the window attribute to use for the string
2647 .TP 5
2648 .B int \fIy_base
2649 beginning row on screen
2650 .TP 5
2651 .B int \fIx_base
2652 beginning column on screen
2653 .TP 5
2654 .B int \fIx_last
2655 number of columns on screen
2656 .TP 5
2657 .B bool \fIhidden
2658 if true, do not echo input
2659 .TP 5
2660 .B bool \fIforce
2661 if true, force repaint
2662 .RE
2663 .\" ---------------------------------------------------------------------------
2664 .TP 5
2665 .B dlg_strclone
2666 duplicate the string, like \fBstrdup\fP.
2667 .RS
2668 .TP 5
2669 .B const char * \fIcprompt
2670 is the string to duplicate
2671 .RE
2672 .\" ---------------------------------------------------------------------------
2673 .TP 5
2674 .B dlg_strcmp
2675 compare two strings, ignoring case.
2676 .RS
2677 .TP 5
2678 .B const char \fI* a
2679 is one string
2680 .TP 5
2681 .B const char \fI* b
2682 is the other string
2683 .RE
2684 .\" ---------------------------------------------------------------------------
2685 .TP 5
2686 .B dlg_sub_window
2687 create a subwindow, e.g., for an input area of a widget
2688 .RS
2689 .TP 5
2690 .B WINDOW * \fIwin
2691 is the parent window
2692 .TP 5
2693 .B int \fIheight
2694 is the subwindow's height
2695 .TP 5
2696 .B int \fIwidth
2697 is the subwindow's width
2698 .TP 5
2699 .B int \fIy
2700 is the subwindow's top-row
2701 .TP 5
2702 .B int \fIx
2703 is the subwindow's left-column
2704 .RE
2705 .\" ---------------------------------------------------------------------------
2706 .TP 5
2707 .B dlg_tab_correct_str
2708 If the \fBdialog_vars.tab_correct\fP is true, convert tabs to single spaces.
2709 Return the converted result.
2710 The caller is responsible for freeing the string.
2711 .RS
2712 .TP 5
2713 .B char * \fIprompt
2714 is the string to convert
2715 .RE
2716 .\" ---------------------------------------------------------------------------
2717 .TP 5
2718 .B dlg_trace
2719 If the parameter is non-null, opens a trace file with that
2720 name and stores the file pointer in \fBdialog_state.trace\fP.
2721 .\" ---------------------------------------------------------------------------
2722 .TP 5
2723 .B dlg_trace_chr
2724 If \fBdialog_state.trace\fP is set, 
2725 translate the parameters into a printable representation,
2726 log it on a "chr" line.
2727 .RS
2728 .TP 5
2729 .B int ch
2730 is the nominal keycode value.
2731 .TP 5
2732 .B int fkey
2733 is nonzero if the value is really a function key.
2734 Some of these may be values declared in the DLG_KEYS_ENUM.
2735 .RE
2736 .\" ---------------------------------------------------------------------------
2737 .TP 5
2738 .B dlg_trace_win
2739 If \fBdialog_state.trace\fP is set, 
2740 log a printable picture of the given window.
2741 .\" ---------------------------------------------------------------------------
2742 .TP 5
2743 .B dlg_trim_string
2744 Change embedded "\\n" substrings to '\\n' characters and tabs to single spaces.
2745 If there are no "\\n"s, the function strips all extra spaces, for justification.
2746 If it has "\\n"'s, the function preserves extra spaces.
2747 If \fBdialog_vars.cr_wrap\fP is set, the function preserves '\\n's.
2748 .RS
2749 .TP 5
2750 .B char * \fIsrc
2751 is the string to trim
2752 .RE
2753 .\" ---------------------------------------------------------------------------
2754 .TP 5
2755 .B dlg_unregister_window
2756 Remove the bindings for a given window.
2757 .RS
2758 .TP 5
2759 .B WINDOW * \fIwin
2760 is the window from which to remove bindings
2761 .RE
2762 .\" ---------------------------------------------------------------------------
2763 .TP 5
2764 .B dlg_yes_buttoncode
2765 Map the given button index for \fBdlg_yes_labels\fP into \fBdialog\fP's exit-code.
2766 .RS
2767 .TP 5
2768 .B int \fIbutton
2769 is the button index
2770 .RE
2771 .\" ---------------------------------------------------------------------------
2772 .TP 5
2773 .B dlg_yes_labels
2774 Return a list of buttons for Yes/No labels.
2775 .
2776 .\" ************************************************************************
2777 .SH SEE ALSO
2778 dialog (1).
2779 .
2780 .\" ************************************************************************
2781 .SH AUTHOR
2782 Thomas E. Dickey