home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff193.lzh / KeyMapEd / Source / KME_FileReq.h < prev    next >
C/C++ Source or Header  |  1989-03-13  |  12KB  |  455 lines

  1. /*
  2.  * Key Map Editor File Requester
  3.  *
  4.  * by: Tim Friest
  5.  * on: January 5, 1989
  6.  * using: Power Windows 2.5
  7.  */
  8.  
  9. struct Image NameGadImage = {
  10.     0,0,    /* origin */
  11.     174,8,    /* width and height */
  12.     2,    /* number of bitplanes */
  13.     NULL,    /* pointer to ImageData */
  14.     0x0000,0x0000,    /* PlanePick and PlaneOnOff */
  15.     NULL    /* next Image */
  16. };
  17.  
  18. struct IntuiText Name6IText = {
  19.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  20.     1,0,    /* Left and Top Offsets */
  21.     NULL,    /* Text Attribute */
  22.     NULL,    /* text buffer */
  23.     NULL,    /* Next IntuiText */
  24. };
  25.  
  26. struct Gadget Name6Gadget = {
  27.     NULL,    /* next gadget */
  28.     26,61,    /* origin of hit box */
  29.     174,8,    /* hit box width and height */
  30.     GADGHCOMP|GADGIMAGE,    /* flags */
  31.     RELVERIFY,    /* activation flags */
  32.     BOOLGADGET|REQGADGET,    /* type flags */
  33.     (APTR)&NameGadImage,    /* render image */
  34.     NULL,    /* select image */
  35.     &Name6IText,    /* first IntuiText */
  36.     NULL,    /* mutual-exclude (unused) */
  37.     NULL,    /* SpecialInfo */
  38.     0x16,    /* GadgetID */
  39.     NULL    /* user data */
  40. };
  41.  
  42. struct IntuiText Name5IText = {
  43.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  44.     1,0,    /* Left and Top Offsets */
  45.     NULL,    /* Text Attribute */
  46.     NULL,    /* text buffer */
  47.     NULL,    /* Next IntuiText */
  48. };
  49.  
  50. struct Gadget Name5Gadget = {
  51.     &Name6Gadget,    /* next gadget */
  52.     26,52,    /* origin of hit box */
  53.     174,8,    /* hit box width and height */
  54.     GADGHCOMP|GADGIMAGE,    /* flags */
  55.     RELVERIFY,    /* activation flags */
  56.     BOOLGADGET|REQGADGET,    /* type flags */
  57.     (APTR)&NameGadImage,    /* render image */
  58.     NULL,    /* select image */
  59.     &Name5IText,    /* first IntuiText */
  60.     NULL,    /* mutual-exclude (unused) */
  61.     NULL,    /* SpecialInfo */
  62.     0x15,    /* GadgetID */
  63.     NULL    /* user data */
  64. };
  65.  
  66. struct IntuiText Name4IText = {
  67.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  68.     1,0,    /* Left and Top Offsets */
  69.     NULL,    /* Text Attribute */
  70.     NULL,    /* text buffer */
  71.     NULL,    /* Next IntuiText */
  72. };
  73.  
  74. struct Gadget Name4Gadget = {
  75.     &Name5Gadget,    /* next gadget */
  76.     26,43,    /* origin of hit box */
  77.     174,8,    /* hit box width and height */
  78.     GADGHCOMP|GADGIMAGE,    /* flags */
  79.     RELVERIFY,    /* activation flags */
  80.     BOOLGADGET|REQGADGET,    /* type flags */
  81.     (APTR)&NameGadImage,    /* render image */
  82.     NULL,    /* select image */
  83.     &Name4IText,    /* first IntuiText */
  84.     NULL,    /* mutual-exclude (unused) */
  85.     NULL,    /* SpecialInfo */
  86.     0x14,    /* GadgetID */
  87.     NULL    /* user data */
  88. };
  89.  
  90. struct IntuiText Name3IText = {
  91.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  92.     1,0,    /* Left and Top Offsets */
  93.     NULL,    /* Text Attribute */
  94.     NULL,    /* text buffer */
  95.     NULL,    /* Next IntuiText */
  96. };
  97.  
  98. struct Gadget Name3Gadget = {
  99.     &Name4Gadget,    /* next gadget */
  100.     26,34,    /* origin of hit box */
  101.     174,8,    /* hit box width and height */
  102.     GADGHCOMP|GADGIMAGE,    /* flags */
  103.     RELVERIFY,    /* activation flags */
  104.     BOOLGADGET|REQGADGET,    /* type flags */
  105.     (APTR)&NameGadImage,    /* render image */
  106.     NULL,    /* select image */
  107.     &Name3IText,    /* first IntuiText */
  108.     NULL,    /* mutual-exclude (unused) */
  109.     NULL,    /* SpecialInfo */
  110.     0x13,    /* GadgetID */
  111.     NULL    /* user data */
  112. };
  113.  
  114. struct IntuiText Name2IText = {
  115.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  116.     1,0,    /* Left and Top Offsets */
  117.     NULL,    /* Text Attribute */
  118.     NULL,    /* text buffer */
  119.     NULL,    /* Next IntuiText */
  120. };
  121.  
  122. struct Gadget Name2Gadget = {
  123.     &Name3Gadget,    /* next gadget */
  124.     26,25,    /* origin of hit box */
  125.     174,8,    /* hit box width and height */
  126.     GADGHCOMP|GADGIMAGE,    /* flags */
  127.     RELVERIFY,    /* activation flags */
  128.     BOOLGADGET|REQGADGET,    /* type flags */
  129.     (APTR)&NameGadImage,    /* render image */
  130.     NULL,    /* select image */
  131.     &Name2IText,    /* first IntuiText */
  132.     NULL,    /* mutual-exclude (unused) */
  133.     NULL,    /* SpecialInfo */
  134.     0x12,    /* GadgetID */
  135.     NULL    /* user data */
  136. };
  137.  
  138. struct IntuiText Name1IText = {
  139.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  140.     1,0,    /* Left and Top Offsets */
  141.     NULL,    /* Text Attribute */
  142.     NULL,    /* text buffer */
  143.     NULL,    /* Next IntuiText */
  144. };
  145.  
  146. struct Gadget Name1Gadget = {
  147.     &Name2Gadget,    /* next gadget */
  148.     26,16,    /* origin of hit box */
  149.     174,8,    /* hit box width and height */
  150.     GADGHCOMP|GADGIMAGE,    /* flags */
  151.     RELVERIFY,    /* activation flags */
  152.     BOOLGADGET|REQGADGET,    /* type flags */
  153.     (APTR)&NameGadImage,    /* render image */
  154.     NULL,    /* select image */
  155.     &Name1IText,    /* first IntuiText */
  156.     NULL,    /* mutual-exclude (unused) */
  157.     NULL,    /* SpecialInfo */
  158.     0x11,    /* GadgetID */
  159.     NULL    /* user data */
  160. };
  161.  
  162. struct IntuiText Name0IText = {
  163.     1,0,JAM1,    /* FrontPen, BackPen, Draw Mode */
  164.     1,0,    /* Left and Top Offsets */
  165.     NULL,    /* Text Attribute */
  166.     NULL,    /* text buffer */
  167.     NULL,    /* Next IntuiText */
  168. };
  169.  
  170. struct Gadget Name0Gadget = {
  171.     &Name1Gadget,    /* next gadget */
  172.     26,7,    /* origin of hit box */
  173.     174,8,    /* hit box width and height */
  174.     GADGHCOMP|GADGIMAGE,    /* flags */
  175.     RELVERIFY,    /* activation flags */
  176.     BOOLGADGET|REQGADGET,    /* type flags */
  177.     (APTR)&NameGadImage,    /* render image */
  178.     NULL,    /* select image */
  179.     &Name0IText,    /* first IntuiText */
  180.     NULL,    /* mutual-exclude (unused) */
  181.     NULL,    /* SpecialInfo */
  182.     0x10,    /* GadgetID */
  183.     NULL    /* user data */
  184. };
  185.  
  186. UBYTE FileNameBuff[30];
  187. UBYTE UndoBuffer[30];
  188.  
  189. struct StringInfo NameStrGadSInfo = {
  190.     FileNameBuff,    /* text buffer */
  191.     UndoBuffer,    /* undo buffer */
  192.     0,    /* character position in buffer */
  193.     30,    /* maximum number of characters to allow */
  194.     0,    /* first displayed character buffer position */
  195.     0,0,0,0,0,    /* reserved to Intuition */
  196.     0,    /* Rastport of gadget */
  197.     0,    /* initial value for integer gadgets */
  198.     NULL    /* alternate keymap */
  199. };
  200.  
  201. SHORT NameStrGadBorderVectors[] = {
  202.     0,0,
  203.     192,0,
  204.     192,10,
  205.     0,10,
  206.     0,0
  207. };
  208. struct Border NameStrGadBorder = {
  209.     -1,-1,    /* origin */
  210.     1,0,JAM1,    /* front pen, back pen and drawmode */
  211.     5,    /* number of vectors */
  212.     NameStrGadBorderVectors,    /* pointer to vectors */
  213.     NULL    /* next border */
  214. };
  215.  
  216. struct Gadget NameStrGadget = {
  217.     &Name0Gadget,    /* next gadget */
  218.     25,76,    /* origin of hit box */
  219.     191,9,    /* hit box width and height */
  220.     NULL,    /* flags */
  221.     RELVERIFY|STRINGCENTER,    /* activation flags */
  222.     STRGADGET|REQGADGET,    /* type flags */
  223.     (APTR)&NameStrGadBorder,    /* render border */
  224.     NULL,    /* select image */
  225.     NULL,    /* first IntuiText */
  226.     NULL,    /* mutual-exclude (unused) */
  227.     (APTR)&NameStrGadSInfo,    /* SpecialInfo */
  228.     0x05,    /* GadgetID */
  229.     NULL    /* user data */
  230. };
  231.  
  232. USHORT chip UpSlideGadImageData[] = {
  233.     0xFFFF,0x8000,0x8080,0x8000,0x81C0,0x8000,0x87F0,0x8000,
  234.     0x9FFC,0x8000,0xBFFE,0x8000,0x83E0,0x8000,0x83E0,0x8000,
  235.     0xFFFF,0x8000
  236. };
  237.  
  238. struct Image UpSlideGadImage = {
  239.     -1,-1,    /* origin */
  240.     17,9,    /* width and height */
  241.     2,    /* number of bitplanes */
  242.     UpSlideGadImageData,    /* pointer to ImageData */
  243.     0x0001,0x0000,    /* PlanePick and PlaneOnOff */
  244.     NULL    /* next Image */
  245. };
  246.  
  247. struct Gadget UpSlideGadget = {
  248.     &NameStrGadget,    /* next gadget */
  249.     202,4,    /* origin of hit box */
  250.     15,7,    /* hit box width and height */
  251.     GADGHCOMP|GADGIMAGE,    /* flags */
  252.     GADGIMMEDIATE|RELVERIFY,    /* activation flags */
  253.     BOOLGADGET|REQGADGET,    /* type flags */
  254.     (APTR)&UpSlideGadImage,    /* border or render image */
  255.     NULL,    /* select image */
  256.     NULL,    /* first IntuiText */
  257.     NULL,    /* mutual-exclude (unused) */
  258.     NULL,    /* SpecialInfo */
  259.     0x04,    /* GadgetID */
  260.     NULL    /* user data */
  261. };
  262.  
  263. USHORT chip DownSlideGadImageData[] = {
  264.     0xFFFF,0x8000,0x83E0,0x8000,0x83E0,0x8000,0xBFFE,0x8000,
  265.     0x9FFC,0x8000,0x87F0,0x8000,0x81C0,0x8000,0x8080,0x8000,
  266.     0xFFFF,0x8000
  267. };
  268.  
  269. struct Image DownSlideGadImage = {
  270.     -1,-1,    /* origin */
  271.     17,9,    /* width and height */
  272.     2,    /* number of bitplanes */
  273.     DownSlideGadImageData,    /* pointer to ImageData */
  274.     0x0001,0x0000,    /* PlanePick and PlaneOnOff */
  275.     NULL    /* next Image */
  276. };
  277.  
  278. struct Gadget DownSlideGadget = {
  279.     &UpSlideGadget,    /* next gadget */
  280.     202,65,    /* origin of hit box */
  281.     15,7,    /* hit box width and height */
  282.     GADGHCOMP|GADGIMAGE,    /* flags */
  283.     GADGIMMEDIATE|RELVERIFY,    /* activation flags */
  284.     BOOLGADGET|REQGADGET,    /* type flags */
  285.     (APTR)&DownSlideGadImage,    /* border or render image */
  286.     NULL,    /* select image */
  287.     NULL,    /* first IntuiText */
  288.     NULL,    /* mutual-exclude (unused) */
  289.     NULL,    /* SpecialInfo */
  290.     0x03,    /* GadgetID */
  291.     NULL    /* user data */
  292. };
  293.  
  294. struct PropInfo SliderGadPInfo = {
  295.     AUTOKNOB|FREEVERT,    /* PropInfo flags */
  296.     -1,-1,    /* horizontal and vertical pot values */
  297.     -1,-1,    /* horizontal and vertical body values */
  298. };
  299.  
  300. struct Image SliderGadImage = {
  301.     0,0,    /* origin */
  302.     9,48,    /* width and height */
  303.     0,    /* number of bitplanes */
  304.     NULL,    /* pointer to ImageData */
  305.     0x0000,0x0000,    /* PlanePick and PlaneOnOff */
  306.     NULL    /* next Image */
  307. };
  308.  
  309. struct Gadget SliderGadget = {
  310.     &DownSlideGadget,    /* next gadget */
  311.     201,12,    /* origin of hit box */
  312.     17,52,    /* hit box width and height */
  313.     GADGHCOMP,    /* flags */
  314.     RELVERIFY,    /* activation flags */
  315.     PROPGADGET|REQGADGET,    /* type flags */
  316.     (APTR)&SliderGadImage,    /* border or render image */
  317.     NULL,    /* select image */
  318.     NULL,    /* first IntuiText */
  319.     NULL,    /* mutual-exclude (unused) */
  320.     (APTR)&SliderGadPInfo,    /* SpecialInfo */
  321.     0x02,    /* GadgetID */
  322.     NULL    /* user data */
  323. };
  324.  
  325. SHORT CancelGadBorderVectors[] = {
  326.     0,0,
  327.     59,0,
  328.     59,12,
  329.     0,12,
  330.     0,0
  331. };
  332. struct Border CancelGadBorder = {
  333.     -1,-1,    /* origin */
  334.     1,0,JAM1,    /* front pen, back pen and drawmode */
  335.     5,    /* number of vectors */
  336.     CancelGadBorderVectors,    /* pointer to vectors */
  337.     NULL    /* next border */
  338. };
  339.  
  340. struct IntuiText CancelGadIText = {
  341.     3,0,JAM2,    /* front and back text pens, drawmode and fill byte */
  342.     6,2,    /* origin */
  343.     NULL,    /* font pointer or NULL for default */
  344.     "Cancel",    /* pointer to text */
  345.     NULL    /* next IntuiText */
  346. };
  347.  
  348. struct Gadget CancelGadget = {
  349.     &SliderGadget,    /* next gadget */
  350.     141,89,    /* origin of hit box */
  351.     58,11,    /* hit box width and height */
  352.     GADGHCOMP,    /* flags */
  353.     RELVERIFY,    /* activation flags */
  354.     BOOLGADGET|REQGADGET,    /* type flags */
  355.     (APTR)&CancelGadBorder,    /* border or render image */
  356.     NULL,    /* select image */
  357.     &CancelGadIText,    /* first IntuiText */
  358.     NULL,    /* mutual-exclude (unused) */
  359.     NULL,    /* SpecialInfo */
  360.     0x00,    /* GadgetID */
  361.     NULL    /* user data */
  362. };
  363.  
  364. SHORT ContinueGadBorderVectors[] = {
  365.     0,0,
  366.     57,0,
  367.     57,12,
  368.     0,12,
  369.     0,0
  370. };
  371. struct Border ContinueGadBorder = {
  372.     -1,-1,    /* origin */
  373.     1,0,JAM1,    /* front pen, back pen and drawmode */
  374.     5,    /* number of vectors */
  375.     ContinueGadBorderVectors,    /* pointer to vectors */
  376.     NULL    /* next border */
  377. };
  378.  
  379. struct IntuiText ContinueGadIText = {
  380.     3,0,JAM2,    /* front and back text pens, drawmode and fill byte */
  381.     11,2,    /* origin */
  382.     NULL,    /* font pointer or NULL for default */
  383.     NULL,    /* pointer to text */
  384.     NULL    /* next IntuiText */
  385. };
  386.  
  387. struct Gadget ContinueGadget = {
  388.     &CancelGadget,    /* next gadget */
  389.     43,89,    /* origin of hit box */
  390.     56,11,    /* hit box width and height */
  391.     GADGHCOMP,    /* flags */
  392.     RELVERIFY,    /* activation flags */
  393.     BOOLGADGET|REQGADGET,    /* type flags */
  394.     (APTR)&ContinueGadBorder,    /* border or render image */
  395.     NULL,    /* select image */
  396.     &ContinueGadIText,    /* first IntuiText */
  397.     NULL,    /* mutual-exclude (unused) */
  398.     NULL,    /* SpecialInfo */
  399.     0x01,    /* GadgetID */
  400.     NULL    /* user data */
  401. };
  402.  
  403. USHORT FileBorderVectors[] = {
  404.     175,0,
  405.     0,0,
  406.     0,69,
  407.     175,69
  408. };
  409. struct Border FileBorder = {
  410.     25,3,    /* origin */
  411.     1,0,JAM1,    /* front pen, back pen and drawmode */
  412.     4,    /* number of vectors */
  413.     FileBorderVectors,    /* pointer to vectors */
  414.     NULL    /* next border */
  415. };
  416.  
  417. #define FileReqGadgetList &ContinueGadget
  418.  
  419. struct Requester FileRequester = {
  420.     NULL,    /* previous requester (filled in by Intuition) */
  421.     1,10,    /* origin */
  422.     243,104,    /* width and height */
  423.     0,0,    /* relative to these mouse offsets if POINTREL is set */
  424.     FileReqGadgetList,    /* list */
  425.     &FileBorder,    /* box's border */
  426.     NULL,    /* text */
  427.     NULL,    /* flags */
  428.     0,    /* back-plane fill pen */
  429.     NULL,    /* reserved */
  430.     NULL,    /* custom bitmap if PREDRAWN is set */
  431.     NULL    /* reserved */
  432. };
  433.  
  434. #define    FRWLEFTEDGE    115
  435. #define FRWTOPEDGE    25
  436.  
  437. struct NewWindow NewFileReqWindow = {
  438.     FRWLEFTEDGE,FRWTOPEDGE,    /* origin */
  439.     245,115,    /* width and height */
  440.     0,1,    /* detail & block pens */
  441.     REQSET|GADGETDOWN|GADGETUP,    /* IDCMP Flags */
  442.     WINDOWDRAG|ACTIVATE|NOCAREREFRESH,    /* Flags */
  443.     NULL,    /* list */
  444.     NULL,    /* Checkmark Image */
  445.     "Key Map Editor - Filer",    /* title */
  446.     NULL,
  447.     NULL,
  448.     245,115,    /* Min width & height */
  449.     -1,-1,    /* Max width & height */
  450.     WBENCHSCREEN
  451. };
  452.  
  453. #define NameGadgetList    &Name0Gadget
  454. #define NameGadgetListLen    7
  455.