2 .\" $Id: dialog.3,v 1.101 2014/09/01 16:05:44 tom Exp $
3 .\" Copyright 2005-2013,2014 Thomas E. Dickey
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.
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.
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.
20 .\" definitions for renaming
38 .\" Bulleted paragraph
42 .TH \*D 3 "" "$Date: 2014/09/01 16:05:44 $"
44 dialog \- widgets and utilities for the \*p program
46 .B cc [ flag ... ] file ... -l\*l [ library ... ]
50 .B cc $(\*p-config --cflags) file ... $(\*p-config --libs) ]
55 is a program that will let you 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
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.
67 Here is a \fB\*l\fP version of \fIHello World\/\fP:
73 init_dialog(stdin, stdout);
74 status = dialog_yesno(
75 "Hello, in dialog-format",
84 .\" ************************************************************************
86 Exit codes (passed back to the main program for its use)
87 are defined with a "\fIDLG_EXIT_\fP prefix.
88 The efined constants can be mapped using environment variables
89 as described in \fB\*p\fP(1),
90 e.g., \fIDLG_EXIT_OK\fP corresponds to \fI$DIALOG_OK\fP.
92 Useful character constants which correspond to user input
93 are named with the "\fICHR_\fP" prefix, e.g.,
96 Colors and video attributes are categorized and associated with
97 settings in the configuration file
98 (see the discussion of \fI$DIALOGRC\fP in \fB\*p\/\fP(1)).
99 The \fIDIALOG_ATR(n)\fP macro is used for defining the references
100 to the combined color and attribute table \fBdlg_color_table[]\fP.
102 The \fB\*p\fP application passes its command-line parameters
103 to the widget functions.
104 Some of those parameters are single values,
105 but some of the widgets accept data as an array of values.
106 Those include checklist/radiobox, menubox and formbox.
107 When the \fB--item-help\fP option is given, an extra column
109 The USE_ITEM_HELP(), CHECKBOX_TAGS, MENUBOX_TAGS and FORMBOX_TAGS
110 macros are used to hide this difference from the calling application.
112 Most of the other definitions found in \fI<\*l.h>\fP
113 are used for convenience in building the library or main program.
114 These include definitions based on the generated \fI<dlg_config.h>\fP header.
116 .\" ************************************************************************
118 All of the global data for the \fB\*l\fP library is stored in
119 a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
120 The corresponding \fBdialog_state\fP, \fBdialog_vars\fP and \fBdlg_color_table\fP
121 global variables should be initialized to zeros,
122 and then populated with the data to use.
123 A few of these must be nonzero for the corresponding widgets to function.
124 As as the case with function names,
125 variables beginning with "\fIdialog_\fP"
126 are designed for use by the calling application
127 while variables beginning with "\fIdlg_\fP"
128 are intended for lower levels, e.g., by the \fB\*l\fP library.
129 .\" ---------------------------------------------------------------------------
130 .IP \fIDIALOG_STATE.all_subwindows
131 This is a linked list of all subwindows created by the library.
132 The \fBdlg_del_window\fP function uses this
133 to free storage for subwindows when deleting a window.
134 .\" ---------------------------------------------------------------------------
135 .IP \fIDIALOG_STATE.all_windows
136 This is a linked list of all windows created by the library.
137 The \fBdlg_del_window\fP function uses this to locate windows which
138 may be redrawn after deleting a window.
139 .\" ---------------------------------------------------------------------------
140 .IP \fIDIALOG_STATE.aspect_ratio
141 This corresponds to the command-line option "\fB--aspect-ratio\fP".
142 The value gives the application
143 some control over the box dimensions when using auto
144 sizing (specifying 0 for height and width).
145 It represents width / height.
146 The default is 9, which means 9 characters wide to every 1 line high.
147 .\" ---------------------------------------------------------------------------
148 .IP \fIDIALOG_STATE.finish_string
149 When set to true, this allows calls to \fBdlg_finish_string\fP to discard the
150 corresponding data which is created to speed up layout computations for the
151 given string parameter.
152 The \fBgauge\fP widget uses this feature.
153 .\" ---------------------------------------------------------------------------
154 .IP \fIDIALOG_STATE.getc_callbacks
155 This is setup in \fIui_getc.c\fP to record windows which must be polled
156 for input, e.g., to handle the background tailbox widget.
157 One window is designated as the foreground or control window.
158 .\" ---------------------------------------------------------------------------
159 .IP \fIDIALOG_STATE.getc_redirect
160 If the control window for \fIDIALOG_STATE.getc_callbacks\fP is
161 closed, the list is transferred to this variable.
162 Closing all windows causes the application to exit.
163 .\" ---------------------------------------------------------------------------
164 .IP \fIDIALOG_STATE.no_mouse
165 This corresponds to the command-line option "\fB--no-mouse\fP".
166 If true, \fB\*p\fP will not initialize (and enable) the mouse in
168 .\" ---------------------------------------------------------------------------
169 .IP \fIDIALOG_STATE.output
170 This is set in the \fB\*p\fP application to the stream on
171 which the application and library functions may write text results.
172 Normally that is the standard error,
173 since the curses library prefers to write its data to the standard output.
174 Some scripts, trading portability for convenience,
175 prefer to write results to the standard output,
176 e.g., by using the "\fB--stdout\fP" option.
177 .\" ---------------------------------------------------------------------------
178 .IP \fIDIALOG_STATE.output_count
179 This is incremented by \fBdlg_does_output\fP,
180 which is called by each widget that writes text to the output.
181 The \fB\*p\fP application uses that to decide if it should
182 also write a separator, i.e.,
183 \fIDIALOG_STATE.separate_str\fP,
184 between calls to each widget.
185 .\" ---------------------------------------------------------------------------
186 .IP \fIDIALOG_STATE.pipe_input
187 This is set in \fIinit_dialog\fP to a stream which can be used by the
188 \fBgauge\fP widget, which must be the application's standard input.
189 The \fB\*p\fP application calls \fIinit_dialog\fP normally with
190 \fIinput\fP set to the standard input, but optionally based on the
191 "\fB--input-fd\fP" option.
192 Since the application cannot read from
193 a pipe (standard input) and at the same time read
194 the curses input from the standard input,
195 it must allow for reopening the latter from either
196 a specific file descriptor,
197 or directly from the terminal.
198 The adjusted pipe stream value is stored in this variable.
199 .\" ---------------------------------------------------------------------------
200 .IP \fIDIALOG_STATE.screen_initialized
201 This is set in \fIinit_dialog\fP and
202 reset in \fIend_dialog\fP.
203 It is used to check if curses has been initialized,
204 and if the \fIendwin\fP function must be called on exit.
205 .\" ---------------------------------------------------------------------------
206 .IP \fIDIALOG_STATE.screen_output
207 This is set in \fIinit_dialog\fP to the output stream used
208 by the curses library.
209 Normally that is the standard output,
210 unless that happens to not be a terminal (and if \fIinit_dialog\fP can
211 successfully open the terminal directly).
212 .\" ---------------------------------------------------------------------------
213 .IP \fIDIALOG_STATE.separate_str
214 This corresponds to the command-line option "\fB--separate-widget\fP".
216 specifies a string that will separate the output on \fB\*p\fP's output from
218 This is used to simplify parsing the result of a dialog with several widgets.
219 If this option is not given,
220 the default separator string is a tab character.
221 .\" ---------------------------------------------------------------------------
222 .IP \fIDIALOG_STATE.tab_len
223 This corresponds to the command-line option "\fB--tab-len\fP \fInumber\/\fP".
224 Specify the number of spaces that a tab character occupies if the
225 "\fB--tab-correct\fP"
228 .\" ---------------------------------------------------------------------------
229 .IP \fIDIALOG_STATE.trace_output
230 This corresponds to the command-line option "\fB--trace\fP \fIfile\/\fP".
231 It is the file pointer to which trace messages are written.
232 .\" ---------------------------------------------------------------------------
233 .IP \fIDIALOG_STATE.use_colors
234 This is set in \fIinit_dialog\fP if the curses implementation supports color.
235 .\" ---------------------------------------------------------------------------
236 .IP \fIDIALOG_STATE.use_scrollbar
237 This corresponds to the command-line option "\fB--scrollbar\fP".
239 draw a scrollbar to make windows holding scrolled data more readable.
240 .\" ---------------------------------------------------------------------------
241 .IP \fIDIALOG_STATE.use_shadow
242 This corresponds to the command-line option "\fB--no-shadow\fP".
243 This is set in \fIinit_dialog\fP if the curses implementation supports color.
245 suppress shadows that would be drawn to the right and bottom of each dialog box.
246 .\" ---------------------------------------------------------------------------
247 .IP \fIDIALOG_STATE.visit_items
248 This corresponds to the command-line option "\fB--visit-items\fP".
249 .\" ---------------------------------------------------------------------------
251 The \fB\*p\fP application resets the \fBdialog_vars\fP data before
252 accepting options to invoke each widget.
253 Most of the \fIDIALOG_VARS\fP members are set directly from \fB\*p\fP's
254 command-line options:
255 .\" ---------------------------------------------------------------------------
256 .IP \fIDIALOG_VARS.ascii_lines
257 This corresponds to the command-line option "\fB--ascii-lines\fP.
258 It causes line-drawing to be done with ASCII characters, e.g., "+" and "-".
259 See \fIDIALOG_VARS.no_lines\fP.
260 .\" ---------------------------------------------------------------------------
261 .IP \fIDIALOG_VARS.backtitle
262 This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\/\fP".
265 string to be displayed on the backdrop, at the top of the screen.
266 .\" ---------------------------------------------------------------------------
267 .IP \fIDIALOG_VARS.beep_after_signal
268 This corresponds to the command-line option "\fB--beep-after\fP".
269 If true, beep after a user has completed a widget by pressing one of the buttons.
270 .\" ---------------------------------------------------------------------------
271 .IP \fIDIALOG_VARS.beep_signal
272 This corresponds to the command-line option "\fB--beep\fP".
274 .\" ---------------------------------------------------------------------------
275 .IP \fIDIALOG_VARS.begin_set
276 This is true if the command-line option "\fB--begin\fP \fIy x\/\fP" was used.
277 It specifies the position of the upper left corner of a dialog box on the screen.
278 .\" ---------------------------------------------------------------------------
279 .IP \fIDIALOG_VARS.begin_x
280 This corresponds to the \fIx\fP value from
281 the command-line option "\fB--begin\fP \fIy x\/\fP" (second value).
282 .\" ---------------------------------------------------------------------------
283 .IP \fIDIALOG_VARS.begin_y
284 This corresponds to the \fIy\fP value from
285 the command-line option "\fB--begin\fP \fIy x\/\fP" (first value).
286 .\" ---------------------------------------------------------------------------
287 .IP \fIDIALOG_VARS.cancel_label
288 This corresponds to the command-line option "\fB--cancel-label\fP \fIstring\/\fP".
289 The given \fIstring\fP overrides the label used for "Cancel" buttons.
290 .\" ---------------------------------------------------------------------------
291 .IP \fIDIALOG_VARS.cant_kill
292 This corresponds to the command-line option "\fB--no-kill\fP".
297 box in the background,
298 printing its process id to \fB\*p\fP's output.
299 SIGHUP is disabled for the background process.
300 .\" ---------------------------------------------------------------------------
301 .IP \fIDIALOG_VARS.colors
302 This corresponds to the command-line option "\fB--colors\fP".
303 If true, interpret embedded "\eZ" sequences in the dialog text
304 by the following character,
305 which tells \fB\*p\fP to set colors or video attributes:
306 0 through 7 are the ANSI codes used in curses:
315 Bold is set by 'b', reset by 'B'.
316 Reverse is set by 'r', reset by 'R'.
317 Underline is set by 'u', reset by 'U'.
318 The settings are cumulative, e.g., "\eZb\eZ1" makes the following text
320 Restore normal settings with "\eZn".
321 .\" ---------------------------------------------------------------------------
322 .IP \fIDIALOG_VARS.column_separator
323 This corresponds to the command-line option "\fB--column-separator\fP".
324 \fB\*L\fP splits data for radio/checkboxes and menus on the
325 occurrences of the given string, and aligns the split data into columns.
326 .\" ---------------------------------------------------------------------------
327 .IP \fIDIALOG_VARS.cr_wrap
328 This corresponds to the command-line option "\fB--cr-wrap\fP".
330 interpret embedded newlines in the dialog text as a newline on the screen.
331 Otherwise, \fB\*p\fR will only wrap lines where needed to fit inside the text box.
332 Even though you can control line breaks with this,
333 \fB\*p\fR will still wrap any lines that are too long for the width of the box.
334 Without cr-wrap, the layout of your text may be formatted to look nice
335 in the source code of your script without affecting the way it will
337 .\" ---------------------------------------------------------------------------
338 .IP \fIDIALOG_VARS.date_format
339 This corresponds to the command-line option "\fB--date-format\fP \fIstring\/\fP".
340 If the host provides \fBstrftime\fP, and the value is nonnull,
341 the calendar widget uses this to format its output.
342 .\" ---------------------------------------------------------------------------
343 .IP \fIDIALOG_VARS.default_button
344 This is set by the command-line option "\fB--default-button\fP.
345 It is used by \fBdlg_default_button\fP.
346 .\" ---------------------------------------------------------------------------
347 .IP \fIDIALOG_VARS.default_item
348 This corresponds to the command-line option "\fB--default-item\fP \fIstring\/\fP".
349 The given string is used as
350 the default item in a checklist, form or menu box.
351 Normally the first item in the box is the default.
352 .\" ---------------------------------------------------------------------------
353 .IP \fIDIALOG_VARS.defaultno
354 This corresponds to the command-line option "\fB--defaultno\fP".
356 make the default value of the
360 Likewise, make the default button of widgets that provide "OK" and "Cancel"
362 If \fB--nocancel\fP was given that option overrides this,
363 making the default button always "Yes" (internally the same as "OK").
364 .\" ---------------------------------------------------------------------------
365 .IP \fIDIALOG_VARS.dlg_clear_screen
366 This corresponds to the command-line option "\fB--clear\fP".
367 This option is implemented in the main program, not the library.
369 the screen will be cleared on exit.
370 This may be used alone, without other options.
371 .\" ---------------------------------------------------------------------------
372 .IP \fIDIALOG_VARS.exit_label
373 This corresponds to the command-line option "\fB--exit-label string\fP".
374 The given string overrides the label used for "EXIT" buttons.
375 .\" ---------------------------------------------------------------------------
376 .IP \fIDIALOG_VARS.extra_button
377 This corresponds to the command-line option "\fB--extra-button\fP".
378 If true, some widgets show an extra button,
379 between "OK" and "Cancel" buttons.
380 .\" ---------------------------------------------------------------------------
381 .IP \fIDIALOG_VARS.extra_label
382 This corresponds to the command-line option "\fB--extra-label\fP \fIstring\/\fP".
383 The given string overrides the label used for "Extra" buttons.
384 Note: for inputmenu widgets, this defaults to "Rename".
385 .\" ---------------------------------------------------------------------------
386 .IP \fIDIALOG_VARS.formitem_type
387 This is set by the command-line option "\fB--passwordform\fP"
388 to tell the form widget that its text fields should be treated like
390 .\" ---------------------------------------------------------------------------
391 .IP \fIDIALOG_VARS.help_button
392 This corresponds to the command-line option "\fB--help-button\fP".
393 If true, some widgets show a help-button after "OK" and "Cancel" buttons,
394 i.e., in checklist, radiolist and menu boxes.
395 If \fB--item-help\fR is also given, on exit
396 the return status will be the same as for the "OK" button,
397 and the item-help text will be written to \fB\*p\fP's output after the token "HELP".
398 Otherwise, the return status will indicate that the Help button was pressed,
399 and no message printed.
400 .\" ---------------------------------------------------------------------------
401 .IP \fIDIALOG_VARS.help_file
402 This corresponds to the command-line option "\fB--hfile\fP \fIstring\/\fP".
403 The given filename is passed to \fBdialog_helpfile\fP when the user
405 .\" ---------------------------------------------------------------------------
406 .IP \fIDIALOG_VARS.help_label
407 This corresponds to the command-line option "\fB--help-label\fP \fIstring\/\fP".
408 The given string overrides the label used for "Help" buttons.
409 .\" ---------------------------------------------------------------------------
410 .IP \fIDIALOG_VARS.help_line
411 This corresponds to the command-line option "\fB--hline\fP \fIstring\/\fP".
412 The given string is displayed in the bottom of dialog windows,
414 .\" ---------------------------------------------------------------------------
415 .IP \fIDIALOG_VARS.help_status
416 This corresponds to the command-line option "\fB--help-status\fP".
417 If true, and the the help-button is selected,
418 writes the checklist or radiolist information
419 after the item-help "HELP" information.
420 This can be used to reconstruct the state of a checklist after processing
422 .\" ---------------------------------------------------------------------------
423 .IP \fIDIALOG_VARS.help_tags
424 This corresponds to the command-line option "\fB--help-tags\fP".
426 \fBdlg_add_help_formitem\fP and
427 \fBdlg_add_help_listitem\fP use the item's tag value consistently
428 rather than using the tag's help-text value
429 when \fIDIALOG_VARS.item_help\fP is set.
430 .\" ---------------------------------------------------------------------------
431 .IP \fIDIALOG_VARS.input_length
432 This is nonzero if \fIDIALOG_VARS.input_result\fP is allocated,
433 versus being a pointer to the user's local variables.
434 .\" ---------------------------------------------------------------------------
435 .IP \fIDIALOG_VARS.input_menu
436 This flag is set to denote whether the menubox widget
437 implements a menu versus a inputmenu widget.
438 .\" ---------------------------------------------------------------------------
439 .IP \fIDIALOG_VARS.input_result
440 This may be either a user-supplied buffer,
441 or a buffer dynamically allocated by the library,
442 depending on \fIDIALOG_VARS.input_length\/\fP:
445 If \fIDIALOG_VARS.input_length\fP is zero,
446 this is a pointer to user buffer (on the stack, or static).
447 The buffer size is assumed to be \fBMAX_LEN\fP,
448 which is defined in \fI<\*l.h>\fP.
450 When \fIDIALOG_VARS.input_length\fP is nonzero,
451 this is a dynamically-allocated buffer used by the widgets to return
452 printable results to the calling application.
455 Certain widgets copy a result to this buffer.
456 If the pointer is NULL, or if the length is insufficient for
457 the result, then the \fB\*l\fP library allocates a buffer which is large enough,
458 and sets \fIDIALOG_VARS.input_length\fP.
459 Callers should check for this case if they have supplied their own buffer.
460 .\" ---------------------------------------------------------------------------
461 .IP \fIDIALOG_VARS.insecure
462 This corresponds to the command-line option "\fB--insecure\fP".
463 If true, make the password widget friendlier but less secure,
464 by echoing asterisks for each character.
465 .\" ---------------------------------------------------------------------------
466 .IP \fIDIALOG_VARS.in_helpfile
467 This variable is used to prevent \fBdialog_helpfile\fP from showing
468 anything, e.g., if F1 were pressed within a help-file display.
469 .\" ---------------------------------------------------------------------------
470 .IP \fIDIALOG_VARS.item_help
471 This corresponds to the command-line option "\fB--item-help\fP".
473 interpret the tags data for checklist, radiolist and menu boxes
474 adding a column whose text is displayed in the bottom line of the
475 screen, for the currently selected item.
476 .\" ---------------------------------------------------------------------------
477 .IP \fIDIALOG_VARS.keep_tite
478 This is set by the command-line option "\fB--keep-tite\fP"
479 to tell \fB\*p\fP to not attempt to cancel the terminal initialization
480 (termcap \fIti\/\fP/\,\fIte\/\fP) sequences which correspond to xterm's alternate-screen
482 Normally \fB\*p\fP does this to avoid flickering when run several times
484 .\" ---------------------------------------------------------------------------
485 .IP \fIDIALOG_VARS.keep_window
486 This corresponds to the command-line option "\fB--keep-window\fP".
487 If true, do not remove/repaint the window on exit.
488 This is useful for keeping the window contents visible when several
489 widgets are run in the same process.
490 Note that curses will clear the screen when starting a new process.
491 .\" ---------------------------------------------------------------------------
492 .IP \fIDIALOG_VARS.last_key
493 This corresponds to the command-line option "\fB--last-key\fP".
494 .\" ---------------------------------------------------------------------------
495 .IP \fIDIALOG_VARS.max_input
496 This corresponds to the command-line option "\fB--max-input\fP \fIsize\/\fP".
497 Limit input strings to the given size.
498 If not specified, the limit is 2048.
499 .\" ---------------------------------------------------------------------------
500 .IP \fIDIALOG_VARS.no_items
501 This corresponds to the command-line option "\fB--no-items\fP".
502 Some widgets (checklist, inputmenu, radiolist, menu) display a list
503 with two columns (a "tag" and "item", i.e., "description").
504 This tells \fB\*p\fP to read shorter rows from data,
506 .\" ---------------------------------------------------------------------------
507 .IP \fIDIALOG_VARS.no_label
508 This corresponds to the command-line option "\fB--no-label\fP \fIstring\/\fP".
509 The given string overrides the label used for "No" buttons.
510 .\" ---------------------------------------------------------------------------
511 .IP \fIDIALOG_VARS.no_lines
512 This corresponds to the command-line option "\fB--no-lines\fP.
513 It suppresses line-drawing.
514 See \fIDIALOG_VARS.ascii_lines\fP.
515 .\" ---------------------------------------------------------------------------
516 .IP \fIDIALOG_VARS.no_nl_expand
517 This corresponds to the command-line option "\fB--no-nl-expand\fP".
518 If false, \fBdlg_trim_string\fP converts literal "\en" substrings
519 in a message into newlines.
520 .\" ---------------------------------------------------------------------------
521 .IP \fIDIALOG_VARS.no_tags
522 This corresponds to the command-line option "\fB--no-tags\fP".
523 Some widgets (checklist, inputmenu, radiolist, menu) display a list
524 with two columns (a "tag" and "item", also known as "description").
525 The tag is useful for scripting, but may not help the user.
526 The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
527 column of tags from the display.
529 Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
530 by matching a single character to the first character of the tag.
531 When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
532 the first character of the description.
533 In either case, the matchable character is highlighted.
535 Here is a table showing how the no_tags and no_items values interact:
540 Widget/Fields Shown/Fields Read/.no_items/.no_tags
542 buildlist/item/tag,item/0/0*
543 buildlist/item/tag,item/0/1
544 buildlist/tag/tag/1/0*
545 buildlist/tag/tag/1/1
546 checklist/tag,item/tag,item/0/0
547 checklist/item/tag,item/0/1
548 checklist/tag/tag/1/0
549 checklist/tag/tag/1/1
550 inputmenu/tag,item/tag,item/0/0
551 inputmenu/item/tag,item/0/1
552 inputmenu/tag/tag/1/0
553 inputmenu/tag/tag/1/1
554 menu/tag,item/tag,item/0/0
555 menu/item/tag,item/0/1
558 radiolist/tag,item/tag,item/0/0
559 radiolist/item/tag,item/0/1
560 radiolist/tag/tag/1/0
561 radiolist/tag/tag/1/1
562 treeview/item/tag,item/0/0*
563 treeview/item/tag,item/0/1
564 treeview/tag/tag/1/0*
571 Xdialog does not display the tag column for the analogous buildlist
572 and treeview widgets.
573 \fB\*L\fP does the same on the command-line.
574 However the library interface defaults to displaying the tag column.
575 Your application can enable or disable the tag column as needed for each widget.
577 .\" ---------------------------------------------------------------------------
578 .IP \fIDIALOG_VARS.nocancel
579 This corresponds to the command-line option "\fB--no-cancel\fP".
581 suppress the "Cancel" button in checklist, inputbox and menu box modes.
582 A script can still test if the user pressed the ESC key to cancel to quit.
583 .\" ---------------------------------------------------------------------------
584 .IP \fIDIALOG_VARS.nocollapse
585 This corresponds to the command-line option "\fB--no-collapse\fP".
586 Normally \fB\*p\fR converts tabs to spaces and reduces multiple
587 spaces to a single space for text which is displayed in a message boxes, etc.
588 It true, that feature is disabled.
589 Note that \fB\*p\fR will still wrap text, subject to the \fB--cr-wrap\fR
591 .\" ---------------------------------------------------------------------------
592 .IP \fIDIALOG_VARS.nook
593 This corresponds to the command-line option "\fB--nook\fP.
594 \fB\*L\fP will suppress the "ok" (or "yes") button from the widget.
595 .\" ---------------------------------------------------------------------------
596 .IP \fIDIALOG_VARS.ok_label
597 This corresponds to the command-line option "\fB--ok-label\fP \fIstring\/\fP".
598 The given string overrides the label used for "OK" buttons.
599 .\" ---------------------------------------------------------------------------
600 .IP \fIDIALOG_VARS.print_siz
601 This corresponds to the command-line option "\fB--print-size\fP".
603 each widget prints its size to \fB\*p\fP's output when it is invoked.
604 .\" ---------------------------------------------------------------------------
605 .IP \fIDIALOG_VARS.quoted
606 This corresponds to the command-line option "\fB--quoted\fP.
607 .\" ---------------------------------------------------------------------------
608 .IP \fIDIALOG_VARS.separate_output
609 This corresponds to the command-line option "\fB--separate-output\fP".
611 checklist widgets output result one line at a time, with no quoting.
612 This facilitates parsing by another program.
613 .\" ---------------------------------------------------------------------------
614 .IP \fIDIALOG_VARS.single_quoted
615 This corresponds to the command-line option "\fB--single-quoted\fP".
617 use single-quoting as needed (and no quotes if unneeded) for the
618 output of checklist's as well as the item-help text.
619 If this option is not set, \fB\*p\fP uses double quotes around each item.
620 The latter requires occasional use of backslashes to make the output useful in
622 .\" ---------------------------------------------------------------------------
623 .IP \fIDIALOG_VARS.size_err
624 This corresponds to the command-line option "\fB--size-err\fP".
626 check the resulting size of a dialog box before trying to use it,
627 printing the resulting size if it is larger than the screen.
628 (This option is obsolete, since all new-window calls are checked).
629 .\" ---------------------------------------------------------------------------
630 .IP \fIDIALOG_VARS.sleep_secs
631 This corresponds to the command-line option "\fB--sleep\fP \fIsecs\/\fP".
632 This option is implemented in the main program, not the library.
633 If nonzero, this is the number of seconds after to delay after processing a dialog box.
634 .\" ---------------------------------------------------------------------------
635 .IP \fIDIALOG_VARS.tab_correct
636 This corresponds to the command-line option "\fB--tab-correct\fP".
637 If true, convert each tab character of the text to one or more spaces.
638 Otherwise, tabs are rendered according to the curses library's interpretation.
639 .\" ---------------------------------------------------------------------------
640 .IP \fIDIALOG_VARS.time_format
641 This corresponds to the command-line option "\fB--time-format\fP \fIstring\/\fP".
642 If the host provides \fBstrftime\fP, and the value is nonnull,
643 the timebox widget uses this to format its output.
644 .\" ---------------------------------------------------------------------------
645 .IP \fIDIALOG_VARS.timeout_secs
646 This corresponds to the command-line option "\fB--timeout\fP \fIsecs\/\fP".
647 If nonzero, timeout input requests (exit with error code)
648 if no user response within the given number of seconds.
649 .\" ---------------------------------------------------------------------------
650 .IP \fIDIALOG_VARS.title
651 This corresponds to the command-line option "\fB--title\fP \fItitle\/\fP".
654 string to be displayed at the top of the dialog box.
655 .\" ---------------------------------------------------------------------------
656 .IP \fIDIALOG_VARS.trim_whitespace
657 This corresponds to the command-line option "\fB--trim\fP".
658 If true, eliminate leading blanks,
659 trim literal newlines and repeated blanks from message text.
660 .\" ---------------------------------------------------------------------------
661 .IP \fIDIALOG_VARS.visit_items
662 This corresponds to the command-line option "\fB--visit-items\fP".
663 Modify the tab-traversal of the list-oriented widgets
664 (buildlist, checklist, radiobox, menubox, inputmenu, and treeview)
665 to include the list of items as one of the states.
666 This is useful as a visual aid,
667 i.e., the cursor position helps some users.
668 .\" ---------------------------------------------------------------------------
669 .IP \fIDIALOG_VARS.yes_label
670 This corresponds to the command-line option "\fB--yes-label\fP \fIstring\/\fP".
671 The given string overrides the label used for "Yes" buttons.
673 .\" ************************************************************************
674 .\" ************************************************************************
676 Functions that implement major functionality for the command-line \fB\*p\fP
677 program, e.g., widgets, have names beginning "\fIdialog_\fP".
679 All dialog boxes have at least three parameters:
682 the caption for the box, shown on its top border.
685 the height of the dialog box.
688 the width of the dialog box.
690 Other parameters depend on the box type.
692 .\" ************************************************************************
693 .IP \fBdialog_buildlist
694 implements the "\fB--buildlist\fP" option.
697 .B const char * \fItitle
698 is the title on the top of the widget.
700 .B const char * \fIcprompt
701 is the prompt text shown within the widget.
704 is the desired height of the box.
705 If zero, the height is adjusted to use the available screen size.
708 is the desired width of the box.
709 If zero, the height is adjusted to use the available screen size.
711 .B int \fIlist_height
712 is the minimum height to reserve for displaying the list.
713 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
716 is the number of rows in \fIitems\fP.
719 is an array of strings which is viewed either as a list of rows
721 \fItag item status\fR
726 \fItag item status help\fR
729 depending on whether \fBdialog_vars.item_help\fP is set.
732 is reserved for future enhancements
735 .\" ************************************************************************
736 .IP \fBdialog_calendar
737 implements the "\fB--calendar\fP" option.
740 .B const char * \fItitle
741 is the title on the top of the widget.
743 .B const char * \fIsubtitle
744 is the prompt text shown within the widget.
747 is the height excluding the fixed-height calendar grid.
750 is the overall width of the box,
751 which is adjusted up to the calendar grid's minimum width if needed.
754 is the initial day of the week shown,
755 counting zero as Sunday.
756 If the value is negative, the current day of the week is used.
759 is the initial month of the year shown,
760 counting one as January.
761 If the value is negative, the current month of the year is used.
764 is the initial year shown.
765 If the value is negative, the current year is used.
767 .\" ************************************************************************
768 .IP \fBdialog_checklist
769 implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
770 depending on the \fIflag\fP parameter.
773 .B const char * \fItitle
774 is the title on the top of the widget.
776 .B const char * \fIcprompt
777 is the prompt text shown within the widget.
780 is the desired height of the box.
781 If zero, the height is adjusted to use the available screen size.
784 is the desired width of the box.
785 If zero, the height is adjusted to use the available screen size.
787 .B int \fIlist_height
788 is the minimum height to reserve for displaying the list.
789 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
792 is the number of rows in \fIitems\fP.
795 is an array of strings which is viewed either as a list of rows
797 \fItag item status\fR
802 \fItag item status help\fR
805 depending on whether \fBdialog_vars.item_help\fP is set.
807 is either \fIFLAG_CHECK\fP, for checklists,
808 or \fIFLAG_RADIO\fP for radiolists.
810 .\" ************************************************************************
811 .IP \fBdialog_dselect
812 implements the "\fB--dselect\fP" option.
815 .B const char * \fItitle
816 is the title on the top of the widget.
818 .B const char * \fIpath
819 is the preselected value to show in the input-box,
820 which is used also to set the directory- and file-windows.
823 is the height excluding the minimum needed to show the dialog box framework.
824 If zero, the height is based on the screen size.
827 is the desired width of the box.
828 If zero, the height is based on the screen size.
830 .\" ************************************************************************
831 .IP \fBdialog_editbox
832 implements the "\fB--editbox\fP" option.
835 .B const char * \fItitle
836 is the title on the top of the widget.
838 .B const char * \fIfile
839 is the name of the file from which to read.
842 is the desired height of the box.
843 If zero, the height is adjusted to use the available screen size.
846 is the desired width of the box.
847 If zero, the height is adjusted to use the available screen size.
849 .\" ************************************************************************
851 implements the "\fB--form\fP" option.
854 .B const char * \fItitle
855 is the title on the top of the widget.
857 .B const char * \fIcprompt
858 is the prompt text shown within the widget.
861 is the desired height of the box.
862 If zero, the height is adjusted to use the available screen size.
865 is the desired width of the box.
866 If zero, the height is adjusted to use the available screen size.
868 .B int \fIform_height
869 is the minimum height to reserve for displaying the list.
870 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
873 is the number of rows in \fIitems\fP.
876 is an array of strings which is viewed either as a list of rows
878 \fIName NameY NameX Text TextY TextX FLen ILen\fR
883 \fIName NameY NameX Text TextY TextX FLen ILen Help\fR
886 depending on whether \fBdialog_vars.item_help\fP is set.
888 .\" ************************************************************************
889 .IP \fBdialog_fselect
890 implements the "\fB--fselect\fP" option.
893 .B const char * \fItitle
894 is the title on the top of the widget.
896 .B const char * \fIpath
897 is the preselected value to show in the input-box,
898 which is used also to set the directory- and file-windows.
901 is the height excluding the minimum needed to show the dialog box framework.
902 If zero, the height is based on the screen size.
905 is the desired width of the box.
906 If zero, the height is based on the screen size.
908 .\" ************************************************************************
910 implements the "\fB--gauge\fP" option.
911 Alternatively, a simpler or customized gauge widget can be
913 \fBdlg_allocate_gauge\fP,
914 \fBdlg_reallocate_gauge\fP,
915 \fBdlg_update_gauge\fP and
916 \fBdlg_free_gauge\fP.
919 .B const char * \fItitle
920 is the title on the top of the widget.
922 .B const char * \fIcprompt
923 is the prompt text shown within the widget.
926 is the desired height of the box.
927 If zero, the height is based on the screen size.
930 is the desired width of the box.
931 If zero, the height is based on the screen size.
934 is the percentage to show in the progress bar.
936 .\" ************************************************************************
937 .IP \fBdialog_inputbox
938 implements the "\fB--inputbox\fP" or
939 "\fB--password\fP" option, depending on the value of \fIpassword\fP.
942 .B const char * \fItitle
943 is the title on the top of the widget.
945 .B const char * \fIcprompt
946 is the prompt text shown within the widget.
949 is the desired height of the box.
950 If zero, the height is based on the screen size.
953 is the desired width of the box.
954 If zero, the height is based on the screen size.
956 .B const char * \fIinit
957 is the initial value of the input box, whose length is taken into account
958 when auto-sizing the width of the dialog box.
961 if true, causes typed input to be echoed as asterisks.
963 .\" ************************************************************************
964 .IP \fBdialog_helpfile
965 implements the "\fB--hfile\fP" option.
968 .B const char * \fItitle
969 is the title on the top of the widget.
971 .B const char * \fIfile
972 is the name of a file containing the text to display.
973 This function is internally bound to F1 (function key "1"),
974 passing \fBdialog_vars.help_file\fP as a parameter.
975 The \fBdialog\fP program sets that variable when the \fB--hfile\fP option
979 is the desired height of the box.
980 If zero, the height is based on the screen size.
983 is the desired width of the box.
984 If zero, the height is based on the screen size.
986 .\" ************************************************************************
988 implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
989 depending on whether \fBdialog_vars.input_menu\fP is set.
992 .B const char * \fItitle
993 is the title on the top of the widget.
995 .B const char * \fIcprompt
996 is the prompt text shown within the widget.
999 is the desired height of the box.
1000 If zero, the height is based on the screen size.
1003 is the desired width of the box.
1004 If zero, the height is based on the screen size.
1006 .B int \fImenu_height
1007 is the minimum height to reserve for displaying the list.
1008 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1011 is the number of rows in \fIitems\fP.
1014 is an array of strings which is viewed either as a list of rows
1024 depending on whether \fBdialog_vars.item_help\fP is set.
1026 .\" ************************************************************************
1027 .IP \fBdialog_mixedform
1028 implements the "\fB--mixedform\fP" option.
1031 .B const char * \fItitle
1032 is the title on the top of the widget.
1034 .B const char * \fIcprompt
1035 is the prompt text shown within the widget.
1038 is the desired height of the box.
1039 If zero, the height is adjusted to use the available screen size.
1042 is the desired width of the box.
1043 If zero, the height is adjusted to use the available screen size.
1045 .B int \fIform_height
1046 is the minimum height to reserve for displaying the list.
1047 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1050 is the number of rows in \fIitems\fP.
1053 is an array of strings which is viewed either as a list of rows
1055 \fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
1060 \fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
1063 depending on whether \fBdialog_vars.item_help\fP is set.
1065 .\" ************************************************************************
1066 .IP \fBdialog_mixedgauge
1067 implements the "\fB--mixedgauge\fP" option
1070 .B const char * \fItitle
1071 is the title on the top of the widget.
1073 .B const char * \fIcprompt
1074 is the caption text shown within the widget.
1077 is the desired height of the box.
1078 If zero, the height is based on the screen size.
1081 is the desired width of the box.
1082 If zero, the height is based on the screen size.
1085 is the percentage to show in the progress bar.
1088 is the number of rows in \fIitems\fP.
1091 is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
1092 The \fItag\fP values are listed, one per row, in the list at the top of
1095 The \fIitem\fP values are decoded: digits 0 through 9 are the following strings
1119 A string with a leading "-" character is centered, marked with "%".
1120 For example, "-75" is displayed as "75%".
1121 Other strings are displayed as is.
1123 .\" ************************************************************************
1124 .IP \fBdialog_msgbox
1125 implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
1126 depending on whether \fIpauseopt\fP is set.
1129 .B const char * \fItitle
1130 is the title on the top of the widget.
1132 .B const char * \fIcprompt
1133 is the prompt text shown within the widget.
1136 is the desired height of the box.
1137 If zero, the height is based on the screen size.
1140 is the desired width of the box.
1141 If zero, the height is based on the screen size.
1144 if true, an "OK" button will be shown,
1145 and the dialog will wait for it to complete.
1146 With an "OK" button, it is denoted a "msgbox",
1147 without an "OK" button, it is denoted an "infobox".
1149 .\" ************************************************************************
1151 implements the "\fB--pause\fP" option.
1154 .B const char * \fItitle
1155 is the title on the top of the widget.
1158 is the desired height of the box.
1159 If zero, the height is based on the screen size.
1162 is the desired width of the box.
1163 If zero, the height is based on the screen size.
1166 is the timeout to use for the progress bar.
1168 .\" ************************************************************************
1169 .IP \fBdialog_prgbox
1170 implements the "\fB--prgbox\fP" option.
1173 .B const char * \fItitle
1174 is the title on the top of the widget.
1176 .B const char * \fIcprompt
1177 is the prompt text shown within the widget.
1178 If empty or null, no prompt is shown.
1180 .B const char * \fIcommand
1181 is the name of the command to execute.
1184 is the desired height of the box.
1185 If zero, the height is based on the screen size.
1188 is the desired width of the box.
1189 If zero, the height is based on the screen size.
1192 if true, an "OK" button will be shown,
1193 and the dialog will wait for it to complete.
1195 .\" ************************************************************************
1196 .IP \fBdialog_progressbox
1197 implements the "\fB--progressbox\fP" option.
1200 .B const char * \fItitle
1201 is the title on the top of the widget.
1203 .B const char * \fIcprompt
1204 is the prompt text shown within the widget.
1205 If empty or null, no prompt is shown.
1208 is the desired height of the box.
1209 If zero, the height is based on the screen size.
1212 is the desired width of the box.
1213 If zero, the height is based on the screen size.
1215 .\" ************************************************************************
1216 .IP \fBdialog_rangebox
1217 implements the "\fB--rangebox\fP" option.
1220 .B const char * \fItitle
1221 is the title on the top of the widget.
1223 .B const char * \fIcprompt
1224 is the prompt text shown within the widget.
1225 If empty or null, no prompt is shown.
1228 is the desired height of the widget.
1229 If zero, the height is based on the screen size.
1232 is the desired width of the widget.
1233 If zero, the height is based on the screen size.
1236 is the minimum value to allow.
1239 is the maximum value to allow.
1241 .B int \fIdefault_value
1242 is the default value, if no change is made.
1244 .\" ************************************************************************
1245 .IP \fBdialog_tailbox
1246 implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
1247 depending on whether \fIbg_task\fP is set.
1250 .B const char * \fItitle
1251 is the title on the top of the widget.
1253 .B const char * \fIfile
1254 is the name of the file to display in the dialog.
1257 is the desired height of the box.
1258 If zero, the height is based on the screen size.
1261 is the desired width of the box.
1262 If zero, the height is based on the screen size.
1266 the window is added to the callback list in \fBdialog_state\fP,
1267 and the application will poll for the window to be updated.
1268 Otherwise an "OK" button is added to the window,
1269 and it will be closed when the button is activated.
1271 .\" ************************************************************************
1272 .IP \fBdialog_textbox
1273 implements the "\fB--textbox\fP" option.
1276 .B const char * \fItitle
1277 is the title on the top of the widget.
1279 .B const char * \fIfile
1280 is the name of the file to display in the dialog.
1283 is the desired height of the box.
1284 If zero, the height is based on the screen size.
1287 is the desired width of the box.
1288 If zero, the height is based on the screen size.
1290 .\" ************************************************************************
1291 .IP \fBdialog_timebox
1292 implements the "\fB--timebox\fP" option.
1295 .B const char * \fItitle
1296 is the title on the top of the widget.
1298 .B const char * \fIsubtitle
1299 is the prompt text shown within the widget.
1302 is the desired height of the box.
1303 If zero, the height is based on the screen size.
1306 is the desired width of the box.
1307 If zero, the height is based on the screen size.
1310 is the initial hour shown.
1311 If the value is negative, the current hour is used.
1312 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 24.
1315 is the initial minute shown.
1316 If the value is negative, the current minute is used.
1317 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
1320 is the initial second shown.
1321 If the value is negative, the current second is used.
1322 Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
1324 .\" ************************************************************************
1325 .IP \fBdialog_treeview
1326 implements the "\fB--treeview\fP" option.
1329 .B const char * \fItitle
1330 is the title on the top of the widget.
1332 .B const char * \fIcprompt
1333 is the prompt text shown within the widget.
1336 is the desired height of the box.
1337 If zero, the height is based on the screen size.
1340 is the desired width of the box.
1341 If zero, the height is based on the screen size.
1343 .B int \fIlist_height
1344 is the minimum height to reserve for displaying the list.
1345 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1348 is the number of rows in \fIitems\fP.
1351 is the list of items, contain tag, name, and optionally help strings
1352 (if \fBdialog_vars.item_help\fP is set).
1353 The initial selection state for each item is also in this list.
1357 is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
1358 or \fIFLAG_RADIO\fP for radiolists (a single selection).
1360 .\" ************************************************************************
1362 implements the "\fB--yesno\fP" option.
1365 .B const char * \fItitle
1366 is the title on the top of the widget.
1368 .B const char * \fIcprompt
1369 is the prompt text shown within the widget.
1372 is the desired height of the box.
1373 If zero, the height is based on the screen size.
1376 is the desired width of the box.
1377 If zero, the height is based on the screen size.
1380 .\" ************************************************************************
1381 .SH UTILITY FUNCTIONS
1382 Most functions that implement lower-level
1383 functionality for the command-line \fB\*p\fP
1384 program or widgets, have names beginning "\fIdlg_\fP".
1385 Bowing to longstanding usage, the functions that initialize the
1386 display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
1388 The only non-widget function whose name begins with "\fIdialog_\fP"
1389 is \fBdialog_version\fP, which returns the version number of the
1390 library as a string.
1393 Here is a brief summary of the utility functions and their parameters:
1394 .\" ---------------------------------------------------------------------------
1397 Add a callback, used to allow polling input from multiple tailbox
1401 .B DIALOG_CALLBACK *\fIp\fP
1402 contains the callback information.
1404 .\" ---------------------------------------------------------------------------
1406 .B dlg_add_callback_ref
1407 Like \fBdlg_add_callback\fP, but passes a reference to the \fBDIALOG_CALLBACK\fP
1408 as well as a pointer to a cleanup function which will be called when the
1409 associated input ends.
1412 .B DIALOG_CALLBACK **\fIp\fP
1413 points to the callback information.
1414 This is a reference to the pointer so that the caller's pointer can be
1415 zeroed when input ends.
1417 .B DIALOG_FREEBACK \fIfunc\fP
1418 function to call when input ends, e.g., to free caller's additional data.
1420 .\" ---------------------------------------------------------------------------
1422 .B dlg_add_help_formitem
1423 This is a utility function used enforce consistent behavior for
1424 the \fIDIALOG_VARS.help_tags\fP and \fIDIALOG_VARS.item_help\fP variables.
1427 .B int *\fIresult\fP
1428 this is updated to DLG_EXIT_ITEM_HELP if \fIDIALOG_VARS.item_help\fP is set.
1431 the tag- or help-text is stored here.
1433 .B DIALOG_FORMITEM *\fIitem\fP
1434 contains the list item to use for tag- or help-text.
1436 .\" ---------------------------------------------------------------------------
1438 .B dlg_add_help_listitem
1439 This is a utility function used enforce consistent behavior for
1440 the \fIDIALOG_VARS.help_tags\fP and \fIDIALOG_VARS.item_help\fP variables.
1443 .B int *\fIresult\fP
1444 this is updated to DLG_EXIT_ITEM_HELP if \fIDIALOG_VARS.item_help\fP is set.
1447 the tag- or help-text is stored here.
1449 .B DIALOG_LISTITEM *\fIitem\fP
1450 contains the list item to use for tag- or help-text.
1452 .\" ---------------------------------------------------------------------------
1455 Report the last key entered by the user.
1456 This implements the \fB--last-key\fP command-line option,
1457 using \fBdialog_vars.last_key\fP.
1461 controls the way the last key report is separated from other results:
1468 (separator after the key name)
1471 (separator is optionally before the key name)
1477 .\" ---------------------------------------------------------------------------
1480 Add a quoted string to the result buffer (see \fBdlg_add_result\fP).
1481 If no quotes are necessary, none are used.
1482 If \fBdialog_vars.single_quoted\fR is set, single-quotes are used.
1483 Otherwise, double-quotes are used.
1487 is the string to add.
1489 .\" ---------------------------------------------------------------------------
1492 Add a string to the result buffer \fBdialog_vars.input_result\fP.
1496 is the string to add.
1498 .\" ---------------------------------------------------------------------------
1500 .B dlg_add_separator
1501 Add an output-separator to the result buffer \fBdialog_vars.input_result\fP.
1502 If \fBdialog_vars.output_separator\fP is set, use that.
1503 Otherwise, if \fBdialog_vars.separate_output\fP is set, use newline.
1504 If neither is set, use a space.
1505 .\" ---------------------------------------------------------------------------
1508 Add a quoted or unquoted string to the result buffer
1509 (see \fBdlg_add_quoted\fP) and \fBdlg_add_result\fP),
1510 according to whether \fBdialog_vars.quoted\fP is true.
1514 is the string to add.
1516 .\" ---------------------------------------------------------------------------
1518 .B dlg_align_columns
1519 Copy and reformat an array of pointers to strings, aligning according to
1520 the column separator \fBdialog_vars.column_separator\fP.
1521 If no column separator is set, the array will be unmodified;
1522 otherwise it is copied and reformatted.
1524 Caveat: This function is only implemented for 8-bit characters.
1528 This is the array to reformat.
1529 It points to the first string to modify.
1532 This is the size of the struct for each row of the array.
1535 This is the number of rows in the array.
1537 .\" ---------------------------------------------------------------------------
1539 .B dlg_allocate_gauge
1540 Allocates a gauge widget.
1541 Use \fBdlg_update_gauge\fP to display the result.
1544 .B const char * \fItitle
1545 is the title string to display at the top of the widget.
1547 .B const char * \fIcprompt
1548 is the prompt text shown within the widget.
1551 is the desired height of the box.
1552 If zero, the height is adjusted to use the available screen size.
1555 is the desired width of the box.
1556 If zero, the height is adjusted to use the available screen size.
1559 is the percentage to show in the progress bar.
1561 .\" ---------------------------------------------------------------------------
1564 returns its parameter transformed to the
1565 corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
1566 If the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns 0.
1570 is the parameter, usually one of the \fBACS_\fP\fIxxx\fP constants.
1572 .\" ---------------------------------------------------------------------------
1575 Set window to the given attribute.
1579 is the window to update.
1582 is the number of rows to update.
1585 is the number of columns to update.
1588 is the attribute, e.g., \fBA_BOLD\fP.
1590 .\" ---------------------------------------------------------------------------
1593 Automatically size the window used for a widget.
1594 If the given height or width are zero,
1595 justify the \fIprompt\fP text and return the actual limits.
1598 .B const char * \fItitle
1599 is the title string to display at the top of the widget.
1601 .B const char * \fIprompt
1602 is the message text which will be displayed in the widget,
1603 used here to determine how large the widget should be.
1606 is the nominal height.
1609 is the nominal width.
1612 is the number of lines to reserve in the vertical direction.
1615 is the minimum number of columns to use.
1617 .\" ---------------------------------------------------------------------------
1619 .B dlg_auto_sizefile
1620 Like \fBdlg_auto_size\fP, but use a file contents to decide how large
1621 the widget should be.
1624 .B const char * \fItitle
1625 is the title string to display at the top of the widget.
1627 .B const char * \fIfile
1628 is the name of the file.
1631 is the nominal height.
1632 If it is -1, use the screen's height (after subtracting \fBdialog_vars.begin_y\fP
1633 if \fBdialog_vars.begin_set\fP is true).
1636 is the nominal width.
1637 If it is -1, use the screen's width (after subtracting \fBdialog_vars.begin_x\fP
1638 if \fBdialog_vars.begin_set\fP is true).
1641 is the number of lines to reserve on the screen for drawing boxes.
1644 is the number of columns to reserve on the screen for drawing boxes.
1646 .\" ---------------------------------------------------------------------------
1649 If \fBdialog_vars.beep_signal\fP is nonzero,
1650 this calls \fBbeep\fP once and sets
1651 \fBdialog_vars.beep_signal\fP to zero.
1652 .\" ---------------------------------------------------------------------------
1655 returns its \fBchtype\fP parameter transformed as follows:
1658 if neither \fBdialog_vars.ascii_lines\fP nor \fBdialog_vars.no_lines\fP is set.
1660 if \fBdialog_vars.ascii_lines\fP is set, returns the corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
1662 otherwise, if \fBdialog_vars.no_lines\fP is set, returns a space for the line-drawing characters.
1664 if the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns the parameter unchanged.
1666 .\" ---------------------------------------------------------------------------
1668 .B dlg_box_x_ordinate
1669 returns a suitable x-ordinate (column) for a new widget.
1670 If \fBdialog_vars.begin_set\fP is 1,
1671 use \fBdialog_vars.begin_x\fP;
1672 otherwise center the widget on the screen (using the \fIwidth\fP parameter).
1676 is the width of the widget.
1678 .\" ---------------------------------------------------------------------------
1680 .B dlg_box_y_ordinate
1681 returns a suitable y-ordinate (row) for a new widget.
1682 If \fBdialog_vars.begin_set\fP is 1,
1683 use \fBdialog_vars.begin_y\fP;
1684 otherwise center the widget on the screen (using the \fIheight\fP parameter).
1688 is the height of the widget.
1690 .\" ---------------------------------------------------------------------------
1693 This is an alternate interface to the \fBbuildlist\fP widget
1694 which allows the application to read the list item states back
1695 directly without putting them in the output buffer.
1698 .B const char * \fItitle
1699 is the title string to display at the top of the widget.
1701 .B const char * \fIcprompt
1702 is the prompt text shown within the widget.
1705 is the desired height of the box.
1706 If zero, the height is adjusted to use the available screen size.
1709 is the desired width of the box.
1710 If zero, the height is adjusted to use the available screen size.
1712 .B int \fIlist_height
1713 is the minimum height to reserve for displaying the list.
1714 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1717 is the number of rows in \fIitems\fP.
1719 .B DIALOG_LISTITEM * \fIitems
1720 is the list of items, contain tag, name, and optionally help strings
1721 (if \fBdialog_vars.item_help\fP is set).
1722 The initial selection state for each item is also in this list.
1724 .B const char * \fIstates
1725 This is a list of characters to display for the given states.
1726 Normally a buildlist provides true (1) and false (0) values,
1727 which the widget displays as "*" and space, respectively.
1728 An application may set this parameter to an arbitrary null-terminated string.
1729 The widget determines the number of states from the length of this string,
1730 and will cycle through the corresponding display characters as the user
1731 presses the space-bar.
1733 .B int \fIorder_mode
1734 is reserved for future enhancements
1736 .B int * \fIcurrent_item
1737 The widget sets the referenced location to the index of the current display
1738 item (cursor) when it returns.
1740 .\" ---------------------------------------------------------------------------
1743 Count the buttons in the list.
1746 .B const char ** \fIlabels
1747 is a list of (pointers to) button labels terminated by a null pointer.
1749 .\" ---------------------------------------------------------------------------
1751 .B dlg_button_layout
1752 Make sure there is enough space for the buttons by
1753 computing the width required for their labels,
1754 adding margins and limiting based on the screen size.
1757 .B const char ** \fIlabels
1758 is a list of (pointers to) button labels terminated by a null pointer.
1761 the function sets the referenced \fIlimit\fP to the width required for
1762 the buttons (limited by the screen size)
1763 if that is wider than the passed-in limit.
1765 .\" ---------------------------------------------------------------------------
1768 Compute the size of the button array in columns.
1771 .B const char ** \fIlabels
1772 is a list of (pointers to) button labels terminated by a null pointer.
1775 is true if the buttons are arranged in a column rather than a row.
1778 Return the total number of columns in the referenced location.
1781 Return the longest button's columns in the referenced location.
1783 .\" ---------------------------------------------------------------------------
1785 .B dlg_button_x_step
1786 Compute the step-size needed between elements of the button array.
1789 .B const char ** \fIlabels
1790 is a list of (pointers to) button labels terminated by a null pointer.
1793 is the maximum number of columns to allow for the buttons.
1796 store the nominal gap between buttons in the referenced location.
1797 This is constrained to be at least one.
1800 store the left+right total margins (for the list of buttons) in the referenced
1804 store the step-size in the referenced location.
1806 .\" ---------------------------------------------------------------------------
1808 .B dlg_button_to_char
1809 Find the first uppercase character in the label, which we may use for an
1811 If the label is empty, return -1.
1812 If no uppercase character is found, return 0.
1813 Otherwise return the uppercase character.
1818 .B dlg_char_to_button
1819 use the first uppercase character.
1820 However, they keep track of all of the labels and
1821 if the first has already been used in another label,
1822 they will continue looking for another uppercase character.
1823 This function does not have enough information to make that check.
1826 .B const char * \fIlabel
1827 is the label to test.
1829 .\" ---------------------------------------------------------------------------
1831 .B dlg_calc_list_width
1832 Calculate the minimum width for the list,
1833 assuming none of the items are truncated.
1837 is the number of \fIitems\fP.
1839 .B DIALOG_LISTITEM * \fIitems
1840 contains a \fIname\fP and \fItext\fP field,
1841 e.g., for checklists or radiobox lists.
1842 The function returns the sum of the widest columns
1843 needed for of each of these fields.
1845 If \fBdialog_vars.no_items\fP is set,
1846 the \fItext\fP fields in the list are ignored.
1848 .\" ---------------------------------------------------------------------------
1851 Calculate new height and list_height values.
1855 on input, is the height without adding the list-height.
1856 On return, this contains the total list-height and is the
1857 actual widget's height.
1859 .B int * \fIlist_height
1860 on input, is the requested list-height.
1861 On return, this contains the number of rows available for displaying
1862 the list after taking into account the screen size and
1863 the \fBdialog_vars.begin_set\fP and \fBdialog_vars.begin_y\fP variables.
1866 is the number of \fIitems\fP in the list.
1868 .\" ---------------------------------------------------------------------------
1871 This function is obsolete, provided for library-compatibility.
1872 It is replaced by \fBdlg_calc_list_width\fP.
1876 is the number of \fIitems\fP.
1879 is a list of character pointers.
1882 is the number of items in each group, e.g., the second array index.
1884 .\" ---------------------------------------------------------------------------
1886 .B dlg_char_to_button
1887 Given a list of button labels,
1888 and a character which may be the abbreviation for one, find it, if it exists.
1889 An abbreviation will be the first character
1890 which happens to be capitalized in the label.
1891 If the character is found, return its index within the list of \fIlabels\fP.
1892 Otherwise, return \fBDLG_EXIT_UNKNOWN\fP.
1896 is the character to find.
1898 .B const char ** \fIlabels
1899 is a list of (pointers to) button labels terminated by a null pointer.
1901 .\" ---------------------------------------------------------------------------
1904 This entrypoint provides the \fB--checklist\fP or \fB--radiolist\fP
1905 functionality without the limitations of \fB\*p\fP's command-line syntax
1906 (compare to \fBdialog_checklist\fP).
1909 .B const char * \fItitle
1910 is the title string to display at the top of the widget.
1912 .B const char * \fIcprompt
1913 is the prompt text shown within the widget.
1916 is the desired height of the box.
1917 If zero, the height is adjusted to use the available screen size.
1920 is the desired width of the box.
1921 If zero, the height is adjusted to use the available screen size.
1923 .B int \fIlist_height
1924 is the minimum height to reserve for displaying the list.
1925 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
1928 is the number of \fIitems\fP.
1930 .B DIALOG_LISTITEM * \fIitems
1931 This is a list of the items to display in the checklist.
1933 .B const char * \fIstates
1934 This is a list of characters to display for the given states.
1935 Normally a checklist provides true (1) and false (0) values,
1936 which the widget displays as "*" and space, respectively.
1937 An application may set this parameter to an arbitrary null-terminated string.
1938 The widget determines the number of states from the length of this string,
1939 and will cycle through the corresponding display characters as the user
1940 presses the space-bar.
1943 This is should be one of \fBFLAG_CHECK\fP or \fPFLAG_RADIO\fP,
1944 depending on whether the widget should act as a checklist or radiobox.
1946 .B int * \fIcurrent_item
1947 The widget sets the referenced location to the index of the current display
1948 item (cursor) when it returns.
1950 .\" ---------------------------------------------------------------------------
1952 .B dlg_check_scrolled
1953 given a function key (or other key that was mapped to a function key),
1954 check if it is one of the up/down scrolling functions:
1971 Some widgets use these key bindings for scrolling the prompt-text up and
1972 down, to allow for display in very small windows.
1974 The function returns 0 (zero) if it finds one of these keys,
1979 is the function-key to check
1982 is the number of lines
1983 which would be used to display the scrolled prompt in
1984 an arbitrarily tall window.
1985 It is used here to check limits for the \fIoffset\fP value.
1988 this is the available height for writing scrolled text,
1989 which is smaller than the window if it contains buttons.
1992 on return, holds TRUE if \fBdlg_print_scrolled\fP should be used to redisplay
1996 on entry, holds the starting line number (counting from zero)
1997 last used for \fBdlg_print_scrolled\fP.
1998 On return, holds the updated starting line number.
2000 .\" ---------------------------------------------------------------------------
2003 Set window to the default \fB\*p\fP screen attribute.
2004 This is set in the rc-file with \fBscreen_color\fP.
2005 .\" ---------------------------------------------------------------------------
2008 Free storage used for the result buffer (\fBdialog_vars.input_result\fP).
2009 The corresponding pointer is set to NULL.
2010 .\" ---------------------------------------------------------------------------
2013 Return the number of colors that can be configured in \fB\*p\fP.
2014 .\" ---------------------------------------------------------------------------
2017 Initialize the color pairs used in \fB\*p\fP.
2018 .\" ---------------------------------------------------------------------------
2021 Count the entries in an argument vector.
2025 Points to the argument vector.
2027 .\" ---------------------------------------------------------------------------
2029 .B dlg_count_columns
2030 Returns the number of columns used for a string.
2031 This is not necessarily the number of bytes in a string.
2034 .B const char * \fIstring
2035 is the string to measure.
2037 .\" ---------------------------------------------------------------------------
2039 .B dlg_count_real_columns
2040 Returns the number of columns used for a string,
2041 accounting for "\eZ" sequences which can be used for
2042 coloring the text if \fBdialog_vars.colors\fP is set.
2043 This is not necessarily the number of bytes in a string.
2046 .B const char * \fIstring
2047 is the string to measure.
2049 .\" ---------------------------------------------------------------------------
2052 Returns the number of wide-characters in the string.
2055 .B const char * \fIstring
2056 is the string to measure.
2058 .\" ---------------------------------------------------------------------------
2061 Create a configuration file,
2062 i.e., write internal tables to a file which can be read back by \fB\*p\fP
2066 .B const char * \fIfilename
2067 is the name of the file to write to.
2069 .\" ---------------------------------------------------------------------------
2072 If \fBdialog_vars.size_err\fP is true,
2073 check if the given window size is too large to fit on the screen.
2074 If so, exit with an error reporting the size of the window.
2078 is the window's height
2081 is the window's width
2083 .\" ---------------------------------------------------------------------------
2085 .B dlg_default_button
2086 If \fBdialog_vars.default_button\fP is positive,
2087 return the button-index for that button code,
2088 using \fBdlg_ok_buttoncode\fP to test indices starting with zero.
2089 Otherwise (or if no match was found for the button code), return zero.
2090 .\" ---------------------------------------------------------------------------
2092 .B dlg_default_formitem
2093 If \fBdialog_vars.default_item\fP is not null,
2094 find that name by matching the \fIname\fP field in the list of form \fIitems\fP.
2095 If found, return the index of that item in the list.
2096 Otherwise, return zero.
2099 .B DIALOG_FORMITEM * \fIitems
2100 is the list of items to search.
2101 It is terminated by an entry with a null \fIname\fP field.
2103 .\" ---------------------------------------------------------------------------
2106 This function is obsolete, provided for library-compatibility.
2107 It is replaced by \fBdlg_default_formitem\fP and \fBdlg_default_listitem\fP.
2111 is the list of items to search.
2114 is the number of items in each group, e.g., the second array index.
2116 .\" ---------------------------------------------------------------------------
2118 .B dlg_defaultno_button
2119 If \fBdialog_vars.defaultno\fP is true, and \fBdialog_vars.nocancel\fP is not,
2120 find the button-index for the "Cancel" button.
2121 Otherwise, return the index for "OK" (always zero).
2122 .\" ---------------------------------------------------------------------------
2125 Remove a window, repainting everything else.
2129 is the window to remove.
2131 .\" ---------------------------------------------------------------------------
2134 This is called each time a widget is invoked which may do output.
2135 It increments \fBdialog_state.output_count\fP,
2136 so the output function in \fB\*p\fP can test this and add a separator.
2137 .\" ---------------------------------------------------------------------------
2140 Draw up/down arrows on a window, e.g., for scrollable lists.
2141 It calls \fBdlg_draw_arrows2\fP using the
2142 \fImenubox_color\fP and \fImenubox_border_color\fP attributes.
2145 .B WINDOW * \fIdialog
2146 is the window on which to draw an arrow.
2149 is true if an up-arrow should be drawn at the top of the window.
2151 .B int \fIbottom_arrow
2152 is true if an down-arrow should be drawn at the bottom of the window.
2155 is the zero-based column within the window on which to draw arrows.
2158 is the zero-based row within the window on which to draw up-arrows
2159 as well as a horizontal line to show the window's top.
2162 is the zero-based row within the window on which to draw down-arrows
2163 as well as a horizontal line to show the window's bottom.
2165 .\" ---------------------------------------------------------------------------
2168 Draw up/down arrows on a window, e.g., for scrollable lists.
2171 .B WINDOW * \fIdialog
2172 is the window on which to draw an arrow.
2175 is true if an up-arrow should be drawn at the top of the window.
2177 .B int \fIbottom_arrow
2178 is true if an down-arrow should be drawn at the bottom of the window.
2181 is the zero-based column within the window on which to draw arrows.
2184 is the zero-based row within the window on which to draw up-arrows
2185 as well as a horizontal line to show the window's top.
2188 is the zero-based row within the window on which to draw down-arrows
2189 as well as a horizontal line to show the window's bottom.
2192 is the window's background attribute.
2194 .B chtype \fIborderattr
2195 is the window's border attribute.
2197 .\" ---------------------------------------------------------------------------
2199 .B dlg_draw_bottom_box
2200 Draw a partial box at the bottom of a window,
2201 e.g., to surround a row of buttons.
2202 It is designed to merge with an existing box around
2203 the whole window (see \fBdlg_draw_box\fP),
2204 so it uses tee-elements rather than corner-elements
2205 on the top corners of this box.
2209 is the window to update.
2211 .\" ---------------------------------------------------------------------------
2213 .B dlg_draw_bottom_box2
2214 Draw a partial box at the bottom of a window,
2215 e.g., to surround a row of buttons.
2216 It is designed to merge with an existing box around
2217 the whole window (see \fBdlg_draw_box2\fP),
2218 so it uses tee-elements rather than corner-elements
2219 on the top corners of this box.
2223 is the window to update.
2225 .B chtype \fIon_left
2226 is used to color the upper/left edges of the box, i.e., the tee-element and
2229 .B chtype \fIon_right
2230 is used to color the right edge of the box, i.e., the tee-element
2232 .B chtype \fIon_inside
2233 is used to fill-color the inside of the box
2235 .\" ---------------------------------------------------------------------------
2238 Draw a rectangular box with line drawing characters.
2242 is the window to update.
2245 is the top row of the box.
2248 is the left column of the box.
2251 is the height of the box.
2254 is the width of the box.
2256 .B chtype \fIboxchar
2257 is used to color the right/lower edges.
2258 It also is fill-color used for the box contents.
2260 .B chtype \fIborderchar
2261 is used to color the upper/left edges.
2263 .\" ---------------------------------------------------------------------------
2266 Draw a rectangular box with line drawing characters.
2270 is the window to update.
2273 is the top row of the box.
2276 is the left column of the box.
2279 is the height of the box.
2282 is the width of the box.
2284 .B chtype \fIboxchar
2285 is used to fill-color for the box contents.
2287 .B chtype \fIborderchar
2288 is used to color the upper/left edges.
2290 .B chtype \fIborderchar2
2291 is used to color the right/lower edges.
2293 .\" ---------------------------------------------------------------------------
2296 Print a list of buttons at the given position.
2300 is the window to update.
2303 is the starting row.
2306 is the starting column.
2308 .B const char ** \fIlabels
2309 is a list of (pointers to) button labels terminated by a null pointer.
2312 is the index within the list of the selected button.
2315 is true if the buttons are arranged in a column rather than a row.
2318 is the number of columns (or rows if \fIvertical\/\fP) allowed for the display.
2320 .\" ---------------------------------------------------------------------------
2322 .B dlg_draw_helpline
2323 draw the text in \fBdialog_vars.help_line\fP at the bottom of the given window.
2326 .B WINDOW * \fIdialog
2327 is the window to modify.
2329 .B bool \fIdecorations
2330 if true, allow room for the scrolling arrows.
2332 .\" ---------------------------------------------------------------------------
2334 .B dlg_draw_scrollbar
2335 If \fBdialog_state.use_scrollbar\fP is set,
2336 draw a scrollbar on the right margin of windows holding scrollable data.
2337 Also (whether or not the scrollbar is drawn),
2338 annotate the bottom margin of the window with the percentage of data
2339 by the bottom of that window,
2340 and call \fBdlg_draw_arrows2\fP to put markers on the window showing
2341 when more data is available.
2345 is the window in which the data is scrolled.
2346 Because \fIleft\fP, \fIright\fP, \fItop\fP, \fIbottom\fP
2347 are passed as parameters, this window can contain additional data.
2349 .B long \fIfirst_data
2350 is the zero-based index to the first row of data in the current window.
2352 .B long \fIthis_data
2353 is the zero-based index to the current row of data.
2355 .B long \fInext_data
2356 is the zero-based index to the next data after the current row.
2358 .B long \fItotal_data
2359 is the total number of rows of data.
2362 is the zero-based left margin/column of the window.
2363 The up/down arrows are draw inset by 5 columns from this point.
2366 is the zero-based right margin/column of the window.
2367 The scrollbar is drawn flush against this column.
2370 is the zero-based row within the window on which to draw up-arrows
2371 as well as a horizontal line to show the window's top.
2374 is the zero-based row within the window on which to draw down-arrows
2375 as well as a horizontal line to show the window's bottom.
2378 is the window's background attribute.
2380 .B chtype \fIborderattr
2381 is the window's border attribute.
2383 .\" ---------------------------------------------------------------------------
2386 Draw shadows along the right and bottom edge of a window to give it
2387 a 3-dimensional look.
2388 (The height, etc., may not be the same as the window's actual values).
2392 is the window to update.
2395 is the height of the window.
2398 is the width of the window.
2401 is the top row of the window.
2404 is the left column of the window.
2406 .\" ---------------------------------------------------------------------------
2409 Draw a title centered at the top of the window.
2413 is the window to update.
2415 .B const char * \fItitle
2416 is the title string to display at the top of the widget.
2418 .\" ---------------------------------------------------------------------------
2420 .B dlg_dummy_menutext
2421 This is a utility function which supports the \fB--inputmenu\fP option of
2422 the \fB\*p\fP program.
2423 If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
2424 pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
2425 Otherwise, it passes \fBdlg_dummy_menutext\fP.
2427 The function should only return \fBDLG_EXIT_ERROR\fP.
2430 .B DIALOG_LISTITEM * \fIitems
2431 is the list of menu items
2434 is the index of the currently-selected item
2436 .B char * \fInewtext
2437 is the updated text for the menu item
2439 .\" ---------------------------------------------------------------------------
2442 Write all user-defined key-bindings to the given stream,
2443 e.g., as part of \fBdlg_create_rc\fP.
2447 is the stream on which to write the bindings.
2449 .\" ---------------------------------------------------------------------------
2451 .B dlg_dump_window_keys
2452 Write all user-defined key-bindings to the given stream,
2453 e.g., as part of \fBdlg_create_rc\fP.
2457 is the stream on which to write the bindings.
2460 is the window for which bindings should be dumped.
2461 If it is null, then only built-in bindings are dumped.
2463 .\" ---------------------------------------------------------------------------
2466 Remove one or more items from an argument vector.
2470 in/out parameter giving the length of the argument vector.
2471 .B char *** \fIargvp
2472 in/out parameter pointing to the argument vector.
2476 number of arguments to remove.
2478 .\" ---------------------------------------------------------------------------
2481 Given the character-offset in the string,
2482 returns the display-offset where
2483 \fB\*p\fP should position the cursor.
2484 In this context, "characters" may be multicolumn,
2485 since the string can be a multibyte character string.
2489 is the string to analyze
2492 is the character-offset
2495 is a limit on the column positions that can be used,
2496 e.g., the window's size.
2498 .\" ---------------------------------------------------------------------------
2501 Updates the string and character-offset, given various editing characters
2502 or literal characters which are inserted at the character-offset.
2503 Returns true if an editing change was made (and the display should
2504 be updated), and false if the key was something like KEY_ENTER,
2505 which is a non-editing action outside this function.
2509 is the (multibyte) string to update
2512 is the character-offset
2518 is true if the editing key is a function-key
2521 is used in a special loop case by calling code to force the return
2522 value of this function when a function-key code 0 is passed in.
2524 .\" ---------------------------------------------------------------------------
2527 Given an internal exit code,
2528 check if the corresponding environment variable is set.
2529 If so, remap the exit code to match the environment variable.
2530 Finally call \fBexit\fP with the resulting exit code.
2534 is the internal exit code, e.g., \fBDLG_EXIT_OK\fP,
2535 which may be remapped.
2538 The \fB\*p\fP program uses this function
2539 to allow shell scripts to remap the exit codes so they can distinguish ESC
2541 .\" ---------------------------------------------------------------------------
2543 .B dlg_exit_buttoncode
2544 Map the given button index for \fBdlg_exit_label\fP into \fB\*p\fP's exit-code.
2550 .\" ---------------------------------------------------------------------------
2553 Return a list of button labels.
2554 If dialog_var.extra_button is true, return the result of \fBdlg_ok_labels\fP.
2555 Otherwise, return a list with the "Exit" label and (if \fBdialog_vars.help_button\fP
2556 is set) the "Help" button as well.
2557 .\" ---------------------------------------------------------------------------
2560 Quit program killing all \fBtailboxbg\fP widgets.
2563 .B const char * \fIfmt
2564 is the format of the \fBprintf\fP-like message to write.
2568 are the variables to apply to the \fIfmt\fP format.
2570 .\" ---------------------------------------------------------------------------
2573 Given the character-offset to find in the list, return the corresponding
2577 .B const int *\fIlist
2578 contains a list of character-offsets,
2579 i.e., indices into a string that denote the beginning of multibyte characters.
2582 is the last index into \fBlist\fP to search.
2585 is the character-offset to find.
2587 .\" ---------------------------------------------------------------------------
2589 .B dlg_finish_string
2590 If \fIDIALOG_STATE.finish_string\fP is true,
2591 this function discards data used to speed up layout computations.
2594 .B const char * \fIstring
2595 is the address of the string whose data should be discarded.
2596 The address rather than contents is used as the unique identifier because
2597 some of the caching is used for editable input-fields.
2599 .\" ---------------------------------------------------------------------------
2602 Cancel the local data saved by \fBdlg_last_getc\fP.
2603 .\" ---------------------------------------------------------------------------
2606 This entrypoint provides the \fB--editbox\fP
2607 functionality without the limitations of \fB\*p\fP's command-line syntax
2608 (compare to \fBdialog_editbox\fP).
2611 .B const char * \fItitle
2612 is the title string to display at the top of the widget.
2615 is a pointer to an array of \fBchar\ *\fP pointers.
2616 The array is allocated by the caller,
2617 and so are the strings to which it points.
2618 The \fBdlg_editbox\fP function may reallocate the
2619 array and the strings.
2622 points to the nominal length of \fIlist\fP.
2623 The referenced value is updated if\fIlist\fP is reallocated.
2626 is the desired height of the box.
2627 If zero, the height is adjusted to use the available screen size.
2630 is the desired width of the box.
2631 If zero, the height is adjusted to use the available screen size.
2633 .\" ---------------------------------------------------------------------------
2636 This entrypoint provides the \fB--form\fP
2637 functionality without the limitations of \fB\*p\fP's command-line syntax
2638 (compare to \fBdialog_form\fP).
2641 .B const char * \fItitle
2642 is the title string to display at the top of the widget.
2644 .B const char * \fIcprompt
2645 is the prompt text shown within the widget.
2648 is the desired height of the box.
2649 If zero, the height is adjusted to use the available screen size.
2652 is the desired width of the box.
2653 If zero, the height is adjusted to use the available screen size.
2655 .B int \fIform_height
2656 is the minimum height to reserve for displaying the list.
2657 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
2660 is the number of \fIitems\fP.
2662 .B DIALOG_FORMITEM * \fIitems
2663 This is a list of the items to display in the form.
2665 .B int * \fIcurrent_item
2666 The widget sets the referenced location to the index of the current display
2667 item (cursor) when it returns.
2669 .\" ---------------------------------------------------------------------------
2672 Free data allocated by \fBdlg_align_columns\fP.
2676 This is the array which was reformatted.
2677 It points to the first string to free.
2680 This is the size of the struct for each row of the array.
2683 This is the number of rows in the array.
2685 .\" ---------------------------------------------------------------------------
2687 .B dlg_free_formitems
2688 Free memory owned by a list of DIALOG_FORMITEM's.
2691 .B DIALOG_FORMITEM * \fIitems
2692 is the list to free.
2694 .\" ---------------------------------------------------------------------------
2697 Remove the gauge widget from the screen and free its associated memory.
2701 points to the gauge widget.
2703 .\" ---------------------------------------------------------------------------
2706 Read a character from the given window.
2707 Handle repainting here (to simplify
2708 things in the calling application).
2709 Also, if input-callback(s) are set up,
2710 poll the corresponding files and handle the updates,
2711 e.g., for displaying a tailbox.
2712 Returns the key-code.
2716 is the window within which to read.
2719 as a side-effect, set this to true if the key-code is really a function-key.
2721 .\" ---------------------------------------------------------------------------
2724 extract the video attributes from the given window.
2728 is the window from which to get attributes.
2730 .\" ---------------------------------------------------------------------------
2732 .B dlg_getc_callbacks
2733 passes the given key-code \fIch\fP to the current window that
2734 has established a callback.
2735 If the callback returns zero, remove it and try the next window.
2736 If no more callbacks remain, return.
2737 If any callbacks were found, return true, otherwise false.
2744 is true if the key is a function-key
2747 is used to pass an exit-code to the caller,
2748 which should pass that via \fBdlg_exit\fP.
2750 .\" ---------------------------------------------------------------------------
2752 .B dlg_index_columns
2753 Build a list of the display-columns for the given multibyte string's characters.
2756 .B const char * \fIstring
2757 is the string to analyze
2759 .\" ---------------------------------------------------------------------------
2762 Build an index of the wide-characters in the string,
2763 so the caller can easily tell
2764 which byte-offset begins a given wide-character.
2767 .B const char * \fIstring
2768 is the string to analyze
2770 .\" ---------------------------------------------------------------------------
2773 Draw the string for the \fBdialog_vars.item_help\fP feature.
2776 .B const char * \fItxt
2779 .\" ---------------------------------------------------------------------------
2782 If \fB\*p\fP has callbacks active,
2783 purge the list of all that are not marked
2784 to keep in the background.
2785 If any remain, run those in a background process.
2789 stores the exit-code to pass back to the caller.
2791 .\" ---------------------------------------------------------------------------
2794 returns the most recent character that was read via \fBdlg_getc\fP.
2795 .\" ---------------------------------------------------------------------------
2797 .B dlg_limit_columns
2798 Given a column limit,
2799 count the number of wide characters that can fit into that limit.
2800 The offset is used to skip over a leading character
2801 that was already written.
2804 .B const char * \fIstring
2805 is the string to analyze
2811 is the starting offset from which analysis should continue
2813 .\" ---------------------------------------------------------------------------
2816 Check for a key-binding.
2817 If there is no binding associated with the widget, it simply returns
2818 the given curses-key.
2819 Otherwise, it returns the result of the binding
2823 is the window on which the binding is checked
2825 .B int \fIcurses_key
2826 is the curses key-code
2828 .B int * \fIdialog_key
2829 is the corresponding \fB\*p\fP internal code
2830 (see \fBDLG_KEYS_ENUM\fP in dlg_key.h).
2832 .\" ---------------------------------------------------------------------------
2835 Limit the parameter according to \fBdialog_vars.max_input\fP
2839 is the value to limit
2841 .\" ---------------------------------------------------------------------------
2844 Match a given character against the beginning of the string,
2845 ignoring case of the given character.
2846 The matching string must begin with an uppercase character.
2850 is the character to check
2852 .B const char * \fIstring
2853 is the string to search
2855 .\" ---------------------------------------------------------------------------
2858 This entrypoint provides the \fB--menu\fP
2859 functionality without the limitations of \fB\*p\fP's command-line syntax
2860 (compare to \fBdialog_menu\fP).
2863 .B const char * \fItitle
2864 is the title string to display at the top of the widget.
2866 .B const char * \fIcprompt
2867 is the prompt text shown within the widget.
2870 is the desired height of the box.
2871 If zero, the height is adjusted to use the available screen size.
2874 is the desired width of the box.
2875 If zero, the height is adjusted to use the available screen size.
2877 .B int \fImenu_height
2878 is the minimum height to reserve for displaying the list.
2879 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
2882 is the number of \fIitems\fP.
2884 .B DIALOG_LISTITEM * \fIitems
2885 This is a list of the items to display in the form.
2887 .B int * \fIcurrent_item
2888 The widget sets the referenced location to the index of the current display
2889 item (cursor) when it returns.
2891 .B DIALOG_INPUTMENU \fIrename_menutext
2892 If this is not \fBdlg_dummy_menutext\fP,
2893 the widget acts like an \fIinputmenu\fP widget,
2894 providing an extra "Rename" button,
2895 which activates an edit feature on the selected menu item.
2897 .\" ---------------------------------------------------------------------------
2900 Moves/resizes the given window to the given position and size.
2904 is the window to move/resize.
2906 .B WINDOW *\fIheight
2907 is the height of the resized window.
2910 is the width of the resized window.
2913 y-ordinate to use for the repositioned window.
2916 x-ordinate to use for the repositioned window.
2918 .\" ---------------------------------------------------------------------------
2920 .B dlg_mouse_bigregion
2921 Retrieve the big-region under the pointer.
2925 is the row on which the mouse click occurred
2928 is the column on which the mouse click occurred
2930 .\" ---------------------------------------------------------------------------
2932 .B dlg_mouse_free_regions
2933 Free the memory associated with mouse regions.
2934 .\" ---------------------------------------------------------------------------
2936 .B dlg_mouse_mkbigregion
2937 Creates a region on which the mouse-clicks will return a specified code.
2941 is the top-row of the region.
2944 is the left-column of the region.
2947 is the height of the region.
2950 is the width of the region.
2953 is a code used to make the region unique within a widget
2956 is used in modes 2 (columns) and 3 (cells) to determine the width
2963 is used to determine how the mouse position is translated into
2964 a code (like a function-key):
2977 .\" ---------------------------------------------------------------------------
2979 .B dlg_mouse_mkregion
2983 is the top-row of the region.
2986 is the left-column of the region.
2989 is the height of the region.
2992 is the width of the region.
2995 is a code used to make the region unique within a widget
2997 .\" ---------------------------------------------------------------------------
3000 Retrieve the frame under the mouse pointer
3004 is the row of the mouse-click
3007 is the column of the mouse-click
3009 .\" ---------------------------------------------------------------------------
3011 .B dlg_mouse_setbase
3012 Sets a base for subsequent calls to \fBdlg_mouse_mkregion\fP,
3013 so they can make regions relative to the start of a given window.
3017 is the left-column for the base
3020 is the top-row for the base
3022 .\" ---------------------------------------------------------------------------
3024 .B dlg_mouse_setcode
3025 Sets a value used internally by \fBdlg_mouse_mkregion\fP
3026 which is added to the \fIcode\fP parameter.
3027 By providing different values,
3028 e.g., multiples of \fBKEY_MAX\fP,
3029 it is possible to support multiple "big" regions in a widget.
3030 The \fIbuildlist\fP widget uses this feature to recognize mouse-clicks
3031 in the left/right panes.
3035 is the value to add to \fBdlg_mouse_mkregion\fP's \fIcode\fP parameter.
3037 .\" ---------------------------------------------------------------------------
3040 is a wrapper for \fBdlg_getc\fP which additionally maps mouse-clicks
3041 (if the curses library supports those) into extended function-keys
3042 which encode the position according to the \fImode\fP in
3043 \fBdlg_mouse_mkbigregion\fP.
3044 Returns the corresponding key-code.
3048 is the window on which to perform the input
3051 the referenced location is set to true if the key-code is an actual
3052 or extended (mouse) function-key.
3054 .\" ---------------------------------------------------------------------------
3056 .B dlg_mouse_wgetch_nowait
3057 This is a non-blocking variant of \fBdlg_mouse_wgetch\fP.
3061 is the window on which to perform the input
3064 the referenced location is set to true if the key-code is an actual
3065 or extended (mouse) function-key.
3067 .\" ---------------------------------------------------------------------------
3069 .B dlg_need_separator
3070 Check if an output-separator is needed.
3071 If \fBdialog_vars.output_separator\fP is set, return true.
3072 Otherwise, if \fBdialog_vars.input_result\fP is nonempty, return true.
3073 If neither, return false.
3074 .\" ---------------------------------------------------------------------------
3076 .B dlg_new_modal_window
3077 Create a modal window, optionally with a shadow.
3078 The shadow is created if \fBdialog_state.use_shadow\fP is true.
3081 .B WINDOW * \fIparent
3082 is the parent window (usually the top-level window of a widget)
3085 is the window's height
3088 is the window's width
3091 is the window's top-row
3094 is the window's left-column
3096 .\" ---------------------------------------------------------------------------
3099 Create a window, optionally with a shadow.
3100 The shadow is created if \fBdialog_state.use_shadow\fP is true.
3104 is the window's height
3107 is the window's width
3110 is the window's top-row
3113 is the window's left-column
3115 .\" ---------------------------------------------------------------------------
3118 Return the next index in the list of labels.
3121 .B const char ** \fIlabels
3122 is a list of (pointers to) button labels terminated by a null pointer.
3125 is the current button-index.
3127 .\" ---------------------------------------------------------------------------
3129 .B dlg_next_ok_buttonindex
3130 Assuming that the caller is using \fBdlg_ok_labels\fP to list buttons,
3131 find the next index in the list of buttons.
3135 is the current index in the list of buttons
3138 if negative, provides a way to enumerate extra active areas on the widget.
3140 .\" ---------------------------------------------------------------------------
3142 .B dlg_ok_buttoncode
3143 Map the given button index for \fBdlg_ok_labels\fP
3144 into \fB\*p\fP's exit-code.
3148 is the button-index (which is not necessarily the same as the index
3149 in the list of labels).
3151 .\" ---------------------------------------------------------------------------
3154 Returns a list with the "Ok" label,
3155 and if \fBdialog_vars.help_button\fP is true, the "Help" label as well.
3156 .\" ---------------------------------------------------------------------------
3159 Return a list of button labels for the OK/Cancel group of widgets.
3160 .\" ---------------------------------------------------------------------------
3163 Decode the string as an integer, decrement if greater than zero to make
3164 a curses-ordinate from a dialog-ordinate.
3165 .\" ---------------------------------------------------------------------------
3167 .B dlg_parse_bindkey
3168 Parse the parameters of the "bindkeys" configuration-file entry.
3169 This expects widget name which may be "*", followed by curses key definition and
3170 then \fB\*p\fP key definition.
3174 is the parameter string to parse.
3176 .\" ---------------------------------------------------------------------------
3179 Parse the configuration file and set up variables.
3180 .\" ---------------------------------------------------------------------------
3183 Return the previous index in the list of labels.
3186 .B const char ** \fIlabels
3187 is a list of (pointers to) button labels terminated by a null pointer.
3190 is the current button index
3192 .\" ---------------------------------------------------------------------------
3194 .B dlg_print_listitem
3195 This is a helper function used for the various "list" widgets,
3196 e.g., checklist, menu, buildlist, treeview.
3197 Each list-widget has "tag" and "description" values for each item
3198 which can be displayed.
3199 If \fBdialog_vars.no_tags\fP is true,
3200 the "tag" value is not shown.
3201 The first character of the first value shown (tag or description)
3202 is highlighted to indicate that the widget will match it for quick navigation.
3206 the window in which to display the text
3208 .B const char *\fItext
3209 the value to display
3212 the number of columns available for printing the text
3215 true if this is the first call (for "tag" and "description"),
3216 and the first character of the value should be highlighted.
3219 nonzero if the text should be displayed using the "selected" colors
3221 .\" ---------------------------------------------------------------------------
3223 .B dlg_print_scrolled
3224 This is a wrapper for \fBdlg_print_autowrap\fP which allows the user
3225 to scroll too-long prompt text up/down.
3227 See \fBdlg_check_scrolled\fP for a function which updates the \fIoffset\fP
3228 variable used as a parameter here.
3229 It complements this function; you need both.
3230 If \fIpauseopt\fP is set, this function returns an updated \fIlast\fP
3231 parameter, needed for \fBdlg_check_scrolled\fP calls.
3235 is the window to update.
3237 .B const char * \fIprompt
3238 is the string to print
3241 is the starting line-number to write wrapped text.
3244 is the available height for writing the wrapped text
3247 is the width that the wrapping should occur in
3250 is true if the extra functionality for scrolling should be enabled.
3251 If false, this calls \fBdlg_print_autowrap\fP without doing any scrolling.
3253 .\" ---------------------------------------------------------------------------
3256 Print one line of the prompt in the window within the limits of the
3257 specified right margin.
3258 The line will end on a word boundary and a pointer
3259 to the start of the next line is returned, or a NULL pointer if the end of
3264 is the window to update.
3267 holds the starting attributes, and is updated to reflect the final attributes
3268 applied to the string.
3270 .B const char *\fIprompt
3271 is the string to print
3280 returns the ending x-ordinate.
3282 .\" ---------------------------------------------------------------------------
3284 .B dlg_prev_ok_buttonindex
3285 Find the previous button index in the list from \fBdlg_ok_labels\fP.
3289 is the current index
3292 if negative provides a way to enumerate extra active areas on the widget.
3294 .\" ---------------------------------------------------------------------------
3296 .B dlg_print_autowrap
3297 Print a string of text in a window, automatically wrap around to the next
3298 line if the string is too long to fit on one line.
3299 Note that the string may contain embedded newlines.
3300 The text is written starting at the top of the window.
3304 is the window to update.
3306 .B const char * \fIprompt
3307 is the string to print
3310 is the nominal height the wrapped string is limited to
3313 is the width that the wrapping should occur in
3315 .\" ---------------------------------------------------------------------------
3318 If \fBdialog_vars.print_siz\fP is true,
3319 print the given height/width (from a widget)
3320 to \fBdialog_state.output\fP, e.g.,
3321 \fBSize: height, width\fP.
3325 is the window's height
3328 is the window's width
3330 .\" ---------------------------------------------------------------------------
3333 Print up to \fIcols\fP columns from \fBtext\fP,
3334 optionally rendering \fB\*p\fP's escape sequences for attributes and color.
3338 is the window to update.
3340 .B const char * \fItxt
3341 is the string to print
3347 holds the starting attributes, and is updated to reflect the final attributes
3348 applied to the string.
3350 .\" ---------------------------------------------------------------------------
3352 implements the "\fB--prgbox\fP" and "\fB--progressbox\fP" options.
3355 .B const char * \fItitle
3356 is the title on the top of the widget.
3358 .B const char * \fIcprompt
3359 is the prompt text shown within the widget.
3360 If empty or null, no prompt is shown.
3363 is the desired height of the box.
3364 If zero, the height is based on the screen size.
3367 is the desired width of the box.
3368 If zero, the height is based on the screen size.
3371 if true, an "OK" button will be shown,
3372 and the dialog will wait for it to complete.
3373 With an "OK" button, it is denoted a "programbox",
3374 without an "OK" button, it is denoted a "progressbox".
3377 is the file pointer, which may be a pipe or a regular file.
3379 .\" ---------------------------------------------------------------------------
3381 .B dlg_put_backtitle
3382 Display the background title if \fBdialog_vars.backtitle\fP is non-null.
3383 The background title is shown at the top of the screen.
3384 .\" ---------------------------------------------------------------------------
3386 .B dlg_reallocate_gauge
3387 Allocates or reallocates a gauge widget (see \fBdlg_allocate_gauge\fP).
3388 Use \fBdlg_update_gauge\fP to display the result.
3391 .B void ** \fIobjptr
3392 If the pointer referenced by this parameter is null, the function creates
3393 a new gauge widget using \fBdlg_allocate_gauge\fP.
3394 Otherwise, it updates the title and cprompt values, reusing the window
3395 from the previous call on this function.
3396 As a side-effect, the function stores the updated object-pointer via
3397 the \fIobjptr\fP parameter.
3399 .B const char * \fItitle
3400 is the title string to display at the top of the widget.
3402 .B const char * \fIcprompt
3403 is the prompt text shown within the widget.
3406 is the desired height of the box.
3407 If zero, the height is adjusted to use the available screen size.
3410 is the desired width of the box.
3411 If zero, the height is adjusted to use the available screen size.
3414 is the percentage to show in the progress bar.
3416 .\" ---------------------------------------------------------------------------
3418 .B dlg_register_buttons
3419 The widget developer should call this function after \fBdlg_register_window\fP,
3420 for the list of button labels associated with the widget.
3421 One may bind a key to a button, e.g., "OK" for \fBDLGK_OK\fP,
3425 is the window with which to associate the buttons
3427 .B const char * \fIname
3428 is the widget's binding name (usually the name of the widget).
3430 .B const char ** \fIbuttons
3431 is the list of buttons
3433 .\" ---------------------------------------------------------------------------
3435 .B dlg_register_window
3436 For a given named widget's window, associate a binding table.
3440 is the window with which to associate the buttons
3442 .B const char * \fIname
3443 is the widget's binding name (usually the name of the widget).
3445 .B DLG_KEYS_BINDING * \fIbinding
3446 is the binding table
3448 .\" ---------------------------------------------------------------------------
3450 .B dlg_remove_callback
3454 .B DIALOG_CALLBACK * \fIp
3455 contains the callback information.
3457 .\" ---------------------------------------------------------------------------
3459 .B dlg_renamed_menutext
3460 This is a utility function which supports the \fB--inputmenu\fP option of
3461 the \fB\*p\fP program.
3462 If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
3463 pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
3464 Otherwise, it passes \fBdlg_dummy_menutext\fP.
3466 The function should add "RENAMED" to \fBdialog_vars.input_result\fP ,
3467 followed by the menu item's name and the \fInewtext\fP value
3468 (with a space separating the three items),
3469 and return \fBDLG_EXIT_EXTRA\fP.
3472 .B DIALOG_LISTITEM * \fIitems
3473 is the list of menu items
3476 is the index of the currently-selected item
3478 .B char * \fInewtext
3479 is the updated text for the menu item
3481 .\" ---------------------------------------------------------------------------
3484 Restore \fB\*p\fP's variables from the given variable (see \fBdialog_save_vars\fP).
3487 .B DIALOG_VARS * \fIsave
3488 is the variable from which to restore.
3492 \fIDIALOG_VARS.input_length\fP and
3493 \fIDIALOG_VARS.input_result\fP members are treated specially,
3494 since these are used by a widget to pass data to the caller.
3495 They are not modified by this function.
3496 .\" ---------------------------------------------------------------------------
3499 Test a \fB\*p\fP internal keycode to see if it corresponds to one of the push
3500 buttons on the widget such as "OK".
3501 This is only useful if there are user-defined key bindings, since there are
3502 no built-in bindings that map directly to \fBDLGK_OK\fP, etc.
3503 Return true if a mapping was done.
3506 .B int \fIdialog_key
3507 is the \fB\*p\fP key to test
3510 is true if this is a function key
3513 store the result of the mapping in the referenced location.
3515 .\" ---------------------------------------------------------------------------
3518 Save \fB\*p\fP's variables into the given variable (see \fBdlg_restore_vars\fP).
3521 .B DIALOG_VARS * \fIsave
3522 is the variable into which to save.
3524 .\" ---------------------------------------------------------------------------
3527 Set focus on the given window,
3528 making it display above other windows on the screen.
3531 .B WINDOW * \fIparent
3532 is the parent window (usually the top-level window of a widget)
3535 is the window on which to place focus (usually a subwindow of a widget)
3537 .\" ---------------------------------------------------------------------------
3540 Setup a fixed-buffer for the result in \fBdialog_vars.input_result\fP
3543 .B const char * \fIstring
3544 is the new contents for the result
3546 .\" ---------------------------------------------------------------------------
3549 Displays the string, shifted as necessary, to fit within the box and show
3550 the current character-offset.
3554 is the window within which to display
3556 .B const char * \fIstring
3557 is the string to display
3560 is the starting (character, not bytes) offset
3563 is the window attribute to use for the string
3566 beginning row on screen
3569 beginning column on screen
3572 number of columns on screen
3575 if true, do not echo input
3578 if true, force repaint
3580 .\" ---------------------------------------------------------------------------
3583 duplicate the string, like \fBstrdup\fP.
3586 .B const char * \fIcprompt
3587 is the string to duplicate
3589 .\" ---------------------------------------------------------------------------
3592 compare two strings, ignoring case.
3595 .B const char * \fIa
3598 .B const char * \fIb
3601 .\" ---------------------------------------------------------------------------
3603 .B dlg_string_to_argv
3604 Convert a string to an argument vector
3605 returning an index (which must be freed by the caller).
3606 The string is modified (replacing gaps between tokens with nulls).
3610 is the string to convert.
3612 .\" ---------------------------------------------------------------------------
3615 create a subwindow, e.g., for an input area of a widget
3619 is the parent window
3622 is the subwindow's height
3625 is the subwindow's width
3628 is the subwindow's top-row
3631 is the subwindow's left-column
3633 .\" ---------------------------------------------------------------------------
3635 .B dlg_tab_correct_str
3636 If the \fBdialog_vars.tab_correct\fP is true, convert tabs to single spaces.
3637 Return the converted result.
3638 The caller is responsible for freeing the string.
3642 is the string to convert
3644 .\" ---------------------------------------------------------------------------
3647 If the parameter is non-null, opens a trace file with that
3648 name and stores the file pointer in \fBdialog_state.trace\fP.
3649 .\" ---------------------------------------------------------------------------
3652 If \fBdialog_state.trace\fP is set,
3653 translate the parameters into a printable representation,
3654 log it on a "chr" line.
3658 is the nominal keycode value.
3661 is nonzero if the value is really a function key.
3662 Some of these may be values declared in the DLG_KEYS_ENUM.
3664 .\" ---------------------------------------------------------------------------
3667 Write a formatted message to the trace file.
3670 .B const char * \fIfmt
3671 is the format of the \fBprintf\fP-like message to write.
3675 are the variables to apply to the \fIfmt\fP format.
3678 Use the DLG_TRACE macro for portability, in case the trace
3679 feature is not compiled into the library.
3680 It uses an extra level of parentheses to work with a variable number of
3684 DLG_TRACE(("this is dialog version %s\en", dialog_version()));
3686 .\" ---------------------------------------------------------------------------
3689 If \fBdialog_state.trace\fP is set,
3690 log a printable picture of the given window.
3691 .\" ---------------------------------------------------------------------------
3694 This is an alternate interface to 'treeview' which allows the application
3695 to read the list item states back directly without putting them in the
3699 .B const char * \fItitle
3700 is the title on the top of the widget.
3702 .B const char * \fIcprompt
3703 is the prompt text shown within the widget.
3706 is the desired height of the box.
3707 If zero, the height is based on the screen size.
3710 is the desired width of the box.
3711 If zero, the height is based on the screen size.
3713 .B int \fIlist_height
3714 is the minimum height to reserve for displaying the list.
3715 If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
3718 is the number of rows in \fIitems\fP.
3720 .B DIALOG_LISTITEM * \fIitems
3721 is the list of items, contain tag, name, and optionally help strings
3722 (if \fBdialog_vars.item_help\fP is set).
3723 The initial selection state for each item is also in this list.
3725 .B const char * \fIstates
3726 This is a list of characters to display for the given states.
3727 Normally a buildlist provides true (1) and false (0) values,
3728 which the widget displays as "*" and space, respectively.
3729 An application may set this parameter to an arbitrary null-terminated string.
3730 The widget determines the number of states from the length of this string,
3731 and will cycle through the corresponding display characters as the user
3732 presses the space-bar.
3735 This is a list of depths of each item in the tree.
3736 It is a separate parameter from \fIitems\fP to allow reuse of
3737 the existing functions.
3740 is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
3741 or \fIFLAG_RADIO\fP for radiolists (a single selection).
3743 .B int * \fIcurrent_item
3744 The widget sets the referenced location to the index of the current display
3745 item (cursor) when it returns.
3747 .\" ---------------------------------------------------------------------------
3750 The \fBdialog\fP program uses this in each widget to adjust the
3752 which may contain the newline character (referred to as '\en')
3753 and/or the special substring "\en"
3754 (which can be translated into a newline character).
3756 There are several optional features:
3759 Unless \fBdialog_vars.no_nl_expand\fP is set,
3762 If it has "\en" substrings,
3763 the function preserves extra spaces.
3764 For instance, spaces following a newline (substring or character)
3765 are preserved to use as an indentation.
3767 The function changes embedded "\en" substrings to '\en' characters.
3770 If \fBdialog_vars.no_nl_expand\fP is not set,
3771 or if there are no "\en" substrings,
3772 this function strips all extra spaces to simplify justification.
3774 If \fBdialog_vars.cr_wrap\fP is set,
3775 the function preserves '\en' newline characters.
3776 Otherwise, each '\en' newline character is converted to a space.
3778 Unless \fBdialog_vars.nocollapse\fP is set,
3779 each tab character is converted to a space,
3780 and sequences of blanks (space or tab) are reduced to a single space.
3785 is the string to trim
3787 .\" ---------------------------------------------------------------------------
3789 .B dlg_unregister_window
3790 Remove the bindings for a given window.
3794 is the window from which to remove bindings
3796 .\" ---------------------------------------------------------------------------
3799 Update a gauge widget to show a different percentage value.
3803 points to the gauge object to update.
3806 is the new percentage value to display.
3808 .\" ---------------------------------------------------------------------------
3810 .B dlg_yes_buttoncode
3811 Map the given button index for \fBdlg_yes_labels\fP into \fB\*p\fP's exit-code.
3817 .\" ---------------------------------------------------------------------------
3820 Return a list of buttons for Yes/No labels.
3822 .\" ************************************************************************
3826 .\" ************************************************************************