home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 073.lha / FileIO / opendata.c < prev    next >
C/C++ Source or Header  |  1987-06-02  |  17KB  |  813 lines

  1.  
  2. /* *** opendata.c ***********************************************************
  3.  *
  4.  * File IO Suite  --  Open Requester Data
  5.  *     from Book 1 of the Amiga Programmers' Suite by RJ Mical
  6.  *
  7.  * Copyright (C) 1986, 1987, Robert J. Mical
  8.  * All Rights Reserved.
  9.  *
  10.  * Created for Amiga developers.
  11.  * Any or all of this code can be used in any program as long as this
  12.  * entire copyright notice is retained, ok?  Thanks.
  13.  *
  14.  * HISTORY      NAME            DESCRIPTION
  15.  * -----------  --------------  --------------------------------------------
  16.  * 12 Aug 86    RJ >:-{)*       Prepare (clean house) for release
  17.  * 3 May 86     =RJ Mical=      Fix prop gadget for both 1.1 and 1.2
  18.  * 1 Feb 86     =RJ Mical=      Created this file.
  19.  *
  20.  * *********************************************************************** */
  21.  
  22.  
  23. #define FILEIO_SOURCEFILE
  24. #include "fileio.h"
  25.  
  26.  
  27.  
  28.  
  29. struct TextAttr SafeFont =
  30.     {
  31.     (UBYTE *)"topaz.font",
  32.     TOPAZ_EIGHTY,
  33.     0,
  34.     0,
  35.     };
  36.  
  37.  
  38.  
  39. /* This is where the Select text is kept!  This array of text will be
  40.  * redrawn every time we want Intuition to redraw the lowly SelectGadget.
  41.  * The strings themselves are kept in OpenSelectBuffers where 
  42.  * the open routines make sure that the buffers are padded with
  43.  * blanks and are always null-terminated.  Ha ha!  Like madmen
  44.  * dancing, like crazy monkeys.
  45.  */
  46. UBYTE OpenSelectBuffers[NAME_ENTRY_COUNT][VISIBLE_SELECT_LENGTH];
  47. struct IntuiText OpenSelectText[NAME_ENTRY_COUNT] =
  48.     {
  49.         {
  50.         1, 0, 
  51.         JAM2,
  52.         1, 1 + (OPEN_LINEHEIGHT * 0),
  53.         &SafeFont,
  54.         &OpenSelectBuffers[0][0],
  55.         NULL,
  56.         },
  57.  
  58.         {
  59.         1, 0, 
  60.         JAM2,
  61.         1, 1 + (OPEN_LINEHEIGHT * 1),
  62.         &SafeFont,
  63.         &OpenSelectBuffers[1][0],
  64.         &OpenSelectText[0],
  65.         },
  66.  
  67.         {
  68.         1, 0, 
  69.         JAM2,
  70.         1, 1 + (OPEN_LINEHEIGHT * 2),
  71.         &SafeFont,
  72.         &OpenSelectBuffers[2][0],
  73.         &OpenSelectText[1],
  74.         },
  75.  
  76.         {
  77.         1, 0, 
  78.         JAM2,
  79.         1, 1 + (OPEN_LINEHEIGHT * 3),
  80.         &SafeFont,
  81.         &OpenSelectBuffers[3][0],
  82.         &OpenSelectText[2],
  83.         },
  84.  
  85.         {
  86.         1, 0, 
  87.         JAM2,
  88.         1, 1 + (OPEN_LINEHEIGHT * 4),
  89.         &SafeFont,
  90.         &OpenSelectBuffers[4][0],
  91.         &OpenSelectText[3],
  92.         },
  93.  
  94.         {
  95.         1, 0, 
  96.         JAM2,
  97.         1, 1 + (OPEN_LINEHEIGHT * 5),
  98.         &SafeFont,
  99.         &OpenSelectBuffers[5][0],
  100.         &OpenSelectText[4],
  101.         },
  102.  
  103.     };
  104.  
  105.  
  106.  
  107.  
  108. /* === Backdrop Gadget =================================================== */
  109. /* We shouldn't need this gadget.  It's sole purpose is to allow the user 
  110.  * to cancel the filename building operation by clicking outside any of 
  111.  * the regular requester gadgets.  Why, we may ask, don't we just make 
  112.  * the requester a NOISYREQ and detect SELECTDOWN.  Well, we tried that, 
  113.  * and either there's something wrong with our brains or 1.2 Intuition has 
  114.  * a bug that doesn't broadcast SELECTDOWN to requester listeners.  
  115.  * It broadcasts SELECTUP, MENUDOWN and MENUUP jes' fine, but no DOWN.  
  116.  * Bummer.  So anyway, now we got an imageless, highlightless gadget that 
  117.  * fills up the entire requester but, being at the back of the list, won't 
  118.  * be hit unless all other gadgets are missed.  
  119.  * Having a wonderful time, wish you were here.
  120.  */
  121. struct Gadget BackdropGadget =
  122.     {
  123.     NULL,
  124.     0, 0, 
  125.     OPEN_WIDTH, OPEN_HEIGHT, 
  126.     GADGHNONE,              /* Flags */
  127.     GADGIMMEDIATE,          /* Activation */
  128.     REQGADGET | BOOLGADGET, /* Type */
  129.     NULL,                   /* GadgetRender */
  130.     NULL,                   /* SelectRender */
  131.     NULL,
  132.     NULL, NULL, 
  133.     OPENGADGET_BACKDROP, 
  134.     NULL,
  135.     };
  136.  
  137.  
  138.  
  139. /* === OK, Cancel, and NextDisk Gadgets ================================== */
  140. SHORT BoolCluster3Pairs[] =
  141.     {
  142.     0, -3, 
  143.     55, -3,
  144.     57, -1,
  145.     57, 19,
  146.     55, 21,
  147.     -1, 21,
  148.     -3, 19,
  149.     -3, -1,
  150.     -1, -3,
  151.     };
  152.  
  153. SHORT BoolCluster2Pairs[] =
  154.     {
  155.     -2, -1,
  156.     56, -1,
  157.     56, 19,
  158.     -2, 19,
  159.     -2, -1,
  160.     };
  161.  
  162. SHORT BoolClusterPairs[] =
  163.     {
  164.     -1, -2,
  165.     55, -2,
  166.     55, 20,
  167.     -1, 20,
  168.     -1, -2,
  169.     };
  170.  
  171. struct Border BoolCluster3Border =
  172.     {
  173.     1, 1,
  174.     2, 0,
  175.     JAM1,
  176.     9,
  177.     &BoolCluster3Pairs[0],
  178.     NULL,
  179.     };
  180.  
  181. struct Border BoolCluster2Border =
  182.     {
  183.     1, 1,
  184.     1, 0,
  185.     JAM1,
  186.     5,
  187.     &BoolCluster2Pairs[0],
  188.     &BoolCluster3Border,
  189.     };
  190.  
  191. struct Border BoolClusterBorder =
  192.     {
  193.     1, 1,
  194.     1, 0,
  195.     JAM1,
  196.     5,
  197.     &BoolClusterPairs[0],
  198.     &BoolCluster2Border,
  199.     };
  200.  
  201. struct IntuiText NextDisk2Text =
  202.     {
  203.     1, 0, 
  204.     JAM2,
  205.     13, 11,
  206.     &SafeFont,
  207.     (UBYTE *)"DISK",
  208.     NULL,
  209.     };
  210.  
  211. struct IntuiText NextDiskText =
  212.     {
  213.     1, 0, 
  214.     JAM2,
  215.     13, 3,
  216.     &SafeFont,
  217.     (UBYTE *)"NEXT",
  218.     &NextDisk2Text,
  219.     };
  220.  
  221. struct IntuiText CancelText =
  222.     {
  223.     1, 0, 
  224.     JAM2,
  225.     5, 7,
  226.     &SafeFont,
  227.     (UBYTE *)"CANCEL",
  228.     NULL,
  229.     };
  230.  
  231. struct IntuiText OK2Text =
  232.     {
  233.     1, 0, 
  234.     JAM2,
  235.     17, 7,
  236.     &SafeFont,
  237.     (UBYTE *)"OK!",
  238.     NULL,
  239.     };
  240.  
  241.  
  242. struct Gadget NextDiskGadget =
  243.     {
  244.     &BackdropGadget,
  245.     197, 82 + REQTITLE_HEIGHT,
  246.     57, 21,
  247.     GADGHCOMP,  /* Flags */
  248.     RELVERIFY,      /* Activation */
  249.     REQGADGET | BOOLGADGET,     /* Type */
  250.     (APTR)&BoolClusterBorder,           /* GadgetRender */
  251.     NULL,               /* SelectRender */
  252.     &NextDiskText,
  253.     NULL, NULL, 
  254.     OPENGADGET_NEXTDISK, 
  255.     NULL,
  256.     };
  257.  
  258. struct Gadget CancelGadget =
  259.     {
  260.     &NextDiskGadget,
  261.     114, 82 + REQTITLE_HEIGHT,
  262.     57, 21,
  263.     GADGHCOMP,  /* Flags */
  264.     RELVERIFY | ENDGADGET,      /* Activation */
  265.     REQGADGET | BOOLGADGET,     /* Type */
  266.     (APTR)&BoolClusterBorder,           /* GadgetRender */
  267.     NULL,               /* SelectRender */
  268.     &CancelText,
  269.     NULL, NULL, 
  270.     OPENGADGET_CANCEL,
  271.     NULL,
  272.     };
  273.  
  274. struct Gadget OKGadget =
  275.     {
  276.     &CancelGadget,
  277.     32, 82 + REQTITLE_HEIGHT,
  278.     57, 21,
  279.     GADGHCOMP,      /* Flags */
  280.     RELVERIFY | ENDGADGET,      /* Activation */
  281.     REQGADGET | BOOLGADGET,     /* Type */
  282.     (APTR)&BoolClusterBorder, 
  283.     NULL,               /* Renders */
  284.     &OK2Text,
  285.     NULL, NULL, 
  286.     OPENGADGET_OK, 
  287.     NULL,
  288.     };
  289.  
  290.  
  291.  
  292. /* === OpenUp ============================================================= */
  293.  
  294. struct Image OpenUpImage =
  295.     {
  296.     1, -1,
  297.     15, 14,
  298.     2,
  299.     &OpenUpData[0],
  300.     0x03, 0x00,
  301.     NULL,
  302.     };
  303.  
  304. struct Gadget OpenUpGadget =
  305.     {
  306.     &OKGadget,
  307.     134, 14 + REQTITLE_HEIGHT,
  308.     15, 12,
  309.     GADGIMAGE | GADGHNONE,            /* Flags */
  310.     GADGIMMEDIATE,                    /* Activation */
  311.     REQGADGET | BOOLGADGET,          /* Type */
  312.     (APTR)&OpenUpImage, 
  313.     NULL,                              /* Renders */
  314.     NULL,
  315.     NULL, NULL, 
  316.     OPENGADGET_UPGADGET, 
  317.     NULL,
  318.     };
  319.  
  320.  
  321.  
  322. /* === OpenDown =========================================================== */
  323.  
  324. struct Image OpenDownImage =
  325.     {
  326.     1, -1,
  327.     15, 14,
  328.     2,
  329.     &OpenDownData[0],
  330.     0x03, 0x00,
  331.     NULL,
  332.     };
  333.  
  334. struct Gadget OpenDownGadget =
  335.     {
  336.     &OpenUpGadget,
  337.     134, 64 + REQTITLE_HEIGHT,
  338.     15, 12,
  339.     GADGIMAGE | GADGHNONE,            /* Flags */
  340.     GADGIMMEDIATE,                        /* Activation */
  341.     REQGADGET | BOOLGADGET,          /* Type */
  342.     (APTR)&OpenDownImage, 
  343.     NULL,                              /* Renders */
  344.     NULL,
  345.     NULL, NULL, 
  346.     OPENGADGET_DOWNGADGET, 
  347.     NULL,
  348.     };
  349.  
  350.  
  351. /* === OpenDrawerText ==================================================== */
  352.  
  353. struct StringInfo OpenDrawerTextInfo =
  354.     {
  355.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  356.     &OpenUndoBuffer[0],
  357.     0,
  358.     MAX_NAME_LENGTH,
  359.     0,
  360.     0,0,0,0,0,0,0,0,
  361.     };
  362.  
  363. struct Gadget OpenDrawerTextGadget =
  364.     {
  365.     &OpenDownGadget,
  366.     157, 41 + REQTITLE_HEIGHT,
  367.     122, 10,
  368.     GADGHCOMP | SELECTED,              /* Flags */
  369.     RELVERIFY | STRINGCENTER,              /* Activation */
  370.     REQGADGET | STRGADGET,            /* Type */
  371.     NULL, NULL,                      /* Renders */
  372.     NULL,
  373.     NULL,
  374.     (APTR)&OpenDrawerTextInfo,
  375.     OPENGADGET_DRAWERTEXT,
  376.     NULL,
  377.     };
  378.  
  379.  
  380. /* === OpenDiskText ====================================================== */
  381.  
  382. struct StringInfo OpenDiskTextInfo =
  383.     {
  384.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  385.     &OpenUndoBuffer[0],
  386.     0,
  387.     MAX_NAME_LENGTH,
  388.     0,
  389.     0,0,0,0,0,0,0,0,
  390.     };
  391.  
  392. struct Gadget OpenDiskTextGadget =
  393.     {
  394.     &OpenDrawerTextGadget,
  395.     157, 65 + REQTITLE_HEIGHT,
  396.     122, 10,
  397.     GADGHCOMP | SELECTED,              /* Flags */
  398.     RELVERIFY | STRINGCENTER,              /* Activation */
  399.     REQGADGET | STRGADGET,            /* Type */
  400.     NULL, NULL,                      /* Renders */
  401.     NULL,
  402.     NULL,
  403.     (APTR)&OpenDiskTextInfo,
  404.     OPENGADGET_DISKTEXT,
  405.     NULL,
  406.     };
  407.  
  408.  
  409.  
  410. /* === OpenNameText ====================================================== */
  411.  
  412. struct StringInfo OpenNameTextInfo =
  413.     {
  414.     NULL, /* Must be supplied from the appropriate FileIOSupport structure */
  415.     &OpenUndoBuffer[0],
  416.     0,
  417.     MAX_NAME_LENGTH,
  418.     0,
  419.     0,0,0,0,0,0,0,0,
  420.     };
  421.  
  422. struct Gadget OpenNameTextGadget =
  423.     {
  424.     &OpenDiskTextGadget,
  425.     157, 16 + REQTITLE_HEIGHT,
  426.     122, 10,
  427.     GADGHCOMP | SELECTED,              /* Flags */
  428.     RELVERIFY | ENDGADGET | STRINGCENTER,              /* Activation */
  429.     REQGADGET | STRGADGET,            /* Type */
  430.     NULL, NULL,                      /* Renders */
  431.     NULL,
  432.     NULL,
  433.     (APTR)&OpenNameTextInfo,
  434.     OPENGADGET_NAMETEXT,
  435.     NULL,
  436.     };
  437.  
  438.  
  439. /* === OpenProp =========================================================== */
  440. /* OpenPropData[] is in chipdata.c */
  441.  
  442. struct Image OpenPropImage =
  443.     {
  444.     1, 0,
  445.     11, 8,
  446.     2,
  447.     &OpenPropData[0],
  448.     0x03, 0x00,
  449.     NULL,
  450.     };
  451.  
  452. struct PropInfo OpenPropInfo =
  453.     {
  454.     FREEVERT | PROPBORDERLESS,
  455.     0, 0,  /* Pots should be reinitialized on the fly */
  456.     0, 0,  /* Bodies should be reinitialized on the fly */
  457.     0, 0, 0, 0, 0, 0,
  458.     };
  459.  
  460. struct Gadget OpenPropGadget =
  461.     {
  462.     &OpenNameTextGadget,
  463.     136, 30 + REQTITLE_HEIGHT,  /* Left, Top */
  464.     13, 30,     /* Width, Height */
  465.     GADGIMAGE | GADGHNONE,       /* Flags */
  466.     GADGIMMEDIATE | RELVERIFY | FOLLOWMOUSE,  /* Activation */
  467.     REQGADGET | PROPGADGET,             /* Type */
  468.     (APTR)&OpenPropImage, 
  469.     NULL,                         /* Renders */
  470.     NULL,
  471.     NULL, 
  472.     (APTR)&OpenPropInfo, 
  473.     OPENGADGET_PROPGADGET, 
  474.     NULL,
  475.     };
  476.  
  477.  
  478.  
  479.  
  480.  
  481. /* === OpenSelectName ==================================================== */
  482.  
  483. struct Gadget OpenSelectNameGadget =
  484.     {
  485.     &OpenPropGadget,
  486.     OPENSELECT_LEFT, OPENSELECT_TOP,        /* Left, Top */
  487.     OPENSELECT_WIDTH, OPENSELECT_HEIGHT,    /* Width, Height */
  488.     GADGHNONE,                              /* Flags */
  489.     GADGIMMEDIATE,                          /* Activation */
  490.     REQGADGET | BOOLGADGET,                 /* Type */
  491.     NULL, NULL,                             /* Renders */
  492.     NULL,                                   /* Text */
  493.     NULL, NULL, 
  494.     OPENGADGET_SELECTNAME,
  495.     NULL,
  496.     };
  497.  
  498.  
  499.  
  500. /* === Requester Details ================================================= */
  501. /* This data is used to render the requester more prettily. */
  502.  
  503. /* === Line Pairs === */
  504. SHORT Req3BorderData[] =
  505.     {
  506.       1, 0,
  507.     OPEN_WIDTH - 2, 0,
  508.     OPEN_WIDTH - 2, 1,
  509.     OPEN_WIDTH - 1, 1,
  510.     OPEN_WIDTH - 1, 108 + REQTITLE_HEIGHT,
  511.     OPEN_WIDTH - 2, 108 + REQTITLE_HEIGHT,
  512.     OPEN_WIDTH - 2, 109 + REQTITLE_HEIGHT,
  513.       1, 109 + REQTITLE_HEIGHT,
  514.       1, 108 + REQTITLE_HEIGHT,
  515.       0, 108 + REQTITLE_HEIGHT,
  516.       0, 1,
  517.       1, 1,
  518.       1, 0,
  519.     };
  520.  
  521. SHORT Req2BorderData[] =
  522.     {
  523.       1 + 1, 0 + 1,
  524.     OPEN_WIDTH - 2 - 1, 0 + 1,
  525.     OPEN_WIDTH - 2 - 1, 1 + 1,
  526.     OPEN_WIDTH - 1 - 1, 1 + 1,
  527.     OPEN_WIDTH - 1 - 1, 108 - 1 + REQTITLE_HEIGHT,
  528.     OPEN_WIDTH - 2 - 1, 108 - 1 + REQTITLE_HEIGHT,
  529.     OPEN_WIDTH - 2 - 1, 109 - 1 + REQTITLE_HEIGHT,
  530.       1 + 1, 109 - 1 + REQTITLE_HEIGHT,
  531.       1 + 1, 108 - 1 + REQTITLE_HEIGHT,
  532.       0 + 1, 108 - 1 + REQTITLE_HEIGHT,
  533.       0 + 1, 1 + 1,
  534.       1 + 1, 1 + 1,
  535.       1 + 1, 0 + 1,
  536.     };
  537.  
  538. SHORT ReqBorderData[] =
  539.     {
  540.       1 + 2, 0 + 2,
  541.     OPEN_WIDTH - 2 - 2, 0 + 2,
  542.     OPEN_WIDTH - 2 - 2, 1 + 2,
  543.     OPEN_WIDTH - 1 - 2, 1 + 2,
  544.     OPEN_WIDTH - 1 - 2, 108 - 2 + REQTITLE_HEIGHT,
  545.     OPEN_WIDTH - 2 - 2, 108 - 2 + REQTITLE_HEIGHT,
  546.     OPEN_WIDTH - 2 - 2, 109 - 2 + REQTITLE_HEIGHT,
  547.       1 + 2, 109 - 2 + REQTITLE_HEIGHT,
  548.       1 + 2, 108 - 2 + REQTITLE_HEIGHT,
  549.       0 + 2, 108 - 2 + REQTITLE_HEIGHT,
  550.       0 + 2, 1 + 2,
  551.       1 + 2, 1 + 2,
  552.       1 + 2, 0 + 2,
  553.     };
  554.  
  555. SHORT SelectBorderData[] =
  556.     {
  557.     8,   14 + REQTITLE_HEIGHT,
  558.     129, 14 + REQTITLE_HEIGHT,
  559.     130, 15 + REQTITLE_HEIGHT,
  560.     130, 74 + REQTITLE_HEIGHT,
  561.     129, 75 + REQTITLE_HEIGHT,
  562.     8,   75 + REQTITLE_HEIGHT,
  563.     7,   74 + REQTITLE_HEIGHT,
  564.     7,   15 + REQTITLE_HEIGHT,
  565.     8,   14 + REQTITLE_HEIGHT,
  566.     };
  567.  
  568. SHORT TextBorderData[] =
  569.     {
  570.     -1,  -2,
  571.     120, -2,
  572.     121, -1,
  573.     121, 8,
  574.     120, 9,
  575.     -1,  9,
  576.     -2,  8,
  577.     -2,  -1,
  578.     -1,  -2,
  579.     };
  580.  
  581. SHORT PropBorderData[] =
  582.     {
  583.     0,  -3,
  584.     16, -3,
  585.     16, 32,
  586.     0,  32,
  587.     0,  -2,
  588.     15, -2,
  589.     15, -1,
  590.     17, -1,
  591.     17, 30,
  592.     15, 30,
  593.     15, 31,
  594.     1,  31,
  595.     1,  30,
  596.     -1, 30,
  597.     -1, -1,
  598.     -1, 1,
  599.     };
  600.  
  601.  
  602. /* === Borders === */
  603. struct Border Req3Border =
  604.     {
  605.     0, 0,
  606.     1, 0,
  607.     JAM1,
  608.     13,
  609.     &Req3BorderData[0],
  610.     NULL,
  611.     };
  612.  
  613. struct Border Req2Border =
  614.     {
  615.     0, 0,
  616.     2, 0,
  617.     JAM1,
  618.     13,
  619.     &Req2BorderData[0],
  620.     &Req3Border,
  621.     };
  622.  
  623. struct Border ReqBorder =
  624.     {
  625.     0, 0,
  626.     1, 0,
  627.     JAM1,
  628.     13,
  629.     &ReqBorderData[0],
  630.     &Req2Border,
  631.     };
  632.  
  633. struct Border SelectBorder =
  634.     {
  635.     0, 0,
  636.     1, 0,
  637.     JAM1,
  638.     9,
  639.     &SelectBorderData[0],
  640.     &ReqBorder,
  641.     };
  642.  
  643. struct Border Text3Border =
  644.     {
  645.     157, 65 + REQTITLE_HEIGHT,
  646.     1, 0,
  647.     JAM1,
  648.     9,
  649.     &TextBorderData[0],
  650.     &SelectBorder,
  651.     };
  652.  
  653. struct Border Text2Border =
  654.     {
  655.     157, 41 + REQTITLE_HEIGHT,
  656.     1, 0,
  657.     JAM1,
  658.     9,
  659.     &TextBorderData[0],
  660.     &Text3Border,
  661.     };
  662.  
  663. struct Border TextBorder =
  664.     {
  665.     157, 16 + REQTITLE_HEIGHT,
  666.     1, 0,
  667.     JAM1,
  668.     9,
  669.     &TextBorderData[0],
  670.     &Text2Border,
  671.     };
  672.  
  673. struct Border PropBorder =
  674.     {
  675.     134, 30 + REQTITLE_HEIGHT,
  676.     1, 0,
  677.     JAM1,
  678.     16,
  679.     &PropBorderData[0],
  680.     &TextBorder,
  681.     };
  682.  
  683. /* === RJ wants to know:  Some Requester Text For You? === */
  684. UBYTE *DefaultReqTitle = (UBYTE *)"File IO Requester";
  685. struct IntuiText ReqTitleText =
  686.     {
  687.     1, 0, 
  688.     JAM2,
  689.     0, 5,       /* The x-coordinate is initialized to center the title */
  690.     &SafeFont,
  691.     NULL,       /* Points to the title supplied in the FileIOSupport */
  692.     NULL,
  693.     };
  694.  
  695. struct IntuiText SelectText =
  696.     {
  697.     1, 0, 
  698.     JAM2,
  699.     18, 6 + REQTITLE_HEIGHT,
  700.     &SafeFont,
  701.     (UBYTE *)"Select a Name",
  702.     &ReqTitleText,
  703.     };
  704.  
  705. struct IntuiText Type3Text =
  706.     {
  707.     1, 0, 
  708.     JAM2,
  709.     201, 55 + REQTITLE_HEIGHT,
  710.     &SafeFont,
  711.     (UBYTE *)"Disk",
  712.     &SelectText,
  713.     };
  714.  
  715. struct IntuiText Type2Text =
  716.     {
  717.     1, 0, 
  718.     JAM2,
  719.     193, 31 + REQTITLE_HEIGHT,
  720.     &SafeFont,
  721.     (UBYTE *)"Drawer",
  722.     &Type3Text,
  723.     };
  724.  
  725. struct IntuiText TypeText =
  726.     {
  727.     1, 0, 
  728.     JAM2,
  729.     161, 6 + REQTITLE_HEIGHT,
  730.     &SafeFont,
  731.     (UBYTE *)"Or Type a Name",
  732.     &Type2Text,
  733.     };
  734.  
  735.  
  736.  
  737. /* === Main Data ======================================================== */
  738. struct ReqSupport OpenReqSupport = 
  739.     {
  740.  
  741.     /* struct Requester Requester; */
  742.         {
  743.         /*  struct Requester *OlderRequest;*/
  744.         NULL,
  745.  
  746.         /*  SHORT LeftEdge, TopEdge;*/
  747.         OPEN_LEFT, OPEN_TOP,
  748.  
  749.         /*  SHORT Width, Height;*/
  750.         OPEN_WIDTH, OPEN_HEIGHT, 
  751.  
  752.         /*  SHORT RelLeft, RelTop;*/
  753.         0, 0,
  754.  
  755.         /*  struct Gadget *ReqGadget;*/
  756.         &OpenSelectNameGadget,
  757.     
  758.         /*  struct Border *ReqBorder;*/
  759.         &PropBorder,
  760.     
  761.         /*  struct IntuiText *ReqText;*/
  762.         &TypeText,
  763.     
  764.         /*  USHORT Flags;*/
  765.         NOISYREQ,
  766.  
  767.         /*  UBYTE BackFill;*/
  768.         0,
  769.  
  770.         /*  struct ClipRect ReqCRect;*/
  771.         { NULL },
  772.  
  773.         /*  struct BitMap *ImageBMap;*/
  774.         NULL,
  775.  
  776.         /*  struct BitMap ReqBMap;*/
  777.         { NULL },
  778.  
  779.         },  /* end of Requester structure */
  780.  
  781.     /* struct Window *Window; */
  782.     NULL,
  783.  
  784.     /* LONG (*StartRequest)(); */
  785.     NULL,
  786.  
  787.     /* LONG (*ReqHandler)(); */
  788.     NULL,
  789.  
  790.     /* LONG (*NewDiskHandler)(); */
  791.     NULL,
  792.  
  793.     /* LONG (*MouseMoveHandler)(); */
  794.     NULL,
  795.  
  796.     /* SHORT SelectedGadgetID; */
  797.     0,
  798. };
  799.  
  800. struct Requester *OpenReq = NULL;
  801. struct Window *OpenReqWindow = NULL;
  802. struct FileIOSupport *OpenReqFileIO = NULL;
  803. UBYTE OpenUndoBuffer[MAX_NAME_LENGTH];
  804. UBYTE OpenLockName[128] = {0};
  805.  
  806. ULONG OpenSaveLock = NULL;
  807.  
  808. UBYTE CurrentDiskString[] = ":";
  809.  
  810. LONG OpenClickSeconds;
  811. LONG OpenClickMicros;
  812.  
  813.