Merge branch 'vendor/OPENSSL'
[dragonfly.git] / contrib / dialog / dialog.3
1 '\" t
2 .\" $Id: dialog.3,v 1.90 2012/12/23 22:16:50 tom Exp $
3 .\" Copyright 2005-2011,2012  Thomas E. Dickey
4 .\"
5 .\" This program is free software; you can redistribute it and/or modify
6 .\" it under the terms of the GNU Lesser General Public License, version 2.1
7 .\" as published by the Free Software Foundation.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" Lesser General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU Lesser General Public
15 .\" License along with this program; if not, write to
16 .\"     Free Software Foundation, Inc.
17 .\"     51 Franklin St., Fifth Floor
18 .\"     Boston, MA 02110, USA.
19 .\"
20 .\" definitions for renaming
21 .ds p dialog
22 .ds l dialog
23 .ds L Dialog
24 .ds D DIALOG
25 .
26 .de ES
27 .ne 8
28 .IP
29 ..
30 .de EX
31 .RS +10
32 .nf
33 ..
34 .de EE
35 .fi
36 .RE
37 ..
38 .\" Bulleted paragraph
39 .de bP
40 .IP \(bu 4
41 ..
42 .TH \*D 3 "" "$Date: 2012/12/23 22:16:50 $"
43 .SH NAME
44 dialog \- widgets and utilities for the \*p program
45 .SH SYNOPSIS
46 .B cc [ flag ... ] file ...  -l\*l [ library ... ]
47 .br
48 \ \ \ or
49 .br
50 .B cc `\*p-config --cflags` file ... `\*p-config --libs` ]
51 .sp
52 .B #include <\*l.h>
53 .PP
54 \fB\*L\fP
55 is a program that will let you to present a variety of questions or
56 display messages using dialog boxes from a shell script.
57 It is built from the \fB\*l\fP library,
58 which consists of several widgets
59 as well as utility functions that are used by the widgets
60 or the main program.
61 .
62 .SH DESCRIPTION
63 This manpage documents the features from \fI<\*l.h>\fP which
64 are likely to be important to developers using the widgets directly.
65 Some hints are also given for developing new widgets.
66 .
67 .\" ************************************************************************
68 .SH DEFINITIONS
69 Exit codes (passed back to the main program for its use)
70 are defined with a "\fIDLG_EXIT_\fP prefix.
71 The defined constants can be mapped using environment variables
72 as described in \fB\*p\fP(1),
73 e.g., \fIDLG_EXIT_OK\fP corresponds to \fI$DIALOG_OK\fP.
74 .PP
75 Useful character constants which correspond to user input
76 are named with the "\fICHR_\fP" prefix, e.g.,
77 \fICHR_BACKSPACE\fP.
78 .PP
79 Colors and video attributes are categorized and associated with
80 settings in the configuration file
81 (see the discussion of \fI$DIALOGRC\fP in \fB\*p\fP(1)).
82 The \fIDIALOG_ATR(n)\fP macro is used for defining the references
83 to the combined color and attribute table \fBdlg_color_table[]\fP.
84 .PP
85 The \fB\*p\fP application passes its command-line parameters
86 to the widget functions.  Some of those parameters are single values,
87 but some of the widgets accept data as an array of values.
88 Those include checklist/radiobox, menubox and formbox.
89 When the \fB--item-help\fP option is given, an extra column
90 of data is expected.
91 The USE_ITEM_HELP(), CHECKBOX_TAGS, MENUBOX_TAGS and FORMBOX_TAGS
92 macros are used to hide this difference from the calling application.
93 .PP
94 Most of the other definitions found in \fI<\*l.h>\fP
95 are used for convenience in building the library or main program.
96 These include definitions based on the generated \fI<dlg_config.h>\fP header.
97
98 .\" ************************************************************************
99 .SH DATA STRUCTURES
100 All of the global data for the \fB\*l\fP library is stored in
101 a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
102 The corresponding \fBdialog_state\fP, \fBdialog_vars\fP and \fBdlg_color_table\fP
103 global variables should be initialized to zeros,
104 and then populated with the data to use.
105 A few of these must be nonzero for the corresponding widgets to function.
106 As as the case with function names,
107 variables beginning with "\fIdialog_\fP"
108 are designed for use by the calling application
109 while variables beginning with "\fIdlg_\fP"
110 are intended for lower levels, e.g., by the \fB\*l\fP library.
111 .\" ---------------------------------------------------------------------------
112 .IP \fIDIALOG_STATE.all_subwindows
113 This is a linked list of all subwindows created by the library.
114 The \fBdlg_del_window\fP function uses this
115 to free storage for subwindows when deleting a window.
116 .\" ---------------------------------------------------------------------------
117 .IP \fIDIALOG_STATE.all_windows
118 This is a linked list of all windows created by the library.
119 The \fBdlg_del_window\fP function uses this to locate windows which
120 may be redrawn after deleting a window.
121 .\" ---------------------------------------------------------------------------
122 .IP \fIDIALOG_STATE.aspect_ratio
123 This corresponds to the command-line option "\fB--aspect-ratio\fP".
124 The value gives the application
125 some control over the box dimensions when using auto
126 sizing (specifying 0 for height and width).
127 It represents width / height.
128 The default is 9, which means 9 characters wide to every 1 line high.
129 .\" ---------------------------------------------------------------------------
130 .IP \fIDIALOG_STATE.getc_callbacks
131 This is setup in \fIui_getc.c\fP to record windows which must be polled
132 for input, e.g,. to handle the background tailbox widget.
133 One window is designated as the foreground or control window.
134 .\" ---------------------------------------------------------------------------
135 .IP \fIDIALOG_STATE.getc_redirect
136 If the control window for \fIDIALOG_STATE.getc_callbacks\fP is
137 closed, the list is transferred to this variable.
138 Closing all windows causes the application to exit.
139 .\" ---------------------------------------------------------------------------
140 .IP \fIDIALOG_STATE.no_mouse
141 This corresponds to the command-line option "\fB--no-mouse\fP".
142 If true, \fB\*p\fP will not initialize (and enable) the mouse in
143 \fIinit_dialog\fP.
144 .\" ---------------------------------------------------------------------------
145 .IP \fIDIALOG_STATE.output
146 This is set in the \fB\*p\fP application to the stream on
147 which the application and library functions may write text results.
148 Normally that is the standard error,
149 since the curses library prefers to write its data to the standard output.
150 Some scripts, trading portability for convenience,
151 prefer to write results to the standard output,
152 e.g., by using the "\fB--stdout\fP" option.
153 .\" ---------------------------------------------------------------------------
154 .IP \fIDIALOG_STATE.output_count
155 This is incremented by \fBdlg_does_output\fP,
156 which is called by each widget that writes text to the output.
157 The \fB\*p\fP application uses that to decide if it should
158 also write a separator, i.e.,
159 \fIDIALOG_STATE.separate_str\fP,
160 between calls to each widget.
161 .\" ---------------------------------------------------------------------------
162 .IP \fIDIALOG_STATE.pipe_input
163 This is set in \fIinit_dialog\fP to a stream which can be used by the
164 \fBgauge\fP widget, which must be the application's standard input.
165 The \fB\*p\fP application calls \fIinit_dialog\fP normally with
166 \fIinput\fP set to the standard input, but optionally based on the
167 "\fB--input-fd\fP" option.
168 Since the application cannot read from
169 a pipe (standard input) and at the same time read
170 the curses input from the standard input,
171 it must allow for reopening the latter from either
172 a specific file descriptor,
173 or directly from the terminal.
174 The adjusted pipe stream value is stored in this variable.
175 .\" ---------------------------------------------------------------------------
176 .IP \fIDIALOG_STATE.screen_initialized
177 This is set in \fIinit_dialog\fP and
178 reset in \fIend_dialog\fP.
179 It is used to check if curses has been initialized,
180 and if the \fIendwin\fP function must be called on exit.
181 .\" ---------------------------------------------------------------------------
182 .IP \fIDIALOG_STATE.screen_output
183 This is set in \fIinit_dialog\fP to the output stream used
184 by the curses library.
185 Normally that is the standard output,
186 unless that happens to not be a terminal (and if \fIinit_dialog\fP can
187 successfully open the terminal directly).
188 .\" ---------------------------------------------------------------------------
189 .IP \fIDIALOG_STATE.separate_str
190 This corresponds to the command-line option "\fB--separate-widget\fP".
191 The given string
192 specifies a string that will separate the output on \fB\*p\fP's output from
193 each widget.
194 This is used to simplify parsing the result of a dialog with several widgets.
195 If this option is not given,
196 the default separator string is a tab character.
197 .\" ---------------------------------------------------------------------------
198 .IP \fIDIALOG_STATE.tab_len
199 This corresponds to the command-line option "\fB--tab-len\fP \fInumber\fP".
200 Specify the number of spaces that a tab character occupies if the
201 "\fB--tab-correct\fP"
202 option is given.
203 The default is 8.
204 .\" ---------------------------------------------------------------------------
205 .IP \fIDIALOG_STATE.trace_output
206 This corresponds to the command-line option "\fB--trace\fP \fIfile\fP".
207 It is the file pointer to which trace messages are written.
208 .\" ---------------------------------------------------------------------------
209 .IP \fIDIALOG_STATE.use_colors
210 This is set in \fIinit_dialog\fP if the curses implementation supports color.
211 .\" ---------------------------------------------------------------------------
212 .IP \fIDIALOG_STATE.use_scrollbar
213 This corresponds to the command-line option "\fB--scrollbar\fP".
214 If true,
215 draw a scrollbar to make windows holding scrolled data more readable.
216 .\" ---------------------------------------------------------------------------
217 .IP \fIDIALOG_STATE.use_shadow
218 This corresponds to the command-line option "\fB--no-shadow\fP".
219 This is set in \fIinit_dialog\fP if the curses implementation supports color.
220 If true,
221 suppress shadows that would be drawn to the right and bottom of each dialog box.
222 .\" ---------------------------------------------------------------------------
223 .IP \fIDIALOG_STATE.visit_items
224 This corresponds to the command-line option "\fB--visit-items\fP".
225 .\" ---------------------------------------------------------------------------
226 .PP
227 The \fB\*p\fP application resets the \fBdialog_vars\fP data before
228 accepting options to invoke each widget.
229 Most of the \fIDIALOG_VARS\fP members are set directly from \fB\*p\fP's
230 command-line options:
231 .\" ---------------------------------------------------------------------------
232 .IP \fIDIALOG_VARS.ascii_lines
233 This corresponds to the command-line option "\fB--ascii-lines\fP.
234 It causes line-drawing to be done with ASCII characters, e.g., "+" and "-".
235 See \fIDIALOG_VARS.no_lines\fP.
236 .\" ---------------------------------------------------------------------------
237 .IP \fIDIALOG_VARS.backtitle
238 This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP".
239 It specifies a
240 \fIbacktitle\fP
241 string to be displayed on the backdrop, at the top of the screen.
242 .\" ---------------------------------------------------------------------------
243 .IP \fIDIALOG_VARS.beep_after_signal
244 This corresponds to the command-line option "\fB--beep-after\fP".
245 If true, beep after a user has completed a widget by pressing one of the buttons.
246 .\" ---------------------------------------------------------------------------
247 .IP \fIDIALOG_VARS.beep_signal
248 This corresponds to the command-line option "\fB--beep\fP".
249 It is obsolete.
250 .\" ---------------------------------------------------------------------------
251 .IP \fIDIALOG_VARS.begin_set
252 This is true if the command-line option "\fB--begin y x\fP" was used.
253 It specifies the position of the upper left corner of a dialog box on the screen.
254 .\" ---------------------------------------------------------------------------
255 .IP \fIDIALOG_VARS.begin_x
256 This corresponds to the \fIx\fP value from
257 the command-line option "\fB--begin\fP \fIy x\fP" (second value).
258 .\" ---------------------------------------------------------------------------
259 .IP \fIDIALOG_VARS.begin_y
260 This corresponds to the \fIy\fP value from
261 the command-line option "\fB--begin\fP \fIy x\fP" (first value).
262 .\" ---------------------------------------------------------------------------
263 .IP \fIDIALOG_VARS.cancel_label
264 This corresponds to the command-line option "\fB--cancel-label\fP \fIstring\fP".
265 The given \fIstring\fP overrides the label used for "Cancel" buttons.
266 .\" ---------------------------------------------------------------------------
267 .IP \fIDIALOG_VARS.cant_kill
268 This corresponds to the command-line option "\fB--no-kill\fP".
269 If true, this tells
270 \fB\*p\fP
271 to put the
272 \fBtailboxbg\fP
273 box in the background,
274 printing its process id to \fB\*p\fP's output.
275 SIGHUP is disabled for the background process.
276 .\" ---------------------------------------------------------------------------
277 .IP \fIDIALOG_VARS.colors
278 This corresponds to the command-line option "\fB--colors\fP".
279 If true, interpret embedded "\\Z" sequences in the dialog text
280 by the following character,
281 which tells \fB\*p\fP to set colors or video attributes:
282 0 through 7 are the ANSI codes used in curses:
283 black,
284 red,
285 green,
286 yellow,
287 blue,
288 magenta,
289 cyan and
290 white respectively.
291 Bold is set by 'b', reset by 'B'.
292 Reverse is set by 'r', reset by 'R'.
293 Underline is set by 'u', reset by 'U'.
294 The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
295 bright red.
296 Restore normal settings with "\\Zn".
297 .\" ---------------------------------------------------------------------------
298 .IP \fIDIALOG_VARS.column_separator
299 This corresponds to the command-line option "\fB--column-separator\fP".
300 \fB\*L\fP splits data for radio/checkboxes and menus on the
301 occurrences of the given string, and aligns the split data into columns.
302 .\" ---------------------------------------------------------------------------
303 .IP \fIDIALOG_VARS.cr_wrap
304 This corresponds to the command-line option "\fB--cr-wrap\fP".
305 If true,
306 interpret embedded newlines in the dialog text as a newline on the screen.
307 Otherwise, \fB\*p\fR will only wrap lines where needed to fit inside the text box.
308 Even though you can control line breaks with this,
309 \fB\*p\fR will still wrap any lines that are too long for the width of the box.
310 Without cr-wrap, the layout of your text may be formatted to look nice
311 in the source code of your script without affecting the way it will
312 look in the dialog.
313 .\" ---------------------------------------------------------------------------
314 .IP \fIDIALOG_VARS.date_format
315 This corresponds to the command-line option "\fB--date-format\fP \fIstring\fP".
316 If the host provides \fBstrftime\fP, and the value is nonnull,
317 the calendar widget uses this to format its output.
318 .\" ---------------------------------------------------------------------------
319 .IP \fIDIALOG_VARS.default_button
320 This is set by the command-line option "\fB--default-button\fP.
321 It is used by \fBdlg_default_button\fP.
322 .\" ---------------------------------------------------------------------------
323 .IP \fIDIALOG_VARS.default_item
324 This corresponds to the command-line option "\fB--default-item\fP \fIstring\fP".
325 The given string is used as
326 the default item in a checklist, form or menu box.
327 Normally the first item in the box is the default.
328 .\" ---------------------------------------------------------------------------
329 .IP \fIDIALOG_VARS.defaultno
330 This corresponds to the command-line option "\fB--defaultno\fP".
331 If true,
332 make the default value of the
333 \fByes/no\fP
334 box a
335 .BR No .
336 Likewise, make the default button of widgets that provide "OK" and "Cancel"
337 a \fBCancel\fP.
338 If \fB--nocancel\fP was given that option overrides this,
339 making the default button always "Yes" (internally the same as "OK").
340 .\" ---------------------------------------------------------------------------
341 .IP \fIDIALOG_VARS.dlg_clear_screen
342 This corresponds to the command-line option "\fB--clear\fP".
343 This option is implemented in the main program, not the library.
344 If true,
345 the screen will be cleared on exit.
346 This may be used alone, without other options.
347 .\" ---------------------------------------------------------------------------
348 .IP \fIDIALOG_VARS.exit_label
349 This corresponds to the command-line option "\fB--exit-label string\fP".
350 The given string overrides the label used for "EXIT" buttons.
351 .\" ---------------------------------------------------------------------------
352 .IP \fIDIALOG_VARS.extra_button
353 This corresponds to the command-line option "\fB--extra-button\fP".
354 If true, some widgets show an extra button,
355 between "OK" and "Cancel" buttons.
356 .\" ---------------------------------------------------------------------------
357 .IP \fIDIALOG_VARS.extra_label
358 This corresponds to the command-line option "\fB--extra-label\fP \fIstring\fP".
359 The given string overrides the label used for "Extra" buttons.
360 Note: for inputmenu widgets, this defaults to "Rename".
361 .\" ---------------------------------------------------------------------------
362 .IP \fIDIALOG_VARS.formitem_type
363 This is set by the command-line option "\fB--passwordform\fP"
364 to tell the form widget that its text fields should be treated like
365 password widgets.
366 .\" ---------------------------------------------------------------------------
367 .IP \fIDIALOG_VARS.help_button
368 This corresponds to the command-line option "\fB--help-button\fP".
369 If true, some widgets show a help-button after "OK" and "Cancel" buttons,
370 i.e., in checklist, radiolist and menu boxes.
371 If \fB--item-help\fR is also given, on exit
372 the return status will be the same as for the "OK" button,
373 and the item-help text will be written to \fB\*p\fP's output after the token "HELP".
374 Otherwise, the return status will indicate that the Help button was pressed,
375 and no message printed.
376 .\" ---------------------------------------------------------------------------
377 .IP \fIDIALOG_VARS.help_file
378 This corresponds to the command-line option "\fB--hfile\fP \fIstring\fP".
379 The given filename is passed to \fBdialog_helpfile\fP when the user
380 presses F1.
381 .\" ---------------------------------------------------------------------------
382 .IP \fIDIALOG_VARS.help_label
383 This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP".
384 The given string overrides the label used for "Help" buttons.
385 .\" ---------------------------------------------------------------------------
386 .IP \fIDIALOG_VARS.help_line
387 This corresponds to the command-line option "\fB--hline\fP \fIstring\fP".
388 The given string is displayed in the bottom of dialog windows,
389 like a subtitle.
390 .\" ---------------------------------------------------------------------------
391 .IP \fIDIALOG_VARS.help_status
392 This corresponds to the command-line option "\fB--help-status\fP".
393 If true, and the the help-button is selected,
394 writes the checklist or radiolist information
395 after the item-help "HELP" information.
396 This can be used to reconstruct the state of a checklist after processing
397 the help request.
398 .\" ---------------------------------------------------------------------------
399 .IP \fIDIALOG_VARS.input_length
400 This is nonzero if \fIDIALOG_VARS.input_result\fP is allocated,
401 versus being a pointer to the user's local variables.
402 .\" ---------------------------------------------------------------------------
403 .IP \fIDIALOG_VARS.input_menu
404 This flag is set to denote whether the menubox widget
405 implements a menu versus a inputmenu widget.
406 .\" ---------------------------------------------------------------------------
407 .IP \fIDIALOG_VARS.input_result
408 This may be either a user-supplied buffer,
409 or a buffer dynamically allocated by the library,
410 depending on \fIDIALOG_VARS.input_length\fP:
411 .RS
412 .bP
413 If \fIDIALOG_VARS.input_length\fP is zero,
414 this is a pointer to user buffer (on the stack, or static).
415 The buffer size is assumed to be \fBMAX_LEN\fP,
416 which is defined in \fI<\*l.h>\fP.
417 .bP
418 When \fIDIALOG_VARS.input_length\fP is nonzero,
419 this is a dynamically-allocated buffer used by the widgets to return
420 printable results to the calling application.
421 .RE
422 .IP
423 Certain widgets copy a result to this buffer.
424 If the pointer is NULL, or if the length is insufficient for
425 the result, then the \fB\*l\fP library allocates a buffer which is large enough,
426 and sets \fIDIALOG_VARS.input_length\fP.
427 Callers should check for this case if they have supplied their own buffer.
428 .\" ---------------------------------------------------------------------------
429 .IP \fIDIALOG_VARS.insecure
430 This corresponds to the command-line option "\fB--insecure\fP".
431 If true, make the password widget friendlier but less secure,
432 by echoing asterisks for each character.
433 .\" ---------------------------------------------------------------------------
434 .IP \fIDIALOG_VARS.in_helpfile
435 This variable is used to prevent \fBdialog_helpfile\fP from showing
436 anything, e.g., if F1 were pressed within a help-file display.
437 .\" ---------------------------------------------------------------------------
438 .IP \fIDIALOG_VARS.item_help
439 This corresponds to the command-line option "\fB--item-help\fP".
440 If true,
441 interpret the tags data for checklist, radiolist and menu boxes
442 adding a column whose text is displayed in the bottom line of the
443 screen, for the currently selected item.
444 .\" ---------------------------------------------------------------------------
445 .IP \fIDIALOG_VARS.keep_tite
446 This is set by the command-line option "\fB--keep-tite\fP"
447 to tell \fB\*p\fP to not attempt to cancel the terminal initialization
448 (termcap \fIti\fP/\fIte\fP) sequences which correspond to xterm's alternate-screen
449 switching.
450 Normally \fB\*p\fP does this to avoid flickering when run several times
451 in a script.
452 .\" ---------------------------------------------------------------------------
453 .IP \fIDIALOG_VARS.keep_window
454 This corresponds to the command-line option "\fB--keep-window\fP".
455 If true, do not remove/repaint the window on exit.
456 This is useful for keeping the window contents visible when several
457 widgets are run in the same process.
458 Note that curses will clear the screen when starting a new process.
459 .\" ---------------------------------------------------------------------------
460 .IP \fIDIALOG_VARS.max_input
461 This corresponds to the command-line option "\fB--max-input\fP \fIsize\fP".
462 Limit input strings to the given size.
463 If not specified, the limit is 2048.
464 .\" ---------------------------------------------------------------------------
465 .IP \fIDIALOG_VARS.no_items
466 This corresponds to the command-line option "\fB--no-items\fP".
467 Some widgets (checklist, inputmenu, radiolist, menu) display a list
468 with two columns (a "tag" and "item", i.e., "description").
469 This tells \fB\*p\fP to read shorter rows from data,
470 omitting the "list".
471 .\" ---------------------------------------------------------------------------
472 .IP \fIDIALOG_VARS.no_label
473 This corresponds to the command-line option "\fB--no-label\fP \fIstring\fP".
474 The given string overrides the label used for "No" buttons.
475 .\" ---------------------------------------------------------------------------
476 .IP \fIDIALOG_VARS.no_lines
477 This corresponds to the command-line option "\fB--no-lines\fP.
478 It suppresses line-drawing.
479 See \fIDIALOG_VARS.ascii_lines\fP.
480 .\" ---------------------------------------------------------------------------
481 .IP \fIDIALOG_VARS.no_nl_expand
482 This corresponds to the command-line option "\fB--no-nl-expand\fP".
483 If false, \fBdlg_trim_string\fP converts literal "\\n" substrings
484 in a message into newlines.
485 .\" ---------------------------------------------------------------------------
486 .IP \fIDIALOG_VARS.no_tags
487 This corresponds to the command-line option "\fB--no-tags\fP".
488 Some widgets (checklist, inputmenu, radiolist, menu) display a list
489 with two columns (a "tag" and "item", also known as "description").
490 The tag is useful for scripting, but may not help the user.
491 The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
492 column of tags from the display.
493 .IP
494 Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
495 by matching a single character to the first character of the tag.
496 When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
497 the first character of the description.
498 In either case, the matchable character is highlighted.
499 .IP
500 Here is a table showing how the no_tags and no_items values interact:
501 .TS
502 tab(/);
503 l l l l l
504 _ _ _ _ _
505 l l l c c.
506 Widget/Fields Shown/Fields Read/.no_items/.no_tags
507 buildlist/item/tag,item/0/0*
508 buildlist/item/tag,item/0/1
509 buildlist/tag/tag/1/0*
510 buildlist/tag/tag/1/1
511 checklist/tag,item/tag,item/0/0
512 checklist/item/tag,item/0/1
513 checklist/tag/tag/1/0
514 checklist/tag/tag/1/1
515 inputmenu/tag,item/tag,item/0/0
516 inputmenu/item/tag,item/0/1
517 inputmenu/tag/tag/1/0
518 inputmenu/tag/tag/1/1
519 menu/tag,item/tag,item/0/0
520 menu/item/tag,item/0/1
521 menu/tag/tag/1/0
522 menu/tag/tag/1/1
523 radiolist/tag,item/tag,item/0/0
524 radiolist/item/tag,item/0/1
525 radiolist/tag/tag/1/0
526 radiolist/tag/tag/1/1
527 treeview/item/tag,item/0/0*
528 treeview/item/tag,item/0/1
529 treeview/tag/tag/1/0*
530 treeview/tag/tag/1/1
531 _
532 .TE
533 .RS
534 .TP 2
535 *
536 Xdialog does not display the tag column for the analogous buildlist
537 and treeview widgets.
538 \fB\*L\fP does the same on the command-line.
539 However the library interface defaults to displaying the tag column.
540 Your application can enable or disable the tag column as needed for each widget.
541 .RE
542 .\" ---------------------------------------------------------------------------
543 .IP \fIDIALOG_VARS.nocancel
544 This corresponds to the command-line option "\fB--no-cancel\fP".
545 If true,
546 suppress the "Cancel" button in checklist, inputbox and menu box modes.
547 A script can still test if the user pressed the ESC key to cancel to quit.
548 .\" ---------------------------------------------------------------------------
549 .IP \fIDIALOG_VARS.nocollapse
550 This corresponds to the command-line option "\fB--no-collapse\fP".
551 Normally \fB\*p\fR converts tabs to spaces and reduces multiple
552 spaces to a single space for text which is displayed in a message boxes, etc.
553 It true, that feature is disabled.
554 Note that \fB\*p\fR will still wrap text, subject to the \fB--cr-wrap\fR
555 option.
556 .\" ---------------------------------------------------------------------------
557 .IP \fIDIALOG_VARS.nook
558 This corresponds to the command-line option "\fB--nook\fP.
559 \fB\*L\fP will suppress the "ok" (or "yes") button from the widget.
560 .\" ---------------------------------------------------------------------------
561 .IP \fIDIALOG_VARS.ok_label
562 This corresponds to the command-line option "\fB--ok-label\fP \fIstring\fP".
563 The given string overrides the label used for "OK" buttons.
564 .\" ---------------------------------------------------------------------------
565 .IP \fIDIALOG_VARS.print_siz
566 This corresponds to the command-line option "\fB--print-size\fP".
567 If true,
568 each widget prints its size to \fB\*p\fP's output when it is invoked.
569 .\" ---------------------------------------------------------------------------
570 .IP \fIDIALOG_VARS.quoted
571 This corresponds to the command-line option "\fB--quoted\fP.
572 .\" ---------------------------------------------------------------------------
573 .IP \fIDIALOG_VARS.separate_output
574 This corresponds to the command-line option "\fB--separate-output\fP".
575 If true,
576 checklist widgets output result one line at a time, with no quoting.
577 This facilitates parsing by another program.
578 .\" ---------------------------------------------------------------------------
579 .IP \fIDIALOG_VARS.single_quoted
580 This corresponds to the command-line option "\fB--single-quoted\fP".
581 If true,
582 Use single-quoting as needed (and no quotes if unneeded) for the
583 output of checklist's as well as the item-help text.
584 If this option is not set, \fB\*p\fP uses double quotes around each item.
585 The latter requires occasional use of backslashes to make the output useful in
586 shell scripts.
587 .\" ---------------------------------------------------------------------------
588 .IP \fIDIALOG_VARS.size_err
589 This corresponds to the command-line option "\fB--size-err\fP".
590 If true,
591 check the resulting size of a dialog box before trying to use it,
592 printing the resulting size if it is larger than the screen.
593 (This option is obsolete, since all new-window calls are checked).
594 .\" ---------------------------------------------------------------------------
595 .IP \fIDIALOG_VARS.sleep_secs
596 This corresponds to the command-line option "\fB--sleep\fP \fIsecs\fP".
597 This option is implemented in the main program, not the library.
598 If nonzero, this is the number of seconds after to delay after processing a dialog box.
599 .\" ---------------------------------------------------------------------------
600 .IP \fIDIALOG_VARS.tab_correct
601 This corresponds to the command-line option "\fB--tab-correct\fP".
602 If true, convert each tab character of the text to one or more spaces.
603 Otherwise, tabs are rendered according to the curses library's interpretation.
604 .\" ---------------------------------------------------------------------------
605 .IP \fIDIALOG_VARS.time_format
606 This corresponds to the command-line option "\fB--time-format\fP \fIstring\fP".
607 If the host provides \fBstrftime\fP, and the value is nonnull,
608 the timebox widget uses this to format its output.
609 .\" ---------------------------------------------------------------------------
610 .IP \fIDIALOG_VARS.timeout_secs
611 This corresponds to the command-line option "\fB--timeout\fP \fIsecs\fP".
612 If nonzero, timeout input requests (exit with error code)
613 if no user response within the given number of seconds.
614 .\" ---------------------------------------------------------------------------
615 .IP \fIDIALOG_VARS.title
616 This corresponds to the command-line option "\fB--title\fP \fItitle\fP".
617 Specifies a
618 \fItitle\fP
619 string to be displayed at the top of the dialog box.
620 .\" ---------------------------------------------------------------------------
621 .IP \fIDIALOG_VARS.trim_whitespace
622 This corresponds to the command-line option "\fB--trim\fP".
623 If true, eliminate leading blanks,
624 trim literal newlines and repeated blanks from message text.
625 .\" ---------------------------------------------------------------------------
626 .IP \fIDIALOG_VARS.visit_items
627 This corresponds to the command-line option "\fB--visit-items\fP".
628 Modify the tab-traversal of the list-oriented widgets
629 (buildlist, checklist, radiobox, menubox, inputmenu, and treeview)
630 to include the list of items as one of the states.
631 This is useful as a visual aid,
632 i.e., the cursor position helps some users.
633 .\" ---------------------------------------------------------------------------
634 .IP \fIDIALOG_VARS.yes_label
635 This corresponds to the command-line option "\fB--yes-label\fP \fIstring\fP".
636 The given string overrides the label used for "Yes" buttons.
637 .
638 .\" ************************************************************************
639 .\" ************************************************************************
640 .SH WIDGETS
641 Functions that implement major functionality for the command-line \fB\*p\fP
642 program, e.g., widgets, have names beginning "\fIdialog_\fP".
643
644 All dialog boxes have at least three parameters:
645 .TP 5
646 \fItitle\fP
647 the caption for the box, shown on its top border.
648 .TP 5
649 \fIheight\fP
650 the height of the dialog box.
651 .TP 5
652 \fIwidth\fP
653 the width of the dialog box.
654 .PP
655 Other parameters depend on the box type.
656 .
657 .\" ************************************************************************
658 .IP \fBdialog_buildlist
659 implements the "\fB--buildlist\fP" option.
660 .RS
661 .TP 5
662 .B const char * \fItitle
663 is the title on the top of the widget.
664 .TP 5
665 .B const char * \fIcprompt
666 is the prompt text shown within the widget.
667 .TP 5
668 .B int \fIheight
669 is the desired height of the box.
670 If zero, the height is adjusted to use the available screen size.
671 .TP 5
672 .B int \fIwidth
673 is the desired width of the box.
674 If zero, the height is adjusted to use the available screen size.
675 .TP 5
676 .B int \fIlist_height
677 is the minimum height to reserve for displaying the list.
678 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
679 .TP 5
680 .B int \fIitem_no
681 is the number of rows in \fIitems\fP.
682 .TP 5
683 .B char ** \fIitems
684 is an array of strings which is viewed either as a list of rows
685 .RS
686 \fItag item status \fR
687 .RE
688 .IP
689 or
690 .RS
691 \fItag item status help\fR
692 .RE
693 .IP
694 depending on whether \fBdialog_vars.item_help\fP is set.
695 .TP 5
696 .B int \fIorder_mode
697 is reserved for future enhancements
698 .RE
699 .
700 .\" ************************************************************************
701 .IP \fBdialog_calendar
702 implements the "\fB--calendar\fP" option.
703 .RS
704 .TP 5
705 .B const char * \fItitle
706 is the title on the top of the widget.
707 .TP 5
708 .B const char * \fIsubtitle
709 is the prompt text shown within the widget.
710 .TP 5
711 .B int \fIheight
712 is the height excluding the fixed-height calendar grid.
713 .TP 5
714 .B int \fIwidth
715 is the overall width of the box,
716 which is adjusted up to the calendar grid's minimum width if needed.
717 .TP 5
718 .B int \fIday
719 is the initial day of the week shown,
720 counting zero as Sunday.
721 If the value is negative, the current day of the week is used.
722 .TP 5
723 .B int \fImonth
724 is the initial month of the year shown,
725 counting one as January.
726 If the value is negative, the current month of the year is used.
727 .TP 5
728 .B int \fIyear
729 is the initial year shown.
730 If the value is negative, the current year is used.
731 .RE
732 .\" ************************************************************************
733 .IP \fBdialog_checklist
734 implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
735 depending on the \fIflag\fP parameter.
736 .RS
737 .TP 5
738 .B const char * \fItitle
739 is the title on the top of the widget.
740 .TP 5
741 .B const char * \fIcprompt
742 is the prompt text shown within the widget.
743 .TP 5
744 .B int \fIheight
745 is the desired height of the box.
746 If zero, the height is adjusted to use the available screen size.
747 .TP 5
748 .B int \fIwidth
749 is the desired width of the box.
750 If zero, the height is adjusted to use the available screen size.
751 .TP 5
752 .B int \fIlist_height
753 is the minimum height to reserve for displaying the list.
754 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
755 .TP 5
756 .B int \fIitem_no
757 is the number of rows in \fIitems\fP.
758 .TP 5
759 .B int \fIitems
760 is an array of strings which is viewed either as a list of rows
761 .RS
762 \fItag item status \fR
763 .RE
764 .IP
765 or
766 .RS
767 \fItag item status help\fR
768 .RE
769 .IP
770 depending on whether \fBdialog_vars.item_help\fP is set.
771 .IP flag
772 is either \fIFLAG_CHECK\fP, for checklists,
773 or \fIFLAG_RADIO\fP for radiolists.
774 .RE
775 .\" ************************************************************************
776 .IP \fBdialog_dselect
777 implements the "\fB--dselect\fP" option.
778 .RS
779 .TP 5
780 .B const char * \fItitle
781 is the title on the top of the widget.
782 .TP 5
783 .B const char * \fIpath
784 is the preselected value to show in the input-box,
785 which is used also to set the directory- and file-windows.
786 .TP 5
787 .B int \fIheight
788 is the height excluding the minimum needed to show the dialog box framework.
789 If zero, the height is based on the screen size.
790 .TP 5
791 .B int \fIwidth
792 is the desired width of the box.
793 If zero, the height is based on the screen size.
794 .RE
795 .\" ************************************************************************
796 .IP \fBdialog_editbox
797 implements the "\fB--editbox\fP" option.
798 .RS
799 .TP 5
800 .B const char * \fItitle
801 is the title on the top of the widget.
802 .TP 5
803 .B const char * \fIfile
804 is the name of the file from which to read.
805 .TP 5
806 .B int \fIheight
807 is the desired height of the box.
808 If zero, the height is adjusted to use the available screen size.
809 .TP 5
810 .B int \fIwidth
811 is the desired width of the box.
812 If zero, the height is adjusted to use the available screen size.
813 .RE
814 .\" ************************************************************************
815 .IP \fBdialog_form
816 implements the "\fB--form\fP" option.
817 .RS
818 .TP 5
819 .B const char * \fItitle
820 is the title on the top of the widget.
821 .TP 5
822 .B const char * \fIcprompt
823 is the prompt text shown within the widget.
824 .TP 5
825 .B int \fIheight
826 is the desired height of the box.
827 If zero, the height is adjusted to use the available screen size.
828 .TP 5
829 .B int \fIwidth
830 is the desired width of the box.
831 If zero, the height is adjusted to use the available screen size.
832 .TP 5
833 .B int \fIform_height
834 is the minimum height to reserve for displaying the list.
835 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
836 .TP 5
837 .B int \fIitem_no
838 is the number of rows in \fIitems\fP.
839 .TP 5
840 .B int \fIitems
841 is an array of strings which is viewed either as a list of rows
842 .RS
843 \fIName NameY NameX Text TextY TextX FLen ILen\fR
844 .RE
845 .IP
846 or
847 .RS
848 \fIName NameY NameX Text TextY TextX FLen ILen Help\fR
849 .RE
850 .IP
851 depending on whether \fBdialog_vars.item_help\fP is set.
852 .RE
853 .\" ************************************************************************
854 .IP \fBdialog_fselect
855 implements the "\fB--fselect\fP" option.
856 .RS
857 .TP 5
858 .B const char * \fItitle
859 is the title on the top of the widget.
860 .TP 5
861 .B const char * \fIpath
862 is the preselected value to show in the input-box,
863 which is used also to set the directory- and file-windows.
864 .TP 5
865 .B int \fIheight
866 is the height excluding the minimum needed to show the dialog box framework.
867 If zero, the height is based on the screen size.
868 .TP 5
869 .B int \fIwidth
870 is the desired width of the box.
871 If zero, the height is based on the screen size.
872 .RE
873 .\" ************************************************************************
874 .IP \fBdialog_gauge
875 implements the "\fB--gauge\fP" option.
876 Alternatively, a simpler or customized gauge widget can be
877 setup using
878 \fBdlg_allocate_gauge\fP,
879 \fBdlg_update_gauge\fP and
880 \fBdlg_free_gauge\fP.
881 .RS
882 .TP 5
883 .B const char * \fItitle
884 is the title on the top of the widget.
885 .TP 5
886 .B const char * \fIcprompt
887 is the prompt text shown within the widget.
888 .TP 5
889 .B int \fIheight
890 is the desired height of the box.
891 If zero, the height is based on the screen size.
892 .TP 5
893 .B int \fIwidth
894 is the desired width of the box.
895 If zero, the height is based on the screen size.
896 .TP 5
897 .B int \fIpercent
898 is the percentage to show in the progress bar.
899 .RE
900 .\" ************************************************************************
901 .IP \fBdialog_inputbox
902 implements the "\fB--inputbox\fP" or
903 "\fB--password\fP" option, depending on the value of \fIpassword\fP.
904 .RS
905 .TP 5
906 .B const char * \fItitle
907 is the title on the top of the widget.
908 .TP 5
909 .B const char * \fIcprompt
910 is the prompt text shown within the widget.
911 .TP 5
912 .B int \fIheight
913 is the desired height of the box.
914 If zero, the height is based on the screen size.
915 .TP 5
916 .B int \fIwidth
917 is the desired width of the box.
918 If zero, the height is based on the screen size.
919 .TP 5
920 .B const char * \fIinit
921 is the initial value of the input box, whose length is taken into account
922 when auto-sizing the width of the dialog box.
923 .TP 5
924 .B int \fIpassword
925 if true, causes typed input to be echoed as asterisks.
926 .RE
927 .\" ************************************************************************
928 .IP \fBdialog_helpfile
929 implements the "\fB--hfile\fP" option.
930 .RS
931 .TP 5
932 .B const char * \fItitle
933 is the title on the top of the widget.
934 .TP 5
935 .B const char * \fIfile
936 is the name of a file containing the text to display.
937 This function is internally bound to F1 (function key "1"),
938 passing \fBdialog_vars.help_file\fP as a parameter.
939 The \fBdialog\fP program sets that variable when the \fB--hfile\fP option
940 is given.
941 .TP 5
942 .B int \fIheight
943 is the desired height of the box.
944 If zero, the height is based on the screen size.
945 .TP 5
946 .B int \fIwidth
947 is the desired width of the box.
948 If zero, the height is based on the screen size.
949 .RE
950 .\" ************************************************************************
951 .IP \fBdialog_menu
952 implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
953 depending on whether \fBdialog_vars.input_menu\fP is set.
954 .RS
955 .TP 5
956 .B const char * \fItitle
957 is the title on the top of the widget.
958 .TP 5
959 .B const char * \fIcprompt
960 is the prompt text shown within the widget.
961 .TP 5
962 .B int \fIheight
963 is the desired height of the box.
964 If zero, the height is based on the screen size.
965 .TP 5
966 .B int \fIwidth
967 is the desired width of the box.
968 If zero, the height is based on the screen size.
969 .TP 5
970 .B int \fImenu_height
971 is the minimum height to reserve for displaying the list.
972 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
973 .TP 5
974 .B int \fIitem_no
975 is the number of rows in \fIitems\fP.
976 .TP 5
977 .B int \fIitems
978 is an array of strings which is viewed either as a list of rows
979 .RS
980 \fItag item\fR
981 .RE
982 .IP
983 or
984 .RS
985 \fItag item help\fR
986 .RE
987 .IP
988 depending on whether \fBdialog_vars.item_help\fP is set.
989 .RE
990 .\" ************************************************************************
991 .IP \fBdialog_mixedform
992 implements the "\fB--mixedform\fP" option.
993 .RS
994 .TP 5
995 .B const char * \fItitle
996 is the title on the top of the widget.
997 .TP 5
998 .B const char * \fIcprompt
999 is the prompt text shown within the widget.
1000 .TP 5
1001 .B int \fIheight
1002 is the desired height of the box.
1003 If zero, the height is adjusted to use the available screen size.
1004 .TP 5
1005 .B int \fIwidth
1006 is the desired width of the box.
1007 If zero, the height is adjusted to use the available screen size.
1008 .TP 5
1009 .B int \fIform_height
1010 is the minimum height to reserve for displaying the list.
1011 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1012 .TP 5
1013 .B int \fIitem_no
1014 is the number of rows in \fIitems\fP.
1015 .TP 5
1016 .B int \fIitems
1017 is an array of strings which is viewed either as a list of rows
1018 .RS
1019 \fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
1020 .RE
1021 .IP
1022 or
1023 .RS
1024 \fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
1025 .RE
1026 .IP
1027 depending on whether \fBdialog_vars.item_help\fP is set.
1028 .RE
1029 .\" ************************************************************************
1030 .IP \fBdialog_mixedgauge
1031 implements the "\fB--mixedgauge\fP" option
1032 .RS
1033 .TP 5
1034 .B const char * \fItitle
1035 is the title on the top of the widget.
1036 .TP 5
1037 .B const char * \fIcprompt
1038 is the caption text shown within the widget.
1039 .TP 5
1040 .B int \fIheight
1041 is the desired height of the box.
1042 If zero, the height is based on the screen size.
1043 .TP 5
1044 .B int \fIwidth
1045 is the desired width of the box.
1046 If zero, the height is based on the screen size.
1047 .TP 5
1048 .B int \fIpercent
1049 is the percentage to show in the progress bar.
1050 .TP 5
1051 .B int \fIitem_no
1052 is the number of rows in \fIitems\fP.
1053 .TP 5
1054 .B int \fIitems
1055 is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
1056 The \fItag\fP values are listed, one per row, in the list at the top of
1057 the widget.
1058 .IP
1059 The \fIitem\fP values are decoded: digits 0-9 are the following strings
1060 .RS
1061 .IP 0
1062 Succeeded
1063 .IP 1
1064 Failed
1065 .IP 2
1066 Passed
1067 .IP 3
1068 Completed
1069 .IP 4
1070 Checked
1071 .IP 5
1072 Done
1073 .IP 6
1074 Skipped
1075 .IP 7
1076 In Progress
1077 .IP 8
1078 (blank)
1079 .IP 9
1080 N/A
1081 .RE
1082 .IP
1083 A string with a leading "-" character is centered, marked with "%".
1084 For example, "-75" is displayed as "75%".
1085 Other strings are displayed as is.
1086 .RE
1087 .\" ************************************************************************
1088 .IP \fBdialog_msgbox
1089 implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
1090 depending on whether \fIpauseopt\fP is set.
1091 .RS
1092 .TP 5
1093 .B const char * \fItitle
1094 is the title on the top of the widget.
1095 .TP 5
1096 .B const char * \fIcprompt
1097 is the prompt text shown within the widget.
1098 .TP 5
1099 .B int \fIheight
1100 is the desired height of the box.
1101 If zero, the height is based on the screen size.
1102 .TP 5
1103 .B int \fIwidth
1104 is the desired width of the box.
1105 If zero, the height is based on the screen size.
1106 .TP 5
1107 .B int \fIpauseopt
1108 if true, an "OK" button will be shown,
1109 and the dialog will wait for it to complete.
1110 With an "OK" button, it is denoted a "msgbox",
1111 without an "OK" button, it is denoted an "infobox".
1112 .RE
1113 .\" ************************************************************************
1114 .IP \fBdialog_pause
1115 implements the "\fB--pause\fP" option.
1116 .RS
1117 .TP 5
1118 .B const char * \fItitle
1119 is the title on the top of the widget.
1120 .TP 5
1121 .B int \fIheight
1122 is the desired height of the box.
1123 If zero, the height is based on the screen size.
1124 .TP 5
1125 .B int \fIwidth
1126 is the desired width of the box.
1127 If zero, the height is based on the screen size.
1128 .TP 5
1129 .B int \fIseconds
1130 is the timeout to use for the progress bar.
1131 .RE
1132 .\" ************************************************************************
1133 .IP \fBdialog_prgbox
1134 implements the "\fB--prgbox\fP" option.
1135 .RS
1136 .TP 5
1137 .B const char * \fItitle
1138 is the title on the top of the widget.
1139 .TP 5
1140 .B const char * \fIcprompt
1141 is the prompt text shown within the widget.
1142 If empty or null, no prompt is shown.
1143 .TP 5
1144 .B const char * \fIcommand
1145 is the name of the command to execute.
1146 .TP 5
1147 .B int \fIheight
1148 is the desired height of the box.
1149 If zero, the height is based on the screen size.
1150 .TP 5
1151 .B int \fIwidth
1152 is the desired width of the box.
1153 If zero, the height is based on the screen size.
1154 .TP 5
1155 .B int \fIpauseopt
1156 if true, an "OK" button will be shown,
1157 and the dialog will wait for it to complete.
1158 .RE
1159 .\" ************************************************************************
1160 .IP \fBdialog_progressbox
1161 implements the "\fB--progressbox\fP" option.
1162 .RS
1163 .TP 5
1164 .B const char * \fItitle
1165 is the title on the top of the widget.
1166 .TP 5
1167 .B const char * \fIcprompt
1168 is the prompt text shown within the widget.
1169 If empty or null, no prompt is shown.
1170 .TP 5
1171 .B int \fIheight
1172 is the desired height of the box.
1173 If zero, the height is based on the screen size.
1174 .TP 5
1175 .B int \fIwidth
1176 is the desired width of the box.
1177 If zero, the height is based on the screen size.
1178 .RE
1179 .\" ************************************************************************
1180 .IP \fBdialog_rangebox
1181 implements the "\fB--rangebox\fP" option.
1182 .RS
1183 .TP 5
1184 .B const char * \fItitle
1185 is the title on the top of the widget.
1186 .TP 5
1187 .B const char * \fIcprompt
1188 is the prompt text shown within the widget.
1189 If empty or null, no prompt is shown.
1190 .TP 5
1191 .B int \fIheight
1192 is the desired height of the widget.
1193 If zero, the height is based on the screen size.
1194 .TP 5
1195 .B int \fIwidth
1196 is the desired width of the widget.
1197 If zero, the height is based on the screen size.
1198 .TP 5
1199 .B int \fImin_value
1200 is the minimum value to allow.
1201 .TP 5
1202 .B int \fImax_value
1203 is the maximum value to allow.
1204 .TP 5
1205 .B int \fIdefault_value
1206 is the default value, if no change is made.
1207 .RE
1208 .\" ************************************************************************
1209 .IP \fBdialog_tailbox
1210 implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
1211 depending on whether \fIbg_task\fP is set.
1212 .RS
1213 .TP 5
1214 .B const char * \fItitle
1215 is the title on the top of the widget.
1216 .TP 5
1217 .B const char * \fIfile
1218 is the name of the file to display in the dialog.
1219 .TP 5
1220 .B int \fIheight
1221 is the desired height of the box.
1222 If zero, the height is based on the screen size.
1223 .TP 5
1224 .B int \fIwidth
1225 is the desired width of the box.
1226 If zero, the height is based on the screen size.
1227 .TP 5
1228 .B int \fIbg_task
1229 if true,
1230 the window is added to the callback list in \fBdialog_state\fP,
1231 and the application will poll for the window to be updated.
1232 Otherwise an "OK" button is added to the window,
1233 and it will be closed when the button is activated.
1234 .RE
1235 .\" ************************************************************************
1236 .IP \fBdialog_textbox
1237 implements the "\fB--textbox\fP" option.
1238 .RS
1239 .TP 5
1240 .B const char * \fItitle
1241 is the title on the top of the widget.
1242 .TP 5
1243 .B const char * \fIfile
1244 is the name of the file to display in the dialog.
1245 .TP 5
1246 .B int \fIheight
1247 is the desired height of the box.
1248 If zero, the height is based on the screen size.
1249 .TP 5
1250 .B int \fIwidth
1251 is the desired width of the box.
1252 If zero, the height is based on the screen size.
1253 .RE
1254 .\" ************************************************************************
1255 .IP \fBdialog_timebox
1256 implements the "\fB--timebox\fP" option.
1257 .RS
1258 .TP 5
1259 .B const char * \fItitle
1260 is the title on the top of the widget.
1261 .TP 5
1262 .B const char * \fIsubtitle
1263 is the prompt text shown within the widget.
1264 .TP 5
1265 .B int \fIheight
1266 is the desired height of the box.
1267 If zero, the height is based on the screen size.
1268 .TP 5
1269 .B int \fIwidth
1270 is the desired width of the box.
1271 If zero, the height is based on the screen size.
1272 .TP 5
1273 .B int \fIhour
1274 is the initial hour shown.
1275 If the value is negative, the current hour is used.
1276 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 24.
1277 .TP 5
1278 .B int \fIminute
1279 is the initial minute shown.
1280 If the value is negative, the current minute is used.
1281 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
1282 .TP 5
1283 .B int \fIsecond
1284 is the initial second shown.
1285 If the value is negative, the current second is used.
1286 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
1287 .RE
1288 .\" ************************************************************************
1289 .IP \fBdialog_treeview
1290 implements the "\fB--treeview\fP" option.
1291 .RS
1292 .TP 5
1293 .B const char * \fItitle
1294 is the title on the top of the widget.
1295 .TP 5
1296 .B const char * \fIcprompt
1297 is the prompt text shown within the widget.
1298 .TP 5
1299 .B int \fIheight
1300 is the desired height of the box.
1301 If zero, the height is based on the screen size.
1302 .TP 5
1303 .B int \fIwidth
1304 is the desired width of the box.
1305 If zero, the height is based on the screen size.
1306 .TP 5
1307 .B int \fIlist_height
1308 is the minimum height to reserve for displaying the list.
1309 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1310 .TP 5
1311 .B int \fIitem_no
1312 is the number of rows in \fIitems\fP.
1313 .TP 5
1314 .B char ** \fIitems
1315 is the list of items, contain tag, name, and optionally help strings
1316 (if \fBdialog_vars.item_help\fP is set).
1317 The initial selection state for each item is also in this list.
1318 .TP 5
1319 .B int \fIflag
1320 .IP flag
1321 is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
1322 or \fIFLAG_RADIO\fP for radiolists (a single selection).
1323 .RE
1324 .\" ************************************************************************
1325 .IP \fBdialog_yesno
1326 implements the "\fB--yesno\fP" option.
1327 .RS
1328 .TP 5
1329 .B const char * \fItitle
1330 is the title on the top of the widget.
1331 .TP 5
1332 .B const char * \fIcprompt
1333 is the prompt text shown within the widget.
1334 .TP 5
1335 .B int \fIheight
1336 is the desired height of the box.
1337 If zero, the height is based on the screen size.
1338 .TP 5
1339 .B int \fIwidth
1340 is the desired width of the box.
1341 If zero, the height is based on the screen size.
1342 .RE
1343 .
1344 .\" ************************************************************************
1345 .SH UTILITY FUNCTIONS
1346 Most functions that implement lower-level
1347 functionality for the command-line \fB\*p\fP
1348 program or widgets, have names beginning "\fIdlg_\fP".
1349 Bowing to longstanding usage, the functions that initialize the
1350 display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
1351 .PP
1352 The only non-widget function whose name begins with "\fIdialog_\fP"
1353 is \fBdialog_version\fP, which returns the version number of the
1354 library as a string.
1355 .
1356 .PP
1357 Here is a brief summary of the utility functions and their parameters:
1358 .\" ---------------------------------------------------------------------------
1359 .TP 5
1360 .B dlg_add_callback
1361 Add a callback, used to allow polling input from multiple tailbox
1362 widgets.
1363 .RS
1364 .TP 5
1365 .B DIALOG_CALLBACK *\fIp\fP
1366 contains the callback information.
1367 .RE
1368 .\" ---------------------------------------------------------------------------
1369 .TP 5
1370 .B dlg_add_callback_ref
1371 Like \fBdlg_add_callback\fP, but passes a reference to the \fBDIALOG_CALLBACK\fP
1372 as well as a pointer to a cleanup function which will be called when the
1373 associated input ends.
1374 .RS
1375 .TP 5
1376 .B DIALOG_CALLBACK **\fIp\fP
1377 points to the callback information.
1378 This is a reference to the pointer so that the caller's pointer can be
1379 zeroed when input ends.
1380 .TP 5
1381 .B DIALOG_FREEBACK \fIfunc\fP
1382 function to call when input ends, e.g., to free caller's additional data.
1383 .RE
1384 .\" ---------------------------------------------------------------------------
1385 .TP 5
1386 .B dlg_add_quoted
1387 Add a quoted string to the result buffer (see \fBdlg_add_result\fP).
1388 If no quotes are necessary, none are used.
1389 If \fBdialog_vars.single_quoted\fR is set, single-quotes are used.
1390 Otherwise, double-quotes are used.
1391 .RS
1392 .TP 5
1393 .B char * \fIstring
1394 is the string to add.
1395 .RE
1396 .\" ---------------------------------------------------------------------------
1397 .TP 5
1398 .B dlg_add_result
1399 Add a string to the result buffer \fBdialog_vars.input_result\fP.
1400 .RS
1401 .TP 5
1402 .B char * \fIstring
1403 is the string to add.
1404 .RE
1405 .\" ---------------------------------------------------------------------------
1406 .TP 5
1407 .B dlg_add_separator
1408 Add an output-separator to the result buffer \fBdialog_vars.input_result\fP.
1409 If \fBdialog_vars.output_separator\fP is set, use that.
1410 Otherwise, if \fBdialog_vars.separate_output\fP is set, use newline.
1411 If neither is set, use a space.
1412 .\" ---------------------------------------------------------------------------
1413 .TP 5
1414 .B dlg_add_string
1415 Add a quoted or unquoted string to the result buffer
1416 (see \fBdlg_add_quoted\fP) and \fBdlg_add_result\fP),
1417 according to whether \fBdialog_vars.quoted\fP is true.
1418 .RS
1419 .TP 5
1420 .B char * \fIstring
1421 is the string to add.
1422 .RE
1423 .\" ---------------------------------------------------------------------------
1424 .TP 5
1425 .B dlg_align_columns
1426 Copy and reformat an array of pointers to strings, aligning according to
1427 the column separator \fBdialog_vars.column_separator\fP.
1428 If no column separator is set, the array will be unmodified;
1429 otherwise it is copied and reformatted.
1430 .IP
1431 Caveat: This function is only implemented for 8-bit characters.
1432 .RS
1433 .TP 5
1434 .B char **\fItarget
1435 This is the array to reformat.
1436 It points to the first string to modify.
1437 .TP 5
1438 .B int \fIper_row
1439 This is the size of the struct for each row of the array.
1440 .TP 5
1441 .B int \fInum_rows
1442 This is the number of rows in the array.
1443 .RE
1444 .\" ---------------------------------------------------------------------------
1445 .TP 5
1446 .B dlg_allocate_gauge
1447 Allocates a gauge widget.
1448 Use \fBdlg_update_gauge\fP to display the result.
1449 .RS
1450 .TP 5
1451 .B const char * \fItitle
1452 is the title string to display at the top of the widget.
1453 .TP 5
1454 .B const char * \fIcprompt
1455 is the prompt text shown within the widget.
1456 .TP 5
1457 .B int \fIheight
1458 is the desired height of the box.
1459 If zero, the height is adjusted to use the available screen size.
1460 .TP 5
1461 .B int \fIwidth
1462 is the desired width of the box.
1463 If zero, the height is adjusted to use the available screen size.
1464 .TP 5
1465 .B int \fIpercent
1466 is the percentage to show in the progress bar.
1467 .RE
1468 .\" ---------------------------------------------------------------------------
1469 .TP 5
1470 .B dlg_asciibox
1471 returns its parameter transformed to the
1472 corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
1473 If the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns 0.
1474 .RS
1475 .TP 5
1476 .B chtype \fIch
1477 is the parameter, usually one of the \fBACS_\fP\fIxxx\fP constants.
1478 .RE
1479 .\" ---------------------------------------------------------------------------
1480 .TP 5
1481 .B dlg_attr_clear
1482 Set window to the given attribute.
1483 .RS
1484 .TP 5
1485 .B WINDOW * \fIwin
1486 is the window to update.
1487 .TP 5
1488 .B int \fIheight
1489 is the number of rows to update.
1490 .TP 5
1491 .B int \fIwidth
1492 is the number of columns to update.
1493 .TP 5
1494 .B chtype \fIattr
1495 is the attribute, e.g., \fBA_BOLD\fP.
1496 .RE
1497 .\" ---------------------------------------------------------------------------
1498 .TP 5
1499 .B dlg_auto_size
1500 Automatically size the window used for a widget.
1501 If the given height or width are zero,
1502 justify the \fIprompt\fP text and return the actual limits.
1503 .RS
1504 .TP 5
1505 .B const char * \fItitle
1506 is the title string to display at the top of the widget.
1507 .TP 5
1508 .B const char * \fIprompt
1509 is the message text which will be displayed in the widget,
1510 used here to determine how large the widget should be.
1511 .TP 5
1512 .B int * \fIheight
1513 is the nominal height.
1514 .TP 5
1515 .B int * \fIwidth
1516 is the nominal width.
1517 .TP 5
1518 .B int \fIboxlines
1519 is the number of lines to reserve in the vertical direction.
1520 .TP 5
1521 .B int \fImincols
1522 is the minimum number of columns to use.
1523 .RE
1524 .\" ---------------------------------------------------------------------------
1525 .TP 5
1526 .B dlg_auto_sizefile
1527 Like \fBdlg_auto_size\fP, but use a file contents to decide how large
1528 the widget should be.
1529 .RS
1530 .TP 5
1531 .B const char * \fItitle
1532 is the title string to display at the top of the widget.
1533 .TP 5
1534 .B const char * \fIfile
1535 is the name of the file.
1536 .TP 5
1537 .B int * \fIheight
1538 is the nominal height.
1539 If it is -1, use the screen's height (after subtracting \fBdialog_vars.begin_y\fP
1540 if \fBdialog_vars.begin_set\fP is true).
1541 .TP 5
1542 .B int * \fIwidth
1543 is the nominal width.
1544 If it is -1, use the screen's width (after subtracting \fBdialog_vars.begin_x\fP
1545 if \fBdialog_vars.begin_set\fP is true).
1546 .TP 5
1547 .B int \fIboxlines
1548 is the number of lines to reserve on the screen for drawing boxes.
1549 .TP 5
1550 .B int \fImincols
1551 is the number of columns to reserve on the screen for drawing boxes.
1552 .RE
1553 .\" ---------------------------------------------------------------------------
1554 .TP 5
1555 .B dlg_beeping
1556 If \fBdialog_vars.beep_signal\fP is nonzero,
1557 this calls \fBbeep\fP once and sets
1558 \fBdialog_vars.beep_signal\fP to zero.
1559 .\" ---------------------------------------------------------------------------
1560 .TP 5
1561 .B dlg_boxchar
1562 returns its \fBchtype\fP parameter transformed as follows:
1563 .RS
1564 .bP
1565 if neither \fBdialog_vars.ascii_lines\fP nor \fBdialog_vars.no_lines\fP is set.
1566 .bP
1567 if \fBdialog_vars.ascii_lines\fP is set, returns the corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
1568 .bP
1569 otherwise, if \fBdialog_vars.no_lines\fP is set, returns a space for the line-drawing characters.
1570 .bP
1571 if the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns the parameter unchanged.
1572 .RE
1573 .\" ---------------------------------------------------------------------------
1574 .TP 5
1575 .B dlg_box_x_ordinate
1576 returns a suitable x-ordinate (column) for a new widget.
1577 If \fBdialog_vars.begin_set\fP is 1,
1578 use \fBdialog_vars.begin_x\fP;
1579 otherwise center the widget on the screen (using the \fIwidth\fP parameter).
1580 .RS
1581 .TP 5
1582 .B int \fIwidth
1583 is the width of the widget.
1584 .RE
1585 .\" ---------------------------------------------------------------------------
1586 .TP 5
1587 .B dlg_box_y_ordinate
1588 returns a suitable y-ordinate (row) for a new widget.
1589 If \fBdialog_vars.begin_set\fP is 1,
1590 use \fBdialog_vars.begin_y\fP;
1591 otherwise center the widget on the screen (using the \fIheight\fP parameter).
1592 .RS
1593 .TP 5
1594 .B int \fIheight
1595 is the height of the widget.
1596 .RE
1597 .\" ---------------------------------------------------------------------------
1598 .TP 5
1599 .B dlg_buildlist
1600 This is an alternate interface to the \fBbuildlist\fP widget
1601 which allows the application to read the list item states back
1602 directly without putting them in the output buffer.
1603 .RS
1604 .TP 5
1605 .B const char * \fItitle
1606 is the title string to display at the top of the widget.
1607 .TP 5
1608 .B const char * \fIcprompt
1609 is the prompt text shown within the widget.
1610 .TP 5
1611 .B int \fIheight
1612 is the desired height of the box.
1613 If zero, the height is adjusted to use the available screen size.
1614 .TP 5
1615 .B int \fIwidth
1616 is the desired width of the box.
1617 If zero, the height is adjusted to use the available screen size.
1618 .TP 5
1619 .B int \fIlist_height
1620 is the minimum height to reserve for displaying the list.
1621 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1622 .TP 5
1623 .B int \fIitem_no
1624 is the number of rows in \fIitems\fP.
1625 .TP 5
1626 .B DIALOG_LISTITEM * \fIitems
1627 is the list of items, contain tag, name, and optionally help strings
1628 (if \fBdialog_vars.item_help\fP is set).
1629 The initial selection state for each item is also in this list.
1630 .TP 5
1631 .B const char * \fIstates
1632 This is a list of characters to display for the given states.
1633 Normally a buildlist provides true (1) and false (0) values,
1634 which the widget displays as "*" and space, respectively.
1635 An application may set this parameter to an arbitrary null-terminated string.
1636 The widget determines the number of states from the length of this string,
1637 and will cycle through the corresponding display characters as the user
1638 presses the space-bar.
1639 .TP 5
1640 .B int \fIorder_mode
1641 is reserved for future enhancements
1642 .TP 5
1643 .B int * \fIcurrent_item
1644 The widget sets the referenced location to the index of the current display
1645 item (cursor) when it returns.
1646 .RE
1647 .\" ---------------------------------------------------------------------------
1648 .TP 5
1649 .B dlg_button_count
1650 Count the buttons in the list.
1651 .RS
1652 .TP 5
1653 .B const char ** \fIlabels
1654 is a list of (pointers to) button labels terminated by a null pointer.
1655 .RE
1656 .\" ---------------------------------------------------------------------------
1657 .TP 5
1658 .B dlg_button_layout
1659 Make sure there is enough space for the buttons by
1660 computing the width required for their labels,
1661 adding margins and limiting based on the screen size.
1662 .RS
1663 .TP 5
1664 .B const char ** \fIlabels
1665 is a list of (pointers to) button labels terminated by a null pointer.
1666 .TP 5
1667 .B int * \fIlimit
1668 the function sets the referenced \fIlimit\fP to the width required for
1669 the buttons (limited by the screen size)
1670 if that is wider than the passed-in limit.
1671 .RE
1672 .\" ---------------------------------------------------------------------------
1673 .TP 5
1674 .B dlg_button_sizes
1675 Compute the size of the button array in columns.
1676 .RS
1677 .TP 5
1678 .B const char ** \fIlabels
1679 is a list of (pointers to) button labels terminated by a null pointer.
1680 .TP 5
1681 .B int \fIvertical
1682 is true if the buttons are arranged in a column rather than a row.
1683 .TP 5
1684 .B int * \fIlongest
1685 Return the total number of columns in the referenced location.
1686 .TP 5
1687 .B int * \fIlength
1688 Return the longest button's columns in the referenced location.
1689 .RE
1690 .\" ---------------------------------------------------------------------------
1691 .TP 5
1692 .B dlg_button_x_step
1693 Compute the step-size needed between elements of the button array.
1694 .RS
1695 .TP 5
1696 .B const char ** \fIlabels
1697 is a list of (pointers to) button labels terminated by a null pointer.
1698 .TP 5
1699 .B int \fIlimit
1700 is the maximum number of columns to allow for the buttons.
1701 .TP 5
1702 .B int * \fIgap
1703 store the nominal gap between buttons in the referenced location.
1704 This is constrained to be at least one.
1705 .TP 5
1706 .B int * \fImargin
1707 store the left+right total margins (for the list of buttons) in the referenced
1708 location.
1709 .TP 5
1710 .B int * \fIstep
1711 store the step-size in the referenced location.
1712 .RE
1713 .\" ---------------------------------------------------------------------------
1714 .TP 5
1715 .B dlg_button_to_char
1716 Find the first uppercase character in the label, which we may use for an
1717 abbreviation.
1718 If the label is empty, return -1.
1719 If no uppercase character is found, return 0.
1720 Otherwise return the uppercase character.
1721 .IP
1722 Normally
1723 .B dlg_draw_buttons
1724 and
1725 .B dlg_char_to_button
1726 use the first uppercase character.
1727 However, they keep track of all of the labels and
1728 if the first has already been used in another label,
1729 they will continue looking for another uppercase character.
1730 This function does not have enough information to make that check.
1731 .RS
1732 .TP 5
1733 .B const char * \fIlabel
1734 is the label to test.
1735 .RE
1736 .\" ---------------------------------------------------------------------------
1737 .TP 5
1738 .B dlg_calc_list_width
1739 Calculate the minimum width for the list,
1740 assuming none of the items are truncated.
1741 .RS
1742 .TP 5
1743 .B int \fIitem_no
1744 is the number of \fIitems\fP.
1745 .TP 5
1746 .B DIALOG_LISTITEM * \fIitems
1747 contains a \fIname\fP and \fItext\fP field,
1748 e.g., for checklists or radiobox lists.
1749 The function returns the sum of the widest columns
1750 needed for of each of these fields.
1751 .IP
1752 If \fBdialog_vars.no_items\fP is set,
1753 the \fItext\fP fields in the list are ignored.
1754 .RE
1755 .\" ---------------------------------------------------------------------------
1756 .TP 5
1757 .B dlg_calc_listh
1758 Calculate new height and list_height values.
1759 .RS
1760 .TP 5
1761 .B int * \fIheight
1762 on input, is the height without adding the list-height.
1763 On return, this contains the total list-height and is the
1764 actual widget's height.
1765 .TP 5
1766 .B int * \fIlist_height
1767 on input, is the requested list-height.
1768 On return, this contains the number of rows available for displaying
1769 the list after taking into account the screen size and
1770 the \fBdialog_vars.begin_set\fP and \fBdialog_vars.begin_y\fP variables.
1771 .TP 5
1772 .B int \fIitem_no
1773 is the number of \fIitems\fP in the list.
1774 .RE
1775 .\" ---------------------------------------------------------------------------
1776 .TP 5
1777 .B dlg_calc_listw
1778 This function is obsolete, provided for library-compatibility.
1779 It is replaced by \fBdlg_calc_list_width\fP.
1780 .RS
1781 .TP 5
1782 .B int \fIitem_no
1783 is the number of \fIitems\fP.
1784 .TP 5
1785 .B char ** \fIitems
1786 is a list of character pointers.
1787 .TP 5
1788 .B int \fIgroup
1789 is the number of items in each group, e.g., the second array index.
1790 .RE
1791 .\" ---------------------------------------------------------------------------
1792 .TP 5
1793 .B dlg_char_to_button
1794 Given a list of button labels,
1795 and a character which may be the abbreviation for one, find it, if it exists.
1796 An abbreviation will be the first character
1797 which happens to be capitalized in the label.
1798 If the character is found, return its index within the list of \fIlabels\fP.
1799 Otherwise, return \fBDLG_EXIT_UNKNOWN\fP.
1800 .RS
1801 .TP 5
1802 .B int \fIch
1803 is the character to find.
1804 .TP 5
1805 .B const char ** \fIlabels
1806 is a list of (pointers to) button labels terminated by a null pointer.
1807 .RE
1808 .\" ---------------------------------------------------------------------------
1809 .TP 5
1810 .B dlg_checklist
1811 This entrypoint provides the \fB--checklist\fP or \fP--radiolist\fP
1812 functionality without the limitations of \fB\*p\fP's command-line syntax
1813 (compare to \fBdialog_checklist\fP).
1814 .RS
1815 .TP 5
1816 .B const char * \fItitle
1817 is the title string to display at the top of the widget.
1818 .TP 5
1819 .B const char * \fIcprompt
1820 is the prompt text shown within the widget.
1821 .TP 5
1822 .B int \fIheight
1823 is the desired height of the box.
1824 If zero, the height is adjusted to use the available screen size.
1825 .TP 5
1826 .B int \fIwidth
1827 is the desired width of the box.
1828 If zero, the height is adjusted to use the available screen size.
1829 .TP 5
1830 .B int \fIlist_height
1831 is the minimum height to reserve for displaying the list.
1832 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1833 .TP 5
1834 .B int \fIitem_no
1835 is the number of \fIitems\fP.
1836 .TP 5
1837 .B DIALOG_LISTITEM * \fIitems
1838 This is a list of the items to display in the checklist.
1839 .TP 5
1840 .B const char * \fIstates
1841 This is a list of characters to display for the given states.
1842 Normally a checklist provides true (1) and false (0) values,
1843 which the widget displays as "*" and space, respectively.
1844 An application may set this parameter to an arbitrary null-terminated string.
1845 The widget determines the number of states from the length of this string,
1846 and will cycle through the corresponding display characters as the user
1847 presses the space-bar.
1848 .TP 5
1849 .B int \fIflag
1850 This is should be one of \fBFLAG_CHECK\fP or \fPFLAG_RADIO\fP,
1851 depending on whether the widget should act as a checklist or radiobox.
1852 .TP 5
1853 .B int * \fIcurrent_item
1854 The widget sets the referenced location to the index of the current display
1855 item (cursor) when it returns.
1856 .RE
1857 .\" ---------------------------------------------------------------------------
1858 .TP 5
1859 .B dlg_check_scrolled
1860 given a function key (or other key that was mapped to a function key),
1861 check if it is one of the up/down scrolling functions:
1862 .sp
1863 .RS
1864         DLGK_PAGE_FIRST,
1865 .br
1866         DLGK_PAGE_LAST,
1867 .br
1868         DLGK_GRID_UP,
1869 .br
1870         DLGK_GRID_DOWN,
1871 .br
1872         DLGK_PAGE_PREV or
1873 .br
1874         DLGK_PAGE_NEXT.
1875 .RE
1876 .fi
1877 .IP
1878 Some widgets use these key bindings for scrolling the prompt-text up and
1879 down, to allow for display in very small windows.
1880 .IP
1881 The function returns 0 (zero) if it finds one of these keys,
1882 and -1 if not.
1883 .RS
1884 .TP 5
1885 .B int \fIkey
1886 is the function-key to check
1887 .TP 5
1888 .B int \fIlast
1889 is the number of lines
1890 which would be used to display the scrolled prompt in
1891 an arbitrarily tall window.
1892 It is used here to check limits for the \fIoffset\fP value.
1893 .TP 5
1894 .B int \fIpage
1895 this is the available height for writing scrolled text,
1896 which is smaller than the window if it contains buttons.
1897 .TP 5
1898 .B bool * \fIshow
1899 on return, holds TRUE if \fBdlg_print_scrolled\fP should be used to redisplay
1900 the prompt text.
1901 .TP 5
1902 .B int * \fIoffset
1903 on entry, holds the starting line number (counting from zero)
1904 last used for \fBdlg_print_scrolled\fP.
1905 On return, holds the updated starting line number.
1906 .RE
1907 .\" ---------------------------------------------------------------------------
1908 .TP 5
1909 .B dlg_clear
1910 Set window to the default \fB\*p\fP screen attribute.
1911 This is set in the rc-file with \fBscreen_color\fP.
1912 .\" ---------------------------------------------------------------------------
1913 .TP 5
1914 .B dlg_clr_result
1915 Free storage used for the result buffer (\fBdialog_vars.input_result\fP).
1916 The corresponding pointer is set to NULL.
1917 .\" ---------------------------------------------------------------------------
1918 .TP 5
1919 .B dlg_color_count
1920 Return the number of colors that can be configured in \fB\*p\fP.
1921 .\" ---------------------------------------------------------------------------
1922 .TP 5
1923 .B dlg_color_setup
1924 Initialize the color pairs used in \fB\*p\fP.
1925 .\" ---------------------------------------------------------------------------
1926 .TP 5
1927 .B dlg_count_argv
1928 Count the entries in an argument vector.
1929 .RS
1930 .TP 5
1931 .B argv
1932 Points to the argument vector.
1933 .RE
1934 .\" ---------------------------------------------------------------------------
1935 .TP 5
1936 .B dlg_count_columns
1937 Returns the number of columns used for a string.
1938 This is not necessarily the number of bytes in a string.
1939 .RS
1940 .TP 5
1941 .B const char * \fIstring
1942 is the string to measure.
1943 .RE
1944 .\" ---------------------------------------------------------------------------
1945 .TP 5
1946 .B dlg_count_real_columns
1947 Returns the number of columns used for a string,
1948 accounting for "\\Z" sequences which can be used for
1949 coloring the text if \fBdialog_vars.colors\fP is set.
1950 This is not necessarily the number of bytes in a string.
1951 .RS
1952 .TP 5
1953 .B const char * \fIstring
1954 is the string to measure.
1955 .RE
1956 .\" ---------------------------------------------------------------------------
1957 .TP 5
1958 .B dlg_count_wchars
1959 Returns the number of wide-characters in the string.
1960 .RS
1961 .TP 5
1962 .B const char * \fIstring
1963 is the string to measure.
1964 .RE
1965 .\" ---------------------------------------------------------------------------
1966 .TP 5
1967 .B dlg_create_rc
1968 Create a configuration file,
1969 i.e., write internal tables to a file which can be read back by \fB\*p\fP
1970 as an rc-file.
1971 .RS
1972 .TP 5
1973 .B const char * \fIfilename
1974 is the name of the file to write to.
1975 .RE
1976 .\" ---------------------------------------------------------------------------
1977 .TP 5
1978 .B dlg_ctl_size
1979 If \fBdialog_vars.size_err\fP is true,
1980 check if the given window size is too large to fit on the screen.
1981 If so, exit with an error reporting the size of the window.
1982 .RS
1983 .TP 5
1984 .B int \fIheight
1985 is the window's height
1986 .TP 5
1987 .B int \fIwidth
1988 is the window's width
1989 .RE
1990 .\" ---------------------------------------------------------------------------
1991 .TP 5
1992 .B dlg_default_button
1993 If \fBdialog_vars.default_button\fP is positive,
1994 return the button-index for that button code,
1995 using \fBdlg_ok_buttoncode\fP to test indices starting with zero.
1996 Otherwise (or if no match was found for the button code), return zero.
1997 .\" ---------------------------------------------------------------------------
1998 .TP 5
1999 .B dlg_default_formitem
2000 If \fBdialog_vars.default_item\fP is not null,
2001 find that name by matching the \fIname\fP field in the list of form \fIitems\fP.
2002 If found, return the index of that item in the list.
2003 Otherwise, return zero.
2004 .RS
2005 .TP 5
2006 .B DIALOG_FORMITEM * \fIitems
2007 is the list of items to search.
2008 It is terminated by an entry with a null \fIname\fP field.
2009 .RE
2010 .\" ---------------------------------------------------------------------------
2011 .TP 5
2012 .B dlg_default_item
2013 This function is obsolete, provided for library-compatibility.
2014 It is replaced by \fBdlg_default_formitem\fP and \fBdlg_default_listitem\fP.
2015 .RS
2016 .TP 5
2017 .B char ** \fIitems
2018 is the list of items to search.
2019 .TP 5
2020 .B int \fIllen
2021 is the number of items in each group, e.g., the second array index.
2022 .RE
2023 .\" ---------------------------------------------------------------------------
2024 .TP 5
2025 .B dlg_defaultno_button
2026 If \fBdialog_vars.defaultno\fP is true, and \fBdialog_vars.nocancel\fP is not,
2027 find the button-index for the "Cancel" button.
2028 Otherwise, return the index for "OK" (always zero).
2029 .\" ---------------------------------------------------------------------------
2030 .TP 5
2031 .B dlg_del_window
2032 Remove a window, repainting everything else.
2033 .RS
2034 .TP 5
2035 .B WINDOW * \fIwin
2036 is the window to remove.
2037 .RE
2038 .\" ---------------------------------------------------------------------------
2039 .TP 5
2040 .B dlg_does_output
2041 This is called each time a widget is invoked which may do output.
2042 It increments \fBdialog_state.output_count\fP,
2043 so the output function in \fB\*p\fP can test this and add a separator.
2044 .\" ---------------------------------------------------------------------------
2045 .TP 5
2046 .B dlg_draw_arrows
2047 Draw up/down arrows on a window, e.g., for scrollable lists.
2048 It calls \fBdlg_draw_arrows2\fP using the
2049 \fImenubox_color\fP and \fImenubox_border_color\fP attributes.
2050 .RS
2051 .TP 5
2052 .B WINDOW * \fIdialog
2053 is the window on which to draw an arrow.
2054 .TP 5
2055 .B int \fItop_arrow
2056 is true if an up-arrow should be drawn at the top of the window.
2057 .TP 5
2058 .B int \fIbottom_arrow
2059 is true if an down-arrow should be drawn at the bottom of the window.
2060 .TP 5
2061 .B int \fIx
2062 is the zero-based column within the window on which to draw arrows.
2063 .TP 5
2064 .B int \fItop
2065 is the zero-based row within the window on which to draw up-arrows
2066 as well as a horizontal line to show the window's top.
2067 .TP 5
2068 .B int \fIbottom
2069 is the zero-based row within the window on which to draw down-arrows
2070 as well as a horizontal line to show the window's bottom.
2071 .RE
2072 .\" ---------------------------------------------------------------------------
2073 .TP 5
2074 .B dlg_draw_arrows2
2075 Draw up/down arrows on a window, e.g., for scrollable lists.
2076 .RS
2077 .TP 5
2078 .B WINDOW * \fIdialog
2079 is the window on which to draw an arrow.
2080 .TP 5
2081 .B int \fItop_arrow
2082 is true if an up-arrow should be drawn at the top of the window.
2083 .TP 5
2084 .B int \fIbottom_arrow
2085 is true if an down-arrow should be drawn at the bottom of the window.
2086 .TP 5
2087 .B int \fIx
2088 is the zero-based column within the window on which to draw arrows.
2089 .TP 5
2090 .B int \fItop
2091 is the zero-based row within the window on which to draw up-arrows
2092 as well as a horizontal line to show the window's top.
2093 .TP 5
2094 .B int \fIbottom
2095 is the zero-based row within the window on which to draw down-arrows
2096 as well as a horizontal line to show the window's bottom.
2097 .TP 5
2098 .B chtype \fIattr
2099 is the window's background attribute.
2100 .TP 5
2101 .B chtype \fIborderattr
2102 is the window's border attribute.
2103 .RE
2104 .\" ---------------------------------------------------------------------------
2105 .TP 5
2106 .B dlg_draw_bottom_box
2107 Draw a partial box at the bottom of a window,
2108 e.g., to surround a row of buttons.
2109 It is designed to merge with an existing box around
2110 the whole window (see \fBdlg_draw_box\fP),
2111 so it uses tee-elements rather than corner-elements
2112 on the top corners of this box.
2113 .RS
2114 .TP 5
2115 .B WINDOW * \fIwin
2116 is the window to update.
2117 .RE
2118 .\" ---------------------------------------------------------------------------
2119 .TP 5
2120 .B dlg_draw_bottom_box2
2121 Draw a partial box at the bottom of a window,
2122 e.g., to surround a row of buttons.
2123 It is designed to merge with an existing box around
2124 the whole window (see \fBdlg_draw_box2\fP),
2125 so it uses tee-elements rather than corner-elements
2126 on the top corners of this box.
2127 .RS
2128 .TP 5
2129 .B WINDOW * \fIwin
2130 is the window to update.
2131 .B chtype \fIon_left
2132 is used to color the upper/left edges of the box, i.e., the tee-element and
2133 horizontal line
2134 .B chtype \fIon_right
2135 is used to color the right edge of the box, i.e., the tee-element
2136 .B chtype \fIon_inside
2137 is used to fill-color the inside of the box
2138 .RE
2139 .\" ---------------------------------------------------------------------------
2140 .TP 5
2141 .B dlg_draw_box
2142 Draw a rectangular box with line drawing characters.
2143 .RS
2144 .TP 5
2145 .B WINDOW * \fIwin
2146 is the window to update.
2147 .TP 5
2148 .B int \fIy
2149 is the top row of the box.
2150 .TP 5
2151 .B int \fIx
2152 is the left column of the box.
2153 .TP 5
2154 .B int \fIheight
2155 is the height of the box.
2156 .TP 5
2157 .B int \fIwidth
2158 is the width of the box.
2159 .TP 5
2160 .B chtype \fIboxchar
2161 is used to color the right/lower edges.
2162 It also is fill-color used for the box contents.
2163 .TP 5
2164 .B chtype \fIborderchar
2165 is used to color the upper/left edges.
2166 .RE
2167 .\" ---------------------------------------------------------------------------
2168 .TP 5
2169 .B dlg_draw_box2
2170 Draw a rectangular box with line drawing characters.
2171 .RS
2172 .TP 5
2173 .B WINDOW * \fIwin
2174 is the window to update.
2175 .TP 5
2176 .B int \fIy
2177 is the top row of the box.
2178 .TP 5
2179 .B int \fIx
2180 is the left column of the box.
2181 .TP 5
2182 .B int \fIheight
2183 is the height of the box.
2184 .TP 5
2185 .B int \fIwidth
2186 is the width of the box.
2187 .TP 5
2188 .B chtype \fIboxchar
2189 is used to fill-color for the box contents.
2190 .TP 5
2191 .B chtype \fIborderchar
2192 is used to color the upper/left edges.
2193 .TP 5
2194 .B chtype \fIborderchar2
2195 is used to color the right/lower edges.
2196 .RE
2197 .\" ---------------------------------------------------------------------------
2198 .TP 5
2199 .B dlg_draw_buttons
2200 Print a list of buttons at the given position.
2201 .RS
2202 .TP 5
2203 .B WINDOW * \fIwin
2204 is the window to update.
2205 .TP 5
2206 .B int \fIy
2207 is the starting row.
2208 .TP 5
2209 .B int \fIx
2210 is the starting column.
2211 .TP 5
2212 .B const char ** \fIlabels
2213 is a list of (pointers to) button labels terminated by a null pointer.
2214 .TP 5
2215 .B int \fIselected
2216 is the index within the list of the selected button.
2217 .TP 5
2218 .B int \fIvertical
2219 is true if the buttons are arranged in a column rather than a row.
2220 .TP 5
2221 .B int \fIlimit
2222 is the number of columns (or rows if \fIvertical\fP) allowed for the display.
2223 .RE
2224 .\" ---------------------------------------------------------------------------
2225 .TP 5
2226 .B dlg_draw_helpline
2227 draw the text in \fBdialog_vars.help_line\fP at the bottom of the given window.
2228 .RS
2229 .TP 5
2230 .B WINDOW * \fIdialog
2231 is the window to modify.
2232 .TP 5
2233 .B bool \fIdecorations
2234 if true, allow room for the scrolling arrows.
2235 .RE
2236 .\" ---------------------------------------------------------------------------
2237 .TP 5
2238 .B dlg_draw_scrollbar
2239 If \fBdialog_state.use_scrollbar\fP is set,
2240 draw a scrollbar on the right margin of windows holding scrollable data.
2241 Also (whether or not the scrollbar is drawn),
2242 annotate the bottom margin of the window with the percentage of data
2243 by the bottom of that window,
2244 and call \fBdlg_draw_arrows2\fP to put markers on the window showing
2245 when more data is available.
2246 .RS
2247 .TP 5
2248 .B WINDOW * \fIwin
2249 is the window in which the data is scrolled.
2250 Because \fIleft\fP, \fIright\fP, \fItop\fP, \fIbottom\fP
2251 are passed as parameters, this window can contain additional data.
2252 .TP 5
2253 .B long \fIfirst_data
2254 is the zero-based index to the first row of data in the current window.
2255 .TP 5
2256 .B long \fIthis_data
2257 is the zero-based index to the current row of data.
2258 .TP 5
2259 .B long \fInext_data
2260 is the zero-based index to the next data after the current row.
2261 .TP 5
2262 .B long \fItotal_data
2263 is the total number of rows of data.
2264 .TP 5
2265 .B int \fIleft
2266 is the zero-based left margin/column of the window.
2267 The up/down arrows are draw inset by 5 columns from this point.
2268 .TP 5
2269 .B int \fIright
2270 is the zero-based right margin/column of the window.
2271 The scrollbar is drawn flush against this column.
2272 .TP 5
2273 .B int \fItop
2274 is the zero-based row within the window on which to draw up-arrows
2275 as well as a horizontal line to show the window's top.
2276 .TP 5
2277 .B int \fIbottom
2278 is the zero-based row within the window on which to draw down-arrows
2279 as well as a horizontal line to show the window's bottom.
2280 .TP 5
2281 .B chtype \fIattr
2282 is the window's background attribute.
2283 .TP 5
2284 .B chtype \fIborderattr
2285 is the window's border attribute.
2286 .RE
2287 .\" ---------------------------------------------------------------------------
2288 .TP 5
2289 .B dlg_draw_shadow
2290 Draw shadows along the right and bottom edge of a window to give it
2291 a 3-dimensional look.
2292 (The height, etc., may not be the same as the window's actual values).
2293 .RS
2294 .TP 5
2295 .B WINDOW * \fIwin
2296 is the window to update.
2297 .TP 5
2298 .B int \fIheight
2299 is the height of the window.
2300 .TP 5
2301 .B int \fIwidth
2302 is the width of the window.
2303 .TP 5
2304 .B int \fIy
2305 is the top row of the window.
2306 .TP 5
2307 .B int \fIx
2308 is the left column of the window.
2309 .RE
2310 .\" ---------------------------------------------------------------------------
2311 .TP 5
2312 .B dlg_draw_title
2313 Draw a title centered at the top of the window.
2314 .RS
2315 .TP 5
2316 .B WINDOW * \fIwin
2317 is the window to update.
2318 .TP 5
2319 .B const char * \fItitle
2320 is the title string to display at the top of the widget.
2321 .RE
2322 .\" ---------------------------------------------------------------------------
2323 .TP 5
2324 .B dlg_dummy_menutext
2325 This is a utility function which supports the \fB--inputmenu\fP option of
2326 the \fB\*p\fP program.
2327 If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
2328 pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
2329 Otherwise, it passes \fBdlg_dummy_menutext\fP.
2330 .IP
2331 The function should only return \fBDLG_EXIT_ERROR\fP.
2332 .RS
2333 .TP 5
2334 .B DIALOG_LISTITEM * \fIitems
2335 is the list of menu items
2336 .TP 5
2337 .B int \fIcurrent
2338 is the index of the currently-selected item
2339 .TP 5
2340 .B char * \fInewtext
2341 is the updated text for the menu item
2342 .RE
2343 .\" ---------------------------------------------------------------------------
2344 .TP 5
2345 .B dlg_dump_keys
2346 Write all user-defined key-bindings to the given stream,
2347 e.g., as part of \fBdlg_create_rc\fP.
2348 .RS
2349 .TP 5
2350 .B FILE * \fIfp
2351 is the stream on which to write the bindings.
2352 .RE
2353 .\" ---------------------------------------------------------------------------
2354 .TP 5
2355 .B dlg_dump_window_keys
2356 Write all user-defined key-bindings to the given stream,
2357 e.g., as part of \fBdlg_create_rc\fP.
2358 .RS
2359 .TP 5
2360 .B FILE * \fIfp
2361 is the stream on which to write the bindings.
2362 .TP 5
2363 .B WINDOW * \fIwin
2364 is the window for which bindings should be dumped.
2365 If it is null, then only built-in bindings are dumped.
2366 .RE
2367 .\" ---------------------------------------------------------------------------
2368 .TP 5
2369 .B dlg_eat_argv
2370 Remove one or more items from an argument vector.
2371 .RS
2372 .TP 5
2373 .B int *argcp
2374 in/out parameter giving the length of the argument vector.
2375 .B char ***argvp
2376 in/out parameter pointing to the argument vector.
2377 .B int start
2378 starting index.
2379 .B int count
2380 number of arguments to remove.
2381 .RE
2382 .\" ---------------------------------------------------------------------------
2383 .TP 5
2384 .B dlg_edit_offset
2385 Given the character-offset in the string,
2386 returns the display-offset where
2387 \fB\*p\fP should position the cursor.
2388 In this context, "characters" may be multicolumn,
2389 since the string can be a multibyte character string.
2390 .RS
2391 .TP 5
2392 .B char * \fIstring
2393 is the string to analyze
2394 .TP 5
2395 .B int \fIoffset
2396 is the character-offset
2397 .TP 5
2398 .B int \fIx_last
2399 is a limit on the column positions that can be used,
2400 e.g., the window's size.
2401 .RE
2402 .\" ---------------------------------------------------------------------------
2403 .TP 5
2404 .B dlg_edit_string
2405 Updates the string and character-offset, given various editing characters
2406 or literal characters which are inserted at the character-offset.
2407 Returns true if an editing change was made (and the display should
2408 be updated), and false if the key was something like KEY_ENTER,
2409 which is a non-editing action outside this function.
2410 .RS
2411 .TP 5
2412 .B char * \fIstring
2413 is the (multibyte) string to update
2414 .TP 5
2415 .B int * \fIoffset
2416 is the character-offset
2417 .TP 5
2418 .B int \fIkey
2419 is the editing key
2420 .TP 5
2421 .B int \fIfkey
2422 is true if the editing key is a function-key
2423 .TP 5
2424 .B bool \fIforce
2425 is used in a special loop case by calling code to force the return
2426 value of this function when a function-key code 0 is passed in.
2427 .RE
2428 .\" ---------------------------------------------------------------------------
2429 .TP 5
2430 .B dlg_exit
2431 Given an internal exit code,
2432 check if the corresponding environment variable is set.
2433 If so, remap the exit code to match the environment variable.
2434 Finally call \fBexit\fP with the resulting exit code.
2435 .RS
2436 .TP 5
2437 .B int \fIcode
2438 is the internal exit code, e.g., \fBDLG_EXIT_OK\fP,
2439 which may be remapped.
2440 .RE
2441 .IP
2442 The \fB\*p\fP program uses this function
2443 to allow shell scripts to remap the exit codes so they can distinguish ESC
2444 from ERROR.
2445 .\" ---------------------------------------------------------------------------
2446 .TP 5
2447 .B dlg_exit_buttoncode
2448 Map the given button index for \fBdlg_exit_label\fP into \fB\*p\fP's exit-code.
2449 .RS
2450 .TP 5
2451 .B int \fIbutton
2452 is the button index
2453 .RE
2454 .\" ---------------------------------------------------------------------------
2455 .TP 5
2456 .B dlg_exit_label
2457 Return a list of button labels.
2458 If dialog_var.extra_button is true, return the result of \fBdlg_ok_labels\fP.
2459 Otherwise, return a list with the "Exit" label and (if \fBdialog_vars.help_button\fP
2460 is set) the "Help" button as well.
2461 .\" ---------------------------------------------------------------------------
2462 .TP 5
2463 .B dlg_exiterr
2464 Quit program killing all \fBtailboxbg\fP widgets.
2465 .RS
2466 .TP 5
2467 .B const char * \fIfmt
2468 is the format of the \fBprintf\fP-like message to write.
2469 .TP 5
2470 .B ...
2471 .br
2472 are the variables to apply to the \fIfmt\fP format.
2473 .RE
2474 .\" ---------------------------------------------------------------------------
2475 .TP 5
2476 .B dlg_find_index
2477 Given the character-offset to find in the list, return the corresponding
2478 array index.
2479 .RS
2480 .TP 5
2481 .B const int *\fIlist
2482 contains a list of character-offsets,
2483 i.e., indices into a string that denote the beginning of multibyte characters.
2484 .TP 5
2485 .B int \fIlimit
2486 is the last index into \fBlist\fP to search.
2487 .TP 5
2488 .B int \fIto_find
2489 is the character-offset to find.
2490 .RE
2491 .\" ---------------------------------------------------------------------------
2492 .TP 5
2493 .B dlg_flush_getc
2494 Cancel the local data saved by \fBdlg_last_getc\fP.
2495 .\" ---------------------------------------------------------------------------
2496 .IP dlg_editbox
2497 This entrypoint provides the \fB--editbox\fP
2498 functionality without the limitations of \fB\*p\fP's command-line syntax
2499 (compare to \fBdialog_editbox\fP).
2500 .RS
2501 .TP 5
2502 .B const char * \fItitle
2503 is the title string to display at the top of the widget.
2504 .TP 5
2505 .B char *** \fIlist
2506 is a pointer to an array of \fBchar\ *\fP pointers.
2507 The array is allocated by the caller,
2508 and so are the strings to which it points.
2509 The \fBdlg_editbox\fP function may reallocate the
2510 array and the strings.
2511 .TP 5
2512 .B int * \fIrows
2513 points to the nominal length of \fIlist\fP.
2514 The referenced value is updated if\fIlist\fP is reallocated.
2515 .TP 5
2516 .B int \fIheight
2517 is the desired height of the box.
2518 If zero, the height is adjusted to use the available screen size.
2519 .TP 5
2520 .B int \fIwidth
2521 is the desired width of the box.
2522 If zero, the height is adjusted to use the available screen size.
2523 .RE
2524 .\" ---------------------------------------------------------------------------
2525 .TP 5
2526 .B dlg_form
2527 This entrypoint provides the \fB--form\fP
2528 functionality without the limitations of \fB\*p\fP's command-line syntax
2529 (compare to \fBdialog_form\fP).
2530 .RS
2531 .TP 5
2532 .B const char * \fItitle
2533 is the title string to display at the top of the widget.
2534 .TP 5
2535 .B const char * \fIcprompt
2536 is the prompt text shown within the widget.
2537 .TP 5
2538 .B int \fIheight
2539 is the desired height of the box.
2540 If zero, the height is adjusted to use the available screen size.
2541 .TP 5
2542 .B int \fIwidth
2543 is the desired width of the box.
2544 If zero, the height is adjusted to use the available screen size.
2545 .TP 5
2546 .B int \fIform_height
2547 is the minimum height to reserve for displaying the list.
2548 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
2549 .TP 5
2550 .B int \fIitem_no
2551 is the number of \fIitems\fP.
2552 .TP 5
2553 .B DIALOG_FORMITEM * \fIitems
2554 This is a list of the items to display in the form.
2555 .TP 5
2556 .B int * \fIcurrent_item
2557 The widget sets the referenced location to the index of the current display
2558 item (cursor) when it returns.
2559 .RE
2560 .\" ---------------------------------------------------------------------------
2561 .TP 5
2562 .B dlg_free_columns
2563 Free data allocated by \fBdlg_align_columns\fP.
2564 .RS
2565 .TP 5
2566 .B char **\fItarget
2567 This is the array which was reformatted.
2568 It points to the first string to free.
2569 .TP 5
2570 .B int \fIper_row
2571 This is the size of the struct for each row of the array.
2572 .TP 5
2573 .B int \fInum_rows
2574 This is the number of rows in the array.
2575 .RE
2576 .\" ---------------------------------------------------------------------------
2577 .TP 5
2578 .B dlg_free_formitems
2579 Free memory owned by a list of DIALOG_FORMITEM's.
2580 .RS
2581 .TP 5
2582 .B DIALOG_FORMITEM * \fIitems
2583 is the list to free.
2584 .RE
2585 .\" ---------------------------------------------------------------------------
2586 .TP 5
2587 .B dlg_free_gauge
2588 Remove the gauge widget from the screen and free its associated memory.
2589 .RS
2590 .TP 5
2591 .B void *\fIobjptr
2592 points to the gauge widget.
2593 .RE
2594 .\" ---------------------------------------------------------------------------
2595 .TP 5
2596 .B dlg_getc
2597 Read a character from the given window.
2598 Handle repainting here (to simplify
2599 things in the calling application).
2600 Also, if input-callback(s) are set up,
2601 poll the corresponding files and handle the updates,
2602 e.g., for displaying a tailbox.
2603 Returns the key-code.
2604 .RS
2605 .TP 5
2606 .B WINDOW * \fIwin
2607 is the window within which to read.
2608 .TP 5
2609 .B int * \fIfkey
2610 as a side-effect, set this to true if the key-code is really a function-key.
2611 .RE
2612 .\" ---------------------------------------------------------------------------
2613 .TP 5
2614 .B dlg_get_attrs
2615 extract the video attributes from the given window.
2616 .RS
2617 .TP 5
2618 .B WINDOW * \fIwin
2619 is the window from which to get attributes.
2620 .RE
2621 .\" ---------------------------------------------------------------------------
2622 .TP 5
2623 .B dlg_getc_callbacks
2624 passes the given key-code \fIch\fP to the current window that
2625 has established a callback.
2626 If the callback returns zero, remove it and try the next window.
2627 If no more callbacks remain, return.
2628 If any callbacks were found, return true, otherwise false.
2629 .RS
2630 .TP 5
2631 .B int \fIch
2632 is the key-code
2633 .TP 5
2634 .B int \fIfkey
2635 is true if the key is a function-key
2636 .TP 5
2637 .B int * \fIresult
2638 is used to pass an exit-code to the caller,
2639 which should pass that via \fBdlg_exit\fP.
2640 .RE
2641 .\" ---------------------------------------------------------------------------
2642 .TP 5
2643 .B dlg_index_columns
2644 Build a list of the display-columns for the given multibyte string's characters.
2645 .RS
2646 .TP 5
2647 .B const char * \fIstring
2648 is the string to analyze
2649 .RE
2650 .\" ---------------------------------------------------------------------------
2651 .TP 5
2652 .B dlg_index_wchars
2653 Build an index of the wide-characters in the string,
2654 so the caller can easily tell
2655 which byte-offset begins a given wide-character.
2656 .RS
2657 .TP 5
2658 .B const char * \fIstring
2659 is the string to analyze
2660 .RE
2661 .\" ---------------------------------------------------------------------------
2662 .TP 5
2663 .B dlg_item_help
2664 Draw the string for the \fBdialog_vars.item_help\fP feature.
2665 .RS
2666 .TP 5
2667 .B const char * \fItxt
2668 is the help-message
2669 .RE
2670 .\" ---------------------------------------------------------------------------
2671 .TP 5
2672 .B dlg_killall_bg
2673 If \fB\*p\fP has callbacks active,
2674 purge the list of all that are not marked
2675 to keep in the background.
2676 If any remain, run those in a background process.
2677 .RS
2678 .TP 5
2679 .B int * \fIretval
2680 stores the exit-code to pass back to the caller.
2681 .RE
2682 .\" ---------------------------------------------------------------------------
2683 .TP 5
2684 .B dlg_last_getc
2685 returns the most recent character that was read via \fBdlg_getc\fP.
2686 .\" ---------------------------------------------------------------------------
2687 .TP 5
2688 .B dlg_limit_columns
2689 Given a column limit,
2690 count the number of wide characters that can fit into that limit.
2691 The offset is used to skip over a leading character
2692 that was already written.
2693 .RS
2694 .TP 5
2695 .B const char * \fIstring
2696 is the string to analyze
2697 .TP 5
2698 .B int \fIlimit
2699 is the column limit
2700 .TP 5
2701 .B int \fIoffset
2702 is the starting offset from which analysis should continue
2703 .RE
2704 .\" ---------------------------------------------------------------------------
2705 .TP 5
2706 .B dlg_lookup_key
2707 Check for a key-binding.
2708 If there is no binding associated with the widget, it simply returns
2709 the given curses-key.
2710 Otherwise, it returns the result of the binding
2711 .RS
2712 .TP 5
2713 .B WINDOW * \fIwin
2714 is the window on which the binding is checked
2715 .TP 5
2716 .B int \fIcurses_key
2717 is the curses key-code
2718 .TP 5
2719 .B int * \fIdialog_key
2720 is the corresponding \fB\*p\fP internal code
2721 (see \fBDLG_KEYS_ENUM\fP in dlg_key.h).
2722 .RE
2723 .\" ---------------------------------------------------------------------------
2724 .TP 5
2725 .B dlg_max_input
2726 Limit the parameter according to \fBdialog_vars.max_input\fP
2727 .RS
2728 .TP 5
2729 .B int \fImax_len
2730 is the value to limit
2731 .RE
2732 .\" ---------------------------------------------------------------------------
2733 .TP 5
2734 .B dlg_match_char
2735 Match a given character against the beginning of the string,
2736 ignoring case of the given character.
2737 The matching string must begin with an uppercase character.
2738 .RS
2739 .TP 5
2740 .B int \fIch
2741 is the character to check
2742 .TP 5
2743 .B const char * \fIstring
2744 is the string to search
2745 .RE
2746 .\" ---------------------------------------------------------------------------
2747 .TP 5
2748 .B dlg_menu
2749 This entrypoint provides the \fB--menu\fP
2750 functionality without the limitations of \fB\*p\fP's command-line syntax
2751 (compare to \fBdialog_menu\fP).
2752 .RS
2753 .TP 5
2754 .B const char * \fItitle
2755 is the title string to display at the top of the widget.
2756 .TP 5
2757 .B const char * \fIcprompt
2758 is the prompt text shown within the widget.
2759 .TP 5
2760 .B int \fIheight
2761 is the desired height of the box.
2762 If zero, the height is adjusted to use the available screen size.
2763 .TP 5
2764 .B int \fIwidth
2765 is the desired width of the box.
2766 If zero, the height is adjusted to use the available screen size.
2767 .TP 5
2768 .B int \fImenu_height
2769 is the minimum height to reserve for displaying the list.
2770 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
2771 .TP 5
2772 .B int \fIitem_no
2773 is the number of \fIitems\fP.
2774 .TP 5
2775 .B DIALOG_LISTITEM * \fIitems
2776 This is a list of the items to display in the form.
2777 .TP 5
2778 .B int * \fIcurrent_item
2779 The widget sets the referenced location to the index of the current display
2780 item (cursor) when it returns.
2781 .TP 5
2782 .B DIALOG_INPUTMENU \fIrename_menutext
2783 If this is not \fBdlg_dummy_menutext\fP,
2784 the widget acts like an \fIinputmenu\fP widget,
2785 providing an extra "Rename" button,
2786 which activates an edit feature on the selected menu item.
2787 .RE
2788 .\" ---------------------------------------------------------------------------
2789 .TP 5
2790 .B dlg_move_window
2791 Moves/resizes the given window to the given position and size.
2792 .RS
2793 .TP 5
2794 .B WINDOW *\fIwin
2795 is the window to move/resize.
2796 .TP 5
2797 .B WINDOW *\fIheight
2798 is the height of the resized window.
2799 .TP 5
2800 .B WINDOW *\fIwidth
2801 is the width of the resized window.
2802 .TP 5
2803 .B WINDOW *\fIy
2804 y-ordinate to use for the repositioned window.
2805 .TP 5
2806 .B WINDOW *\fIx
2807 x-ordinate to use for the repositioned window.
2808 .RE
2809 .\" ---------------------------------------------------------------------------
2810 .TP 5
2811 .B dlg_mouse_bigregion
2812 Retrieve the big-region under the pointer.
2813 .RS
2814 .TP 5
2815 .B int \fIy
2816 is the row on which the mouse click occurred
2817 .TP 5
2818 .B int \fIx
2819 is the column on which the mouse click occurred
2820 .RE
2821 .\" ---------------------------------------------------------------------------
2822 .TP 5
2823 .B dlg_mouse_free_regions
2824 Free the memory associated with mouse regions.
2825 .\" ---------------------------------------------------------------------------
2826 .TP 5
2827 .B dlg_mouse_mkbigregion
2828 Creates a region on which the mouse-clicks will return a specifed code.
2829 .RS
2830 .TP 5
2831 .B int \fIy
2832 is the top-row of the region.
2833 .TP 5
2834 .B int \fIx
2835 is the left-column of the region.
2836 .TP 5
2837 .B int \fIheight
2838 is the height of the region.
2839 .TP 5
2840 .B int \fIwidth
2841 is the width of the region.
2842 .TP 5
2843 .B int \fIcode
2844 is a code used to make the region unique within a widget
2845 .TP 5
2846 .B int \fIstep_x
2847 is used in modes 2 (columns) and 3 (cells) to determine the width
2848 of a column/cell.
2849 .TP 5
2850 .B int \fIstep_y
2851 is currently unused
2852 .TP 5
2853 .B int \fImode
2854 is used to determine how the mouse position is translated into
2855 a code (like a function-key):
2856 .RS
2857 .TP
2858 1
2859 index by lines
2860 .TP
2861 2
2862 index by columns
2863 .TP
2864 3
2865 index by cells
2866 .RE
2867 .RE
2868 .\" ---------------------------------------------------------------------------
2869 .TP 5
2870 .B dlg_mouse_mkregion
2871 .RS
2872 .TP 5
2873 .B int \fIy
2874 is the top-row of the region.
2875 .TP 5
2876 .B int \fIx
2877 is the left-column of the region.
2878 .TP 5
2879 .B int \fIheight
2880 is the height of the region.
2881 .TP 5
2882 .B int \fIwidth
2883 is the width of the region.
2884 .TP 5
2885 .B int \fIcode
2886 is a code used to make the region unique within a widget
2887 .RE
2888 .\" ---------------------------------------------------------------------------
2889 .TP 5
2890 .B dlg_mouse_region
2891 Retrieve the frame under the mouse pointer
2892 .RS
2893 .TP 5
2894 .B int \fIy
2895 is the row of the mouse-click
2896 .TP 5
2897 .B int \fIx
2898 is the column of the mouse-click
2899 .RE
2900 .\" ---------------------------------------------------------------------------
2901 .TP 5
2902 .B dlg_mouse_setbase
2903 Sets a base for subsequent calls to \fBdlg_mouse_mkregion\fP,
2904 so they can make regions relative to the start of a given window.
2905 .RS
2906 .TP 5
2907 .B int \fIx
2908 is the left-column for the base
2909 .TP 5
2910 .B int \fIy
2911 is the top-row for the base
2912 .RE
2913 .\" ---------------------------------------------------------------------------
2914 .TP 5
2915 .B dlg_mouse_setcode
2916 Sets a value used internally by \fBdlg_mouse_mkregion\fP
2917 which is added to the \fIcode\fP parameter.
2918 By providing different values,
2919 e.g., multiples of \fBKEY_MAX\fP,
2920 it is possible to support multiple "big" regions in a widget.
2921 The \fIbuildlist\fP widget uses this feature to recognize mouse-clicks
2922 in the left/right panes.
2923 .RS
2924 .TP 5
2925 .B int \fIcode
2926 is the value to add to \fBdlg_mouse_mkregion\fP's \fIcode\fP parameter.
2927 .RE
2928 .\" ---------------------------------------------------------------------------
2929 .TP 5
2930 .B dlg_mouse_wgetch
2931 is a wrapper for \fBdlg_getc\fP which additionally maps mouse-clicks
2932 (if the curses library supports those) into extended function-keys
2933 which encode the position according to the \fImode\fP in
2934 \fBdlg_mouse_mkbigregion\fP.
2935 Returns the corresponding key-code.
2936 .RS
2937 .TP 5
2938 .B WINDOW * \fIwin
2939 is the window on which to perform the input
2940 .TP 5
2941 .B int * \fIfkey
2942 the referenced location is set to true if the key-code is an actual
2943 or extended (mouse) function-key.
2944 .RE
2945 .\" ---------------------------------------------------------------------------
2946 .TP 5
2947 .B dlg_mouse_wgetch_nowait
2948 This is a non-blocking variant of \fBdlg_mouse_wgetch\fP.
2949 .RS
2950 .TP 5
2951 .B WINDOW * \fIwin
2952 is the window on which to perform the input
2953 .TP 5
2954 .B int * \fIfkey
2955 the referenced location is set to true if the key-code is an actual
2956 or extended (mouse) function-key.
2957 .RE
2958 .\" ---------------------------------------------------------------------------
2959 .TP 5
2960 .B dlg_need_separator
2961 Check if an output-separator is needed.
2962 If \fBdialog_vars.output_separator\fP is set, return true.
2963 Otherwise, if \fBdialog_vars.input_result\fP is nonempty, return true.
2964 If neither, return false.
2965 .\" ---------------------------------------------------------------------------
2966 .TP 5
2967 .B dlg_new_modal_window
2968 Create a modal window, optionally with a shadow.
2969 The shadow is created if \fBdialog_state.use_shadow\fP is true.
2970 .RS
2971 .TP 5
2972 .B WINDOW * \fIparent
2973 is the parent window (usually the top-level window of a widget)
2974 .TP 5
2975 .B int \fIheight
2976 is the window's height
2977 .TP 5
2978 .B int \fIwidth
2979 is the window's width
2980 .TP 5
2981 .B int \fIy
2982 is the window's top-row
2983 .TP 5
2984 .B int \fIx
2985 is the window's left-column
2986 .RE
2987 .\" ---------------------------------------------------------------------------
2988 .TP 5
2989 .B dlg_new_window
2990 Create a window, optionally with a shadow.
2991 The shadow is created if \fBdialog_state.use_shadow\fP is true.
2992 .RS
2993 .TP 5
2994 .B int \fIheight
2995 is the window's height
2996 .TP 5
2997 .B int \fIwidth
2998 is the window's width
2999 .TP 5
3000 .B int \fIy
3001 is the window's top-row
3002 .TP 5
3003 .B int \fIx
3004 is the window's left-column
3005 .RE
3006 .\" ---------------------------------------------------------------------------
3007 .TP 5
3008 .B dlg_next_button
3009 Return the next index in the list of labels.
3010 .RS
3011 .TP 5
3012 .B const char ** \fIlabels
3013 is a list of (pointers to) button labels terminated by a null pointer.
3014 .TP 5
3015 .B int \fIbutton
3016 is the current button-index.
3017 .RE
3018 .\" ---------------------------------------------------------------------------
3019 .TP 5
3020 .B dlg_next_ok_buttonindex
3021 Assuming that the caller is using \fBdlg_ok_labels\fP to list buttons,
3022 find the next index in the list of buttons.
3023 .RS
3024 .TP 5
3025 .B int \fIcurrent
3026 is the current index in the list of buttons
3027 .TP 5
3028 .B int \fIextra
3029 if negative, provides a way to enumerate extra active areas on the widget.
3030 .RE
3031 .\" ---------------------------------------------------------------------------
3032 .TP 5
3033 .B dlg_ok_buttoncode
3034 Map the given button index for \fBdlg_ok_labels\fP
3035 into \fB\*p\fP's exit-code.
3036 .RS
3037 .TP 5
3038 .B int \fIbutton
3039 is the button-index (which is not necessarily the same as the index
3040 in the list of labels).
3041 .RE
3042 .\" ---------------------------------------------------------------------------
3043 .TP 5
3044 .B dlg_ok_label
3045 Returns a list with the "Ok" label,
3046 and if \fBdialog_vars.help_button\fP is true, the "Help" label as well.
3047 .\" ---------------------------------------------------------------------------
3048 .TP 5
3049 .B dlg_ok_labels
3050 Return a list of button labels for the OK/Cancel group of widgets.
3051 .\" ---------------------------------------------------------------------------
3052 .TP 5
3053 .B dlg_ordinate
3054 Decode the string as an integer, decrement if greater than zero to make
3055 a curses-ordinate from a dialog-ordinate.
3056 .\" ---------------------------------------------------------------------------
3057 .TP 5
3058 .B dlg_parse_bindkey
3059 Parse the parameters of the "bindkeys" configuration-file entry.  This
3060 expects widget name which may be "*", followed by curses key definition and
3061 then \fB\*p\fP key definition.
3062 .RS
3063 .TP 5
3064 .B char * \fIparams
3065 is the parameter string to parse.
3066 .RE
3067 .\" ---------------------------------------------------------------------------
3068 .TP 5
3069 .B dlg_parse_rc
3070 Parse the configuration file and set up variables.
3071 .\" ---------------------------------------------------------------------------
3072 .TP 5
3073 .B dlg_prev_button
3074 Return the previous index in the list of labels.
3075 .RS
3076 .TP 5
3077 .B const char ** \fIlabels
3078 is a list of (pointers to) button labels terminated by a null pointer.
3079 .TP 5
3080 .B int \fIbutton
3081 is the current button index
3082 .RE
3083 .\" ---------------------------------------------------------------------------
3084 .TP 5
3085 .B dlg_print_listitem
3086 This is a helper function used for the various "list" widgets,
3087 e.g., checklist, menu, buildlist, treeview.
3088 Each list-widget has "tag" and "description" values for each item
3089 which can be displayed.
3090 If \fBdialog_vars.no_tags\fP is true,
3091 the "tag" value is not shown.
3092 The first character of the first value shown (tag or description)
3093 is highlighted to indicate that the widget will match it for quick navigation.
3094 .RS
3095 .TP 5
3096 .B WINDOW *\fIwin
3097 the window in which to display the text
3098 .TP 5
3099 .B const char *\fItext
3100 the value to display
3101 .TP 5
3102 .B int \fIclimit
3103 the number of columns available for printing the text
3104 .TP 5
3105 .B bool \fIfirst
3106 true if this is the first call (for "tag" and "description"),
3107 and the first character of the value should be highlighted.
3108 .TP 5
3109 .B int \fIselected
3110 nonzero if the text should be displayed using the "selected" colors
3111 .RE
3112 .\" ---------------------------------------------------------------------------
3113 .TP 5
3114 .B dlg_print_scrolled
3115 This is a wrapper for \fBdlg_print_autowrap\fP which allows the user
3116 to scroll too-long prompt text up/down.
3117 .IP
3118 See \fBdlg_check_scrolled\fP for a function which updates the \fIoffset\fP
3119 variable used as a parameter here.
3120 It complements this function; you need both.
3121 If \fIpauseopt\fP is set, this function returns an updated \fIlast\fP
3122 parameter, needed for \fBdlg_check_scrolled\fP calls.
3123 .RS
3124 .TP 5
3125 .B WINDOW * \fIwin
3126 is the window to update.
3127 .TP 5
3128 .B const char * \fIprompt
3129 is the string to print
3130 .TP 5
3131 .B int \fIoffset
3132 is the starting line-number to write wrapped text.
3133 .TP 5
3134 .B int \fIheight
3135 is the available height for writing the wrapped text
3136 .TP 5
3137 .B int \fIwidth
3138 is the width that the wrapping should occur in
3139 .TP 5
3140 .B int \fIpauseopt
3141 is true if the extra functionality for scrolling should be enabled.
3142 If false, this calls \fBdlg_print_autowrap\fP without doing any scrolling.
3143 .RE
3144 .\" ---------------------------------------------------------------------------
3145 .TP 5
3146 .B dlg_print_line
3147 Print one line of the prompt in the window within the limits of the
3148 specified right margin.
3149 The line will end on a word boundary and a pointer
3150 to the start of the next line is returned, or a NULL pointer if the end of
3151 *prompt is reached.
3152 .RS
3153 .TP 5
3154 .B WINDOW *\fIwin
3155 is the window to update.
3156 .TP 5
3157 .B chtype *\fIattr
3158 holds the starting attributes, and is updated to reflect the final attributes
3159 applied to the string.
3160 .TP 5
3161 .B const char *\fIprompt
3162 is the string to print
3163 .TP 5
3164 .B int \fIlm
3165 is the left margin.
3166 .TP 5
3167 .B int \fIrm
3168 is the right margin
3169 .TP 5
3170 .B int *\fIx
3171 returns the ending x-ordinate.
3172 .RE
3173 .\" ---------------------------------------------------------------------------
3174 .TP 5
3175 .B dlg_prev_ok_buttonindex
3176 Find the previous button index in the list from \fBdlg_ok_labels\fP.
3177 .RS
3178 .TP 5
3179 .B int \fIcurrent
3180 is the current index
3181 .TP 5
3182 .B int \fIextra
3183 if negative provides a way to enumerate extra active areas on the widget.
3184 .RE
3185 .\" ---------------------------------------------------------------------------
3186 .TP 5
3187 .B dlg_print_autowrap
3188 Print a string of text in a window, automatically wrap around to the next
3189 line if the string is too long to fit on one line.
3190 Note that the string may contain embedded newlines.
3191 The text is written starting at the top of the window.
3192 .RS
3193 .TP 5
3194 .B WINDOW * \fIwin
3195 is the window to update.
3196 .TP 5
3197 .B const char * \fIprompt
3198 is the string to print
3199 .TP 5
3200 .B int \fIheight
3201 is the nominal height the wrapped string is limited to
3202 .TP 5
3203 .B int \fIwidth
3204 is the width that the wrapping should occur in
3205 .RE
3206 .\" ---------------------------------------------------------------------------
3207 .TP 5
3208 .B dlg_print_size
3209 If \fBdialog_vars.print_siz\fP is true,
3210 print the given height/width (from a widget)
3211 to \fBdialog_state.output\fP, e.g.,
3212 \fBSize: height, width\fP.
3213 .RS
3214 .TP 5
3215 .B int \fIheight
3216 is the window's height
3217 .TP 5
3218 .B int \fIwidth
3219 is the window's width
3220 .RE
3221 .\" ---------------------------------------------------------------------------
3222 .TP 5
3223 .B dlg_print_text
3224 Print up to \fIcols\fP columns from \fBtext\fP,
3225 optionally rendering \fB\*p\fP's escape sequences for attributes and color.
3226 .RS
3227 .TP 5
3228 .B WINDOW * \fIwin
3229 is the window to update.
3230 .TP 5
3231 .B const char * \fItxt
3232 is the string to print
3233 .TP 5
3234 .B int \fIcol
3235 is the column limit
3236 .TP 5
3237 .B chtype * \fIattr
3238 holds the starting attributes, and is updated to reflect the final attributes
3239 applied to the string.
3240 .RE
3241 .\" ---------------------------------------------------------------------------
3242 .B dlg_progressbox
3243 implements the "\fB--prgbox\fP" and "\fB--progressbox\fP" options.
3244 .RS
3245 .TP 5
3246 .B const char * \fItitle
3247 is the title on the top of the widget.
3248 .TP 5
3249 .B const char * \fIcprompt
3250 is the prompt text shown within the widget.
3251 If empty or null, no prompt is shown.
3252 .TP 5
3253 .B int \fIheight
3254 is the desired height of the box.
3255 If zero, the height is based on the screen size.
3256 .TP 5
3257 .B int \fIwidth
3258 is the desired width of the box.
3259 If zero, the height is based on the screen size.
3260 .TP 5
3261 .B int \fIpauseopt
3262 if true, an "OK" button will be shown,
3263 and the dialog will wait for it to complete.
3264 With an "OK" button, it is denoted a "programbox",
3265 without an "OK" button, it is denoted a "progressbox".
3266 .TP 5
3267 .B FILE * \fIfp
3268 is the file pointer, which may be a pipe or a regular file.
3269 .RE
3270 .\" ---------------------------------------------------------------------------
3271 .TP 5
3272 .B dlg_put_backtitle
3273 Display the background title if \fBdialog_vars.backtitle\fP is non-null.
3274 The background title is shown at the top of the screen.
3275 .\" ---------------------------------------------------------------------------
3276 .TP 5
3277 .B dlg_register_buttons
3278 The widget developer should call this function after \fBdlg_register_window\fP,
3279 for the list of button labels associated with the widget.
3280 One may bind a key to a button, e.g., "OK" for \fBDLGK_OK\fP,
3281 .RS
3282 .TP 5
3283 .B WINDOW * \fIwin
3284 is the window with which to associate the buttons
3285 .TP 5
3286 .B const char * \fIname
3287 is the widget's binding name (usually the name of the widget).
3288 .TP 5
3289 .B const char ** \fIbuttons
3290 is the list of buttons
3291 .RE
3292 .\" ---------------------------------------------------------------------------
3293 .TP 5
3294 .B dlg_register_window
3295 For a given named widget's window, associate a binding table.
3296 .RS
3297 .TP 5
3298 .B WINDOW * \fIwin
3299 is the window with which to associate the buttons
3300 .TP 5
3301 .B const char * \fIname
3302 is the widget's binding name (usually the name of the widget).
3303 .TP 5
3304 .B DLG_KEYS_BINDING * \fIbinding
3305 is the binding table
3306 .RE
3307 .\" ---------------------------------------------------------------------------
3308 .TP 5
3309 .B dlg_remove_callback
3310 Remove a callback.
3311 .RS
3312 .TP 5
3313 .B DIALOG_CALLBACK * \fIp
3314 contains the callback information.
3315 .RE
3316 .\" ---------------------------------------------------------------------------
3317 .TP 5
3318 .B dlg_renamed_menutext
3319 This is a utility function which supports the \fB--inputmenu\fP option of
3320 the \fB\*p\fP program.
3321 If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
3322 pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
3323 Otherwise, it passes \fBdlg_dummy_menutext\fP.
3324 .IP
3325 The function should add "RENAMED" to \fBdialog_vars.input_result\fP ,
3326 followed by the menu item's name and the \fInewtext\fP value
3327 (with a space separating the three items),
3328 and return \fBDLG_EXIT_EXTRA\fP.
3329 .RS
3330 .TP 5
3331 .B DIALOG_LISTITEM * \fIitems
3332 is the list of menu items
3333 .TP 5
3334 .B int \fIcurrent
3335 is the index of the currently-selected item
3336 .TP 5
3337 .B char * \fInewtext
3338 is the updated text for the menu item
3339 .RE
3340 .\" ---------------------------------------------------------------------------
3341 .TP 5
3342 .B dlg_restore_vars
3343 Restore \fB\*p\fP's variables from the given variable (see \fBdialog_save_vars\fP).
3344 .RS
3345 .TP 5
3346 .B DIALOG_VARS * \fIsave
3347 is the variable from which to restore.
3348 .RE
3349 .IP
3350 The
3351 \fIDIALOG_VARS.input_length\fP and
3352 \fIDIALOG_VARS.input_result\fP members are treated specially,
3353 since these are used by a widget to pass data to the caller.
3354 They are not modified by this function.
3355 .\" ---------------------------------------------------------------------------
3356 .TP 5
3357 .B dlg_result_key
3358 Test a \fB\*p\fP internal keycode to see if it corresponds to one of the push
3359 buttons on the widget such as "OK".
3360 This is only useful if there are user-defined key bindings, since there are
3361 no built-in bindings that map directly to \fBDLGK_OK\fP, etc.
3362 Return true if a mapping was done.
3363 .RS
3364 .TP 5
3365 .B int \fIdialog_key
3366 is the \fB\*p\fP key to test
3367 .TP 5
3368 .B int \fIfkey
3369 is true if this is a function key
3370 .TP 5
3371 .B int * \fIresultp
3372 store the result of the mapping in the referenced location.
3373 .RE
3374 .\" ---------------------------------------------------------------------------
3375 .TP 5
3376 .B dlg_save_vars
3377 Save \fB\*p\fP's variables into the given variable (see \fBdlg_restore_vars\fP).
3378 .RS
3379 .TP 5
3380 .B DIALOG_VARS * \fIsave
3381 is the variable into which to save.
3382 .RE
3383 .\" ---------------------------------------------------------------------------
3384 .TP 5
3385 .B dlg_set_focus
3386 Set focus on the given window,
3387 making it display above other windows on the screen.
3388 .RS
3389 .TP 5
3390 .B WINDOW * \fIparent
3391 is the parent window (usually the top-level window of a widget)
3392 .TP 5
3393 .B WINDOW * \fIwin
3394 is the window on which to place focus (usually a subwindow of a widget)
3395 .RE
3396 .\" ---------------------------------------------------------------------------
3397 .TP 5
3398 .B dlg_set_result
3399 Setup a fixed-buffer for the result in \fBdialog_vars.input_result\fP
3400 .RS
3401 .TP 5
3402 .B const char * \fIstring
3403 is the new contents for the result
3404 .RE
3405 .\" ---------------------------------------------------------------------------
3406 .TP 5
3407 .B dlg_show_string
3408 Displays the string, shifted as necessary, to fit within the box and show
3409 the current character-offset.
3410 .RS
3411 .TP 5
3412 .B WINDOW * \fIwin
3413 is the window within which to display
3414 .TP 5
3415 .B const char * \fIstring
3416 is the string to display
3417 .TP 5
3418 .B int \fIoffset
3419 is the starting (character, not bytes) offset
3420 .TP 5
3421 .B chtype \fIattr
3422 is the window attribute to use for the string
3423 .TP 5
3424 .B int \fIy_base
3425 beginning row on screen
3426 .TP 5
3427 .B int \fIx_base
3428 beginning column on screen
3429 .TP 5
3430 .B int \fIx_last
3431 number of columns on screen
3432 .TP 5
3433 .B bool \fIhidden
3434 if true, do not echo input
3435 .TP 5
3436 .B bool \fIforce
3437 if true, force repaint
3438 .RE
3439 .\" ---------------------------------------------------------------------------
3440 .TP 5
3441 .B dlg_strclone
3442 duplicate the string, like \fBstrdup\fP.
3443 .RS
3444 .TP 5
3445 .B const char * \fIcprompt
3446 is the string to duplicate
3447 .RE
3448 .\" ---------------------------------------------------------------------------
3449 .TP 5
3450 .B dlg_strcmp
3451 compare two strings, ignoring case.
3452 .RS
3453 .TP 5
3454 .B const char * \fIa
3455 is one string
3456 .TP 5
3457 .B const char * \fIb
3458 is the other string
3459 .RE
3460 .\" ---------------------------------------------------------------------------
3461 .TP 5
3462 .B dlg_string_to_argv
3463 Convert a string to an argument vector
3464 returning an index (which must be freed by the caller).
3465 The string is modified (replacing gaps between tokens with nulls).
3466 .RS
3467 .TP 5
3468 .B char *\fIblob
3469 is the string to convert.
3470 .RE
3471 .\" ---------------------------------------------------------------------------
3472 .TP 5
3473 .B dlg_sub_window
3474 create a subwindow, e.g., for an input area of a widget
3475 .RS
3476 .TP 5
3477 .B WINDOW * \fIwin
3478 is the parent window
3479 .TP 5
3480 .B int \fIheight
3481 is the subwindow's height
3482 .TP 5
3483 .B int \fIwidth
3484 is the subwindow's width
3485 .TP 5
3486 .B int \fIy
3487 is the subwindow's top-row
3488 .TP 5
3489 .B int \fIx
3490 is the subwindow's left-column
3491 .RE
3492 .\" ---------------------------------------------------------------------------
3493 .TP 5
3494 .B dlg_tab_correct_str
3495 If the \fBdialog_vars.tab_correct\fP is true, convert tabs to single spaces.
3496 Return the converted result.
3497 The caller is responsible for freeing the string.
3498 .RS
3499 .TP 5
3500 .B char * \fIprompt
3501 is the string to convert
3502 .RE
3503 .\" ---------------------------------------------------------------------------
3504 .TP 5
3505 .B dlg_trace
3506 If the parameter is non-null, opens a trace file with that
3507 name and stores the file pointer in \fBdialog_state.trace\fP.
3508 .\" ---------------------------------------------------------------------------
3509 .TP 5
3510 .B dlg_trace_chr
3511 If \fBdialog_state.trace\fP is set,
3512 translate the parameters into a printable representation,
3513 log it on a "chr" line.
3514 .RS
3515 .TP 5
3516 .B int ch
3517 is the nominal keycode value.
3518 .TP 5
3519 .B int fkey
3520 is nonzero if the value is really a function key.
3521 Some of these may be values declared in the DLG_KEYS_ENUM.
3522 .RE
3523 .\" ---------------------------------------------------------------------------
3524 .TP 5
3525 .B dlg_trace_msg
3526 Write a formatted message to the trace file.
3527 .RS
3528 .TP 5
3529 .B const char * \fIfmt
3530 is the format of the \fBprintf\fP-like message to write.
3531 .TP 5
3532 .B ...
3533 .br
3534 are the variables to apply to the \fIfmt\fP format.
3535 .RE
3536 .IP
3537 Use the DLG_TRACE macro for portability, in case the trace
3538 feature is not compiled into the library.
3539 It uses an extra level of parentheses to work with a variable number of
3540 parameters, e.g.,
3541 .ES
3542 .EX
3543 DLG_TRACE(("this is dialog version %s\\n", dialog_version()));
3544 .EE
3545 .\" ---------------------------------------------------------------------------
3546 .TP 5
3547 .B dlg_trace_win
3548 If \fBdialog_state.trace\fP is set,
3549 log a printable picture of the given window.
3550 .\" ---------------------------------------------------------------------------
3551 .TP 5
3552 .B dlg_treeview
3553 This is an alternate interface to 'treeview' which allows the application
3554 to read the list item states back directly without putting them in the
3555 output buffer.
3556 .RS
3557 .TP 5
3558 .B const char * \fItitle
3559 is the title on the top of the widget.
3560 .TP 5
3561 .B const char * \fIcprompt
3562 is the prompt text shown within the widget.
3563 .TP 5
3564 .B int \fIheight
3565 is the desired height of the box.
3566 If zero, the height is based on the screen size.
3567 .TP 5
3568 .B int \fIwidth
3569 is the desired width of the box.
3570 If zero, the height is based on the screen size.
3571 .TP 5
3572 .B int \fIlist_height
3573 is the minimum height to reserve for displaying the list.
3574 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
3575 .TP 5
3576 .B int \fIitem_no
3577 is the number of rows in \fIitems\fP.
3578 .TP 5
3579 .B DIALOG_LISTITEM * \fIitems
3580 is the list of items, contain tag, name, and optionally help strings
3581 (if \fBdialog_vars.item_help\fP is set).
3582 The initial selection state for each item is also in this list.
3583 .TP 5
3584 .B const char * \fIstates
3585 This is a list of characters to display for the given states.
3586 Normally a buildlist provides true (1) and false (0) values,
3587 which the widget displays as "*" and space, respectively.
3588 An application may set this parameter to an arbitrary null-terminated string.
3589 The widget determines the number of states from the length of this string,
3590 and will cycle through the corresponding display characters as the user
3591 presses the space-bar.
3592 .TP 5
3593 .B int * \fIdepths
3594 This is a list of depths of each item in the tree.
3595 It is a separate parameter from \fIitems\fP to allow reuse of
3596 the existing functions.
3597 .TP 5
3598 .B int \fIflag
3599 is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
3600 or \fIFLAG_RADIO\fP for radiolists (a single selection).
3601 .TP 5
3602 .B int * \fIcurrent_item
3603 The widget sets the referenced location to the index of the current display
3604 item (cursor) when it returns.
3605 .RE
3606 .\" ---------------------------------------------------------------------------
3607 .TP 5
3608 .B dlg_trim_string
3609 The \fBdialog\fP program uses this in each widget to adjust the
3610 message string,
3611 which may contain the newline character (referred to as '\\n')
3612 and/or the special substring "\\n"
3613 (which can be translated into a newline character).
3614 .IP
3615 There are several optional features:
3616 .RS
3617 .bP
3618 Unless \fBdialog_vars.no_nl_expand\fP is set,
3619 .RS
3620 .bP
3621 If it has "\\n" substrings,
3622 the function preserves extra spaces.
3623 For instance, spaces following a newline (substring or character)
3624 are preserved to use as an indentation.
3625 .bP
3626 The function changes embedded "\\n" substrings to '\\n' characters.
3627 .RE
3628 .bP
3629 If \fBdialog_vars.no_nl_expand\fP is not set,
3630 or if there are no "\\n" substrings,
3631 this function strips all extra spaces to simplify justification.
3632 .bP
3633 If \fBdialog_vars.cr_wrap\fP is set,
3634 the function preserves '\\n' newline characters.
3635 Otherwise, each '\\n' newline character is converted to a space.
3636 .bP
3637 Unless \fBdialog_vars.nocollapse\fP is set,
3638 each tab character is converted to a space,
3639 and sequences of blanks (space or tab) are reduced to a single space.
3640 .RE
3641 .RS
3642 .TP 5
3643 .B char * \fIsrc
3644 is the string to trim
3645 .RE
3646 .\" ---------------------------------------------------------------------------
3647 .TP 5
3648 .B dlg_unregister_window
3649 Remove the bindings for a given window.
3650 .RS
3651 .TP 5
3652 .B WINDOW * \fIwin
3653 is the window from which to remove bindings
3654 .RE
3655 .\" ---------------------------------------------------------------------------
3656 .TP 5
3657 .B dlg_update_gauge
3658 Update a gauge widget to show a different percentage value.
3659 .RS
3660 .TP 5
3661 .B void *\fIobjptr
3662 points to the gauge object to update.
3663 .TP 5
3664 .B int \fIpercent
3665 is the new percentage value to display.
3666 .RE
3667 .\" ---------------------------------------------------------------------------
3668 .TP 5
3669 .B dlg_yes_buttoncode
3670 Map the given button index for \fBdlg_yes_labels\fP into \fB\*p\fP's exit-code.
3671 .RS
3672 .TP 5
3673 .B int \fIbutton
3674 is the button index
3675 .RE
3676 .\" ---------------------------------------------------------------------------
3677 .TP 5
3678 .B dlg_yes_labels
3679 Return a list of buttons for Yes/No labels.
3680 .
3681 .\" ************************************************************************
3682 .SH SEE ALSO
3683 \fB\*p\fP (1).
3684 .
3685 .\" ************************************************************************
3686 .SH AUTHOR
3687 Thomas E. Dickey