2 * \brief Header: quick dialog engine
8 #include "lib/tty/mouse.h"
10 /*** typedefs(not structures) and defined constants **********************************************/
12 #define QUICK2_CHECKBOX(txt, st, id_) \
14 .widget_type = quick2_checkbox, \
25 #define QUICK2_BUTTON(txt, act, cb, id_) \
27 .widget_type = quick2_button, \
39 #define QUICK2_INPUT(txt, flags_, hname, res, id_) \
41 .widget_type = quick2_input, \
47 .label_location = input_label_none, \
57 #define QUICK2_LABELED_INPUT(label_, label_loc, txt, flags_, hname, res, id_) \
59 .widget_type = quick2_input, \
64 .label_text = label_, \
65 .label_location = label_loc, \
75 #define QUICK2_LABEL(txt, id_) \
77 .widget_type = quick2_label, \
88 #define QUICK2_RADIO(cnt, items_, val, id_) \
90 .widget_type = quick2_radio, \
102 #define QUICK2_START_GROUPBOX(t) \
104 .widget_type = quick2_start_groupbox, \
114 #define QUICK2_STOP_GROUPBOX \
116 .widget_type = quick2_stop_groupbox, \
129 #define QUICK2_SEPARATOR(line_) \
131 .widget_type = quick2_separator, \
142 #define QUICK2_START_COLUMNS \
144 .widget_type = quick2_start_columns, \
157 #define QUICK2_NEXT_COLUMN \
159 .widget_type = quick2_next_column, \
172 #define QUICK2_STOP_COLUMNS \
174 .widget_type = quick2_stop_columns, \
187 #define QUICK2_START_BUTTONS(space_, line_) \
189 .widget_type = quick2_buttons, \
202 .widget_type = quick2_end, \
215 /*** enums ***************************************************************************************/
226 quick2_start_groupbox
= 6,
227 quick2_stop_groupbox
= 7,
228 quick2_separator
= 8,
229 quick2_start_columns
= 9,
230 quick2_next_column
= 10,
231 quick2_stop_columns
= 11,
237 input_label_none
= 0,
238 input_label_above
= 1,
239 input_label_left
= 2,
240 input_label_right
= 3,
241 input_label_below
= 4
242 } quick_input_label_location_t
;
244 /*** structures declarations (and typedefs of structures)*****************************************/
246 /* The widget is placed on relative_?/divisions_? of the parent widget */
247 typedef struct quick_widget_t quick_widget_t
;
249 struct quick_widget_t
251 quick2_t widget_type
;
253 widget_options_t options
;
256 /* widget parameters */
262 int *state
; /* in/out */
274 const char *label_text
;
275 quick_input_label_location_t label_location
;
276 quick_widget_t
*label
;
278 int flags
; /* 1 -- is_password, 2 -- INPUT_COMPLETE_CD */
279 const char *histname
;
281 gboolean strip_password
;
287 quick_widget_t
*input
;
294 int *value
; /* in/out */
312 int y
, x
; /* if -1, then center the dialog */
313 int cols
; /* heigth is calculated automatically */
316 quick_widget_t
*widgets
;
321 /*** global variables defined in .c file *********************************************************/
323 /*** declarations of public functions ************************************************************/
325 int quick2_dialog_skip (quick_dialog_t
* quick_dlg
, int nskip
);
327 /*** inline functions ****************************************************************************/
330 quick2_dialog (quick_dialog_t
* quick_dlg
)
332 return quick2_dialog_skip (quick_dlg
, 1);
335 #endif /* MC__QUICK2_H */