home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 392.lha / FileLab_V0.85 / gadgets.c < prev   
Encoding:
C/C++ Source or Header  |  1990-07-03  |  4.6 KB  |  113 lines

  1. struct  IntuitionBase   *IntuitionBase; /* ptr to intuition.library */
  2. struct  GfxBase         *GfxBase;       /* ptr to graphics.library  */
  3. struct  Window *window; /* ptr to intuition window */
  4.  
  5. struct  RPort *rp;
  6.         /* ^^^ pointer to our window's rastport (output structure) */
  7.  
  8. static char inputbuffer[80], outputbuffer[80], undobuffer[80];
  9.         /* ^^^ three 80-char buffers for string gadgets */
  10.  
  11.     /* border data */
  12. static SHORT borderpairs[] = { 0, 0, 259, 0, 259, 11, 0, 11, 0, 0 };
  13. static SHORT gadgetpairs[] = { 0, 0, 99, 0, 99, 17, 0, 17, 0, 0 };
  14. static SHORT togglepairs[] = { 0, 0, 91, 0, 91, 14, 0, 14, 0, 0 };
  15.  
  16.     /* IntuiText structures */
  17. static struct IntuiText inputtext = { 1, 0, JAM1, -96, 0, NULL, (UBYTE *) "Input file:", NULL };
  18. static struct IntuiText outputtext = { 1, 0, JAM1, -104, 0, NULL, (UBYTE *) "Output file:", NULL };
  19. static struct IntuiText starttext = { 1, 0, JAM1, 24, 4, NULL, (UBYTE *) "START", NULL };
  20. static struct IntuiText stoptext = { 1, 0, JAM1, 24, 4, NULL, (UBYTE *) "STOP", NULL };
  21. static struct IntuiText formattext = { 1, 0, JAM1, 20, 1, NULL, (UBYTE *) "FORMAT", NULL };
  22. static struct IntuiText indenttext = { 1, 0, JAM1, 4, 1, NULL, (UBYTE *) "AUTOINDENT", NULL };
  23. static struct IntuiText cleartext = { 1, 0, JAM1, 20, 1, NULL, (UBYTE *) "CTRL-L", NULL };
  24.  
  25.     /* border structures, after border data to set addresses */
  26. static struct Border stringborder = { -2, -2, 1, 0, JAM1, 5, &borderpairs, NULL };
  27. static struct Border shadowborder = { -1, -1, 2, 0, JAM1, 5, &borderpairs, &stringborder };
  28. static struct Border gadgetborder = { -2, -2, 1, 0, JAM1, 5, &gadgetpairs, NULL };
  29. static struct Border gadgetshadow = { -1, -1, 2, 0, JAM1, 5, &gadgetpairs, &gadgetborder };
  30. static struct Border toggleborder = { -2, -2, 1, 0, JAM1, 5, &togglepairs, NULL };
  31. static struct Border toggleshadow = { -1, -1, 2, 0, JAM1, 5, &togglepairs, &toggleborder };
  32.  
  33.     /* extra gadget info; for string gadgets */
  34. static struct StringInfo inputinfo = { inputbuffer, undobuffer, NULL, 79, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
  35. static struct StringInfo outputinfo = { outputbuffer, undobuffer, NULL, 79, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
  36.  
  37.     /* gadget definitions */
  38. static struct Gadget fileinputgadget =
  39.     {
  40.     NULL,
  41.     128, 16, 256, 8, /* LeftEdge, TopEdge, Width, Height, */
  42.     GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
  43.     STRGADGET, &shadowborder, NULL, &inputtext, NULL, &inputinfo, 1, NULL
  44.     };
  45.  
  46. static struct Gadget fileoutputgadget =
  47.     {
  48.     &fileinputgadget,
  49.     128, 31, 256, 8, /* LeftEdge, TopEdge, Width, Height, */
  50.     GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
  51.     STRGADGET, &shadowborder, NULL, &outputtext, NULL, &outputinfo, 2, NULL
  52.     };
  53.  
  54. static struct Gadget startgadget =
  55.     {
  56.     &fileoutputgadget,
  57.     64, 52, 96, 15, /* LeftEdge, TopEdge, Width, Height, */
  58.     GADGHCOMP, RELVERIFY,  /* Flags, Activation, */
  59.     BOOLGADGET, &gadgetshadow, NULL, &starttext, NULL, NULL, 3, NULL
  60.     };
  61.  
  62. static struct Gadget stopgadget =
  63.     {
  64.     &startgadget,
  65.     240, 52, 96, 15, /* LeftEdge, TopEdge, Width, Height, */
  66.     GADGHCOMP | GADGDISABLED, RELVERIFY,  /* Flags, Activation, */
  67.     BOOLGADGET, &gadgetshadow, NULL, &stoptext, NULL, NULL, 4, NULL
  68.     };
  69.  
  70. static struct Gadget formatgadget =
  71.     {
  72.     &stopgadget,
  73.     424, 19, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
  74.     GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT,  /* Flags, Activation, */
  75.     BOOLGADGET, &toggleshadow, NULL, &formattext, NULL, NULL, 5, NULL
  76.     };
  77.  
  78. static struct Gadget indentgadget =
  79.     {
  80.     &formatgadget,
  81.     424, 35, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
  82.     GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT, /* Flags, Activation, */
  83.     BOOLGADGET, &toggleshadow, NULL, &indenttext, NULL, NULL, 6, NULL
  84.     };
  85.  
  86. static struct Gadget cleargadget =
  87.     {
  88.     &indentgadget,
  89.     424, 51, 88, 11, /* LeftEdge, TopEdge, Width, Height, */
  90.     GADGHCOMP | SELECTED, RELVERIFY | TOGGLESELECT,  /* Flags, Activation, */
  91.     BOOLGADGET, &toggleshadow, NULL, &cleartext, NULL, NULL, 7, NULL
  92.     };
  93.  
  94.     /* window definition */
  95. static struct NewWindow MainWindow =
  96.     {
  97.     64, 11,         /* LeftEdge, TopEdge, */
  98.     560, 84,        /* Width, Height, */
  99.     2, 1,           /* DetailPen, BlockPen, */
  100.     REFRESHWINDOW |
  101.     GADGETUP |
  102.     CLOSEWINDOW,    /* IDCMP flags, */
  103.     WINDOWCLOSE |
  104.     WINDOWDRAG |
  105.     WINDOWDEPTH |
  106.     SIMPLE_REFRESH,  /* Flags, */
  107.     &cleargadget,    /* first gadget in list */
  108.     NULL,
  109.     (UBYTE *) "FileLab V0.85 by Chris Papademetrious",
  110.     NULL, NULL,
  111.     0, 0, 0, 0,     /* min width/height, max width/height */
  112.     WBENCHSCREEN    /* window type */
  113.     };