home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / mc454src.zip / mc-4.5.4.src / mc-4.5.4 / src / wtools.h < prev    next >
C/C++ Source or Header  |  1999-01-04  |  3KB  |  90 lines

  1. #ifndef __WTOOLS_H
  2. #define __WTOOLS_H
  3.  
  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);
  7.  
  8. /* For common dialogs, just repaint background */
  9. int  common_dialog_callback (struct Dlg_head *h, int id, int msg);
  10.  
  11. /* Listbox utility functions */
  12. typedef struct {
  13.     Dlg_head *dlg;
  14.     WListbox *list;
  15. } Listbox;
  16.  
  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);
  20.  
  21. int run_listbox (Listbox *l);
  22.  
  23. /* Quick Widgets */
  24. enum {
  25.     quick_end, quick_checkbox, 
  26.     quick_button, quick_input,
  27.     quick_label, quick_radio
  28. } /* quick_t */;
  29.  
  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 */
  34.  
  35. typedef struct {
  36.     int widget_type;
  37.     int relative_x;
  38.     int x_divisions;
  39.     int relative_y;
  40.     int y_divisions;
  41.  
  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.     WLay layout;        /* XView Layouting stuff */
  48.     char *tkname;        /* Name of the widget used for Tk only */
  49.     void *the_widget;        /* For the quick quick dialog manager */
  50. } QuickWidget;
  51.     
  52. typedef struct {
  53.     int  xlen, ylen;
  54.     int  xpos, ypos; /* if -1, then center the dialog */
  55.     char *title;
  56.     char *help;
  57.     char *class;        /* Used for Tk's class name */
  58.     QuickWidget *widgets;
  59.     int  i18n;            /* If true, internationalization has happened */
  60. } QuickDialog;
  61.  
  62. int quick_dialog (QuickDialog *qd);
  63. int quick_dialog_skip (QuickDialog *qd, int nskip);
  64.  
  65. /* Choosers */
  66.  
  67. #define CHOOSE_EDITABLE  1
  68. #define CHOOSE_BROWSE    0
  69.  
  70. /* Chooser dialog boxes */
  71. typedef struct {
  72.     Dlg_head *dialog;
  73.     WListbox *listbox;
  74. } Chooser;
  75.  
  76. Chooser *new_chooser (int lines, int cols, char *help, int flags);
  77. int run_chooser (Chooser *c);
  78. void destroy_chooser (Chooser *c);
  79.  
  80. /* The input dialogs */
  81. char *input_dialog (char *header, char *text, char *def_text);
  82. int input_dialog_2 (char *header, char *text1, char *text2, char **r1, char **r2);
  83. char *input_dialog_help (char *header, char *text, char *help, char *def_text);
  84. char *input_expand_dialog (char *header, char *text, char *def_text);
  85. char *real_input_dialog (char *header, char *text, char *def_text);
  86. char *real_input_dialog_help (char *header, char *text, char *help, char *def_text);
  87.  
  88. void query_set_sel (int new_sel);
  89. #endif    /* __WTOOLS_H */
  90.