Corrected some in-line help strings...
[midnight-commander.git] / src / wtools.h
blob8c4c73cca8534bc8df1feaaeab8291ffff92c811
1 #ifndef __WTOOLS_H
2 #define __WTOOLS_H
4 /* Dialog default background repaint routines */
5 void dialog_repaint (struct Dlg_head *h, int back, int title_fore);
6 void common_dialog_repaint (struct Dlg_head *h);
8 /* For common dialogs, just repaint background */
9 int common_dialog_callback (struct Dlg_head *h, int id, int msg);
11 /* Listbox utility functions */
12 typedef struct {
13 Dlg_head *dlg;
14 WListbox *list;
15 } Listbox;
17 Listbox *create_listbox_window (int cols, int lines, char *title, char *help);
18 #define LISTBOX_APPEND_TEXT(l,h,t,d) \
19 listbox_add_item (l->list, 0, h, t, d);
21 int run_listbox (Listbox *l);
23 /* Quick Widgets */
24 enum {
25 quick_end, quick_checkbox,
26 quick_button, quick_input,
27 quick_label, quick_radio
28 } /* quick_t */;
30 /* The widget is placed on relative_?/divisions_? of the parent widget */
31 /* Please note that the contents of the fields in the union are just */
32 /* used for setting up the dialog. They are a convenient place to put */
33 /* the values for a widget */
35 typedef struct {
36 int widget_type;
37 int relative_x;
38 int x_divisions;
39 int relative_y;
40 int y_divisions;
42 char *text; /* Text */
43 int hotkey_pos; /* the hotkey position */
44 int value; /* Buttons only: value of button */
45 int *result; /* Checkbutton: where to store result */
46 char **str_result; /* Input lines: destination */
47 char *tkname; /* Name of the widget used for Tk only */
48 void *the_widget; /* For the quick quick dialog manager */
49 } QuickWidget;
51 typedef struct {
52 int xlen, ylen;
53 int xpos, ypos; /* if -1, then center the dialog */
54 char *title;
55 char *help;
56 char *class; /* Used for Tk's class name */
57 QuickWidget *widgets;
58 int i18n; /* If true, internationalization has happened */
59 } QuickDialog;
61 int quick_dialog (QuickDialog *qd);
62 int quick_dialog_skip (QuickDialog *qd, int nskip);
64 /* Choosers */
66 #define CHOOSE_EDITABLE 1
67 #define CHOOSE_BROWSE 0
69 /* Chooser dialog boxes */
70 typedef struct {
71 Dlg_head *dialog;
72 WListbox *listbox;
73 } Chooser;
75 Chooser *new_chooser (int lines, int cols, char *help, int flags);
76 int run_chooser (Chooser *c);
77 void destroy_chooser (Chooser *c);
79 /* The input dialogs */
80 char *input_dialog (char *header, char *text, char *def_text);
81 char *input_dialog_help (char *header, char *text, char *help, char *def_text);
82 char *input_expand_dialog (char *header, char *text, char *def_text);
83 char *real_input_dialog (char *header, char *text, char *def_text);
84 char *real_input_dialog_help (char *header, char *text, char *help, char *def_text);
86 void query_set_sel (int new_sel);
87 #endif /* __WTOOLS_H */