3 * \brief Header: widget based utility functions
13 struct WListbox
*list
;
16 /* Listbox utility functions */
17 Listbox
*create_listbox_window_delta (int delta_x
, int delta_y
, int cols
, int lines
, const char *title
, const char *help
);
19 Listbox
*create_listbox_window (int cols
, int lines
, const char *title
, const char *help
);
20 #define LISTBOX_APPEND_TEXT(l,h,t,d) \
21 listbox_add_item (l->list, LISTBOX_APPEND_AT_END, h, t, d)
23 int run_listbox (Listbox
*l
);
27 quick_end
, quick_checkbox
,
28 quick_button
, quick_input
,
29 quick_label
, quick_radio
32 /* The widget is placed on relative_?/divisions_? of the parent widget */
41 const char *text
; /* Text */
42 int hotkey_pos
; /* the hotkey position */
43 int value
; /* Buttons only: value of button */
44 int *result
; /* Checkbutton: where to store result */
45 char **str_result
; /* Input lines: destination */
46 const char *histname
; /* Name of the section for saving history */
47 bcback cb
; /* Callback for quick_button */
51 #define NULL_QuickWidget { 0, 0, 0, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL }
55 int xpos
, ypos
; /* if -1, then center the dialog */
59 int i18n
; /* If true, internationalization has happened */
62 int quick_dialog (QuickDialog
*qd
);
63 int quick_dialog_skip (QuickDialog
*qd
, int nskip
);
65 /* The input dialogs */
67 /* Pass this as def_text to request a password */
68 #define INPUT_PASSWORD ((char *) -1)
70 char *input_dialog (const char *header
, const char *text
,
71 const char *history_name
, const char *def_text
);
72 char *input_dialog_help (const char *header
, const char *text
, const char *help
,
73 const char *history_name
, const char *def_text
);
74 char *input_expand_dialog (const char *header
, const char *text
,
75 const char *history_name
, const char *def_text
);
77 void query_set_sel (int new_sel
);
79 /* Create message box but don't dismiss it yet, not background safe */
80 struct Dlg_head
*create_message (int flags
, const char *title
,
81 const char *text
, ...)
82 __attribute__ ((format (__printf__
, 3, 4)));
84 /* Show message box, background safe */
85 void message (int flags
, const char *title
, const char *text
, ...)
86 __attribute__ ((format (__printf__
, 3, 4)));
89 /* Use this as header for message() - it expands to "Error" */
90 #define MSG_ERROR ((char *) -1)
92 int query_dialog (const char *header
, const char *text
, int flags
, int count
, ...);
94 /* flags for message() and query_dialog() */
98 } /* dialog options */;