home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / dflt14.zip / DIALBOX.H < prev    next >
Text File  |  1992-06-26  |  2KB  |  56 lines

  1. /* ----------------- dialbox.h ---------------- */
  2.  
  3. #ifndef DIALOG_H
  4. #define DIALOG_H
  5.  
  6. #include <stdio.h>
  7.  
  8. #define MAXCONTROLS 30
  9. #define MAXRADIOS 20
  10.  
  11. #define OFF FALSE
  12. #define ON  TRUE
  13.  
  14. /* -------- dialog box and control window structure ------- */
  15. typedef struct  {
  16.     char *title;    /* window title         */
  17.     int x, y;       /* relative coordinates */
  18.     int h, w;       /* size                 */
  19. } DIALOGWINDOW;
  20.  
  21. /* ------ one of these for each control window ------- */
  22. typedef struct {
  23.     DIALOGWINDOW dwnd;
  24.     CLASS class;    /* LISTBOX, BUTTON, etc */
  25.     char *itext;    /* initialized text     */
  26.     int command;    /* command code         */
  27.     char *help;     /* help mnemonic        */
  28.     BOOL isetting;  /* initially ON or OFF  */
  29.     BOOL setting;   /* ON or OFF            */
  30.     void *wnd;      /* window handle        */
  31. } CTLWINDOW;
  32.  
  33. /* --------- one of these for each dialog box ------- */
  34. typedef struct {
  35.     char *HelpName;
  36.     DIALOGWINDOW dwnd;
  37.     CTLWINDOW ctl[MAXCONTROLS+1];
  38. } DBOX;
  39.  
  40. /* -------- macros for dialog box resource compile -------- */
  41. #define DIALOGBOX(db) DBOX db={ #db,
  42. #define DB_TITLE(ttl,x,y,h,w) {ttl,x,y,h,w},{
  43. #define CONTROL(ty,tx,x,y,h,w,c)                         \
  44.                 {{NULL,x,y,h,w},ty,                        \
  45.                 (ty==EDITBOX||ty==COMBOBOX?NULL:tx),    \
  46.                 c,#c,(ty==BUTTON?ON:OFF),OFF,NULL},
  47.  
  48. #define ENDDB {{NULL}} }};
  49.  
  50. #define Cancel  " Cancel "
  51. #define Ok      "   OK   "
  52. #define Yes     "  Yes   "
  53. #define No      "   No   "
  54.  
  55. #endif
  56.