home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d165 / plotview.lha / PlotView / plotview.h < prev    next >
C/C++ Source or Header  |  1988-11-22  |  14KB  |  737 lines

  1. /*
  2.  * screen definitions for my custom screen 
  3.  *
  4.  */
  5.  
  6. #define XSIZE 690
  7. #define YSIZE 423
  8.  
  9. static struct TextAttr TOPAZ80 = {
  10.     (STRPTR)"topaz.font",
  11.     TOPAZ_EIGHTY,0,0
  12. };
  13. static struct NewScreen NewScreenStructure = {
  14.     0,0,    /* screen XY origin relative to View */
  15.     XSIZE,YSIZE+2,    /* screen width and height */
  16.     2,    /* screen depth (number of bitplanes) */
  17.     0,1,    /* detail and block pens */
  18.     LACE+HIRES,    /* display modes for this screen */
  19.     CUSTOMSCREEN,    /* screen type */
  20.     &TOPAZ80,    /* pointer to default screen font */
  21.     (UBYTE *)"Plot To Amiga",    /* screen title */
  22.     NULL,    /* first in list of custom screen gadgets */
  23.     NULL    /* pointer to custom BitMap structure */
  24. };
  25.  
  26. #define NEWSCREENSTRUCTURE NewScreenStructure
  27.  
  28. static USHORT Palette[] = {
  29.     0x003F, /* color #0 */
  30.     0x0DEF, /* color #1 */
  31.     0x0F00, /* color #2 */
  32.     0x0CF2    /* color #3 */
  33. #define PaletteColorCount 4
  34. };
  35.  
  36. #define PALETTE Palette
  37.  
  38. /*
  39.  * definition of the main window
  40.  */
  41.  
  42. static struct NewWindow    New_Window = {
  43.     0, 2,            /* Take all except the */
  44.     XSIZE, YSIZE,    /* top two lines       */
  45.     -1, -1,            /* Default pens */
  46.     CLOSEWINDOW+MENUPICK,    /* Inputs acceppeted */
  47.     WINDOWCLOSE        /* Fairly standard window */
  48.     | WINDOWDEPTH | SMART_REFRESH | BORDERLESS ,
  49.     NULL,            /* no gadgets */
  50.     (struct Image *) NULL,
  51.     (UBYTE *)"PlotView",    /* title */
  52.     (struct Screen *) NULL,        /* filled at startup */
  53.     (struct BitMap *) NULL,
  54.     0, 0, 0, 0,        /* no change sizes, doesn't matter */
  55.     CUSTOMSCREEN
  56.     } ;
  57.  
  58.  
  59.  
  60. /*
  61.  * definitions for the menus 
  62.  */
  63.  
  64. #define MENUWIDTH 126
  65. #define MENUHEIGHT 8
  66.  
  67. struct IntuiText IText0 = {
  68.     3,1,COMPLEMENT,
  69.     0,0,
  70.     NULL,
  71.     (UBYTE *)"QUIT",
  72.     NULL
  73. };
  74.  
  75. struct MenuItem MenuItem7 = {
  76.     NULL,
  77.     0,54,
  78.     MENUWIDTH,MENUHEIGHT,
  79.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  80.     0,
  81.     (APTR)&IText0,
  82.     NULL,
  83.     'Q',
  84.     NULL,
  85.     MENUNULL
  86. };
  87.  
  88.  
  89. struct IntuiText IText1 = {
  90.     3,1,COMPLEMENT,
  91.     0,0,
  92.     NULL,
  93.     (UBYTE *)"ColorWindow",
  94.     NULL
  95. };
  96.  
  97. struct MenuItem MenuItem6 = {
  98.     &MenuItem7,
  99.     0,45,
  100.     MENUWIDTH,MENUHEIGHT,
  101.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  102.     0,
  103.     (APTR)&IText1,
  104.     NULL,
  105.     'W',
  106.     NULL,
  107.     MENUNULL
  108. };
  109.  
  110. struct IntuiText IText2 = {
  111.     3,1,COMPLEMENT,
  112.     0,0,
  113.     NULL,
  114.     (UBYTE *)"Help",
  115.     NULL
  116. };
  117.  
  118. struct MenuItem MenuItem5 = {
  119.     &MenuItem6,
  120.     0,36,
  121.     MENUWIDTH,MENUHEIGHT,
  122.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  123.     0,
  124.     (APTR)&IText2,
  125.     NULL,
  126.     'H',
  127.     NULL,
  128.     MENUNULL
  129. };
  130.  
  131. struct IntuiText IText3 = {
  132.     3,1,COMPLEMENT,
  133.     0,0,
  134.     NULL,
  135.     (UBYTE *)"Print",
  136.     NULL
  137. };
  138.  
  139. struct MenuItem MenuItem4 = {
  140.     &MenuItem5,
  141.     0,27,
  142.     MENUWIDTH,MENUHEIGHT,
  143.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  144.     0,
  145.     (APTR)&IText3,
  146.     NULL,
  147.     'P',
  148.     NULL,
  149.     MENUNULL
  150. };
  151.  
  152. struct IntuiText IText4 = {
  153.     3,1,COMPLEMENT,
  154.     0,0,
  155.     NULL,
  156.     (UBYTE *)"Set Scale",
  157.     NULL
  158. };
  159.  
  160. struct MenuItem MenuItem3 = {
  161.     &MenuItem4,
  162.     0,18,
  163.     MENUWIDTH,MENUHEIGHT,
  164.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  165.     0,
  166.     (APTR)&IText4,
  167.     NULL,
  168.     'S',
  169.     NULL,
  170.     MENUNULL
  171. };
  172.  
  173. struct IntuiText IText5 = {
  174.     3,1,COMPLEMENT,
  175.     0,0,
  176.     NULL,
  177.     (UBYTE *)"Clear",
  178.     NULL
  179. };
  180.  
  181. struct MenuItem MenuItem2 = {
  182.     &MenuItem3,
  183.     0,9,
  184.     MENUWIDTH,MENUHEIGHT,
  185.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  186.     0,
  187.     (APTR)&IText5,
  188.     NULL,
  189.     'C',
  190.     NULL,
  191.     MENUNULL
  192. };
  193.  
  194. struct IntuiText IText6 = {
  195.     3,1,COMPLEMENT,
  196.     0,0,
  197.     NULL,
  198.     (UBYTE *)"Draw File",
  199.     NULL
  200. };
  201.  
  202. struct MenuItem MenuItem1 = {
  203.     &MenuItem2,
  204.     0,0,
  205.     MENUWIDTH,MENUHEIGHT,
  206.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
  207.     0,
  208.     (APTR)&IText6,
  209.     NULL,
  210.     'D',
  211.     NULL,
  212.     MENUNULL
  213. };
  214.  
  215. struct Menu Menu1 = {
  216.     NULL,
  217.     0,0,
  218.     75,0,
  219.     MENUENABLED,
  220.     "Project",
  221.     &MenuItem1
  222. };
  223.  
  224. #define MenuList1 Menu1
  225.  
  226. /*
  227.  * definition for the Fileio Window
  228.  */
  229.  
  230.  
  231. struct NewWindow NewFileioWindow = {
  232.     61,26,
  233.     310,150,
  234.     -1,-1,
  235.     DISKINSERTED+MOUSEBUTTONS+VANILLAKEY,
  236.     SMART_REFRESH+ACTIVATE+NOCAREREFRESH,
  237.     NULL,
  238.     NULL,
  239.     NULL,
  240.     NULL,
  241.     NULL,
  242.     5,5,
  243.     640,200,
  244.     CUSTOMSCREEN
  245. };
  246.  
  247.  
  248. /*
  249.  * definitions for the Scale Select Window and gadgets
  250.  */
  251.  
  252.  
  253. UBYTE UNDOBUFFER[10];
  254.  
  255. SHORT BorderVectors1[] = {
  256.     0,0,
  257.     107,0,
  258.     107,11,
  259.     0,11,
  260.     0,0
  261. };
  262. struct Border Border1 = {
  263.     -2,-1,
  264.     3,0,JAM1,
  265.     5,
  266.     BorderVectors1,
  267.     NULL
  268. };
  269.  
  270. struct IntuiText IWinText1 = {
  271.     3,0,JAM2,
  272.     0,1,
  273.     NULL,
  274.     (UBYTE *)"OVERRIDE FILE",
  275.     NULL
  276. };
  277.  
  278. struct Gadget OverrideGad = {
  279.     NULL,
  280.     144,77,
  281.     104,10,
  282.     NULL,
  283.     TOGGLESELECT,
  284.     BOOLGADGET,
  285.     (APTR)&Border1,
  286.     NULL,
  287.     &IWinText1,
  288.     NULL,
  289.     NULL,
  290.     NULL,
  291.     NULL
  292. };
  293.  
  294. UBYTE YoffGadSIBuff[10];
  295. struct StringInfo YoffGadSInfo = {
  296.     YoffGadSIBuff,
  297.     UNDOBUFFER,
  298.     0,
  299.     10,
  300.     0,
  301.     0,0,0,0,0,
  302.     0,
  303.     0,
  304.     NULL
  305. };
  306.  
  307. SHORT BorderVectors2[] = {
  308.     0,0,
  309.     106,0,
  310.     106,12,
  311.     0,12,
  312.     0,0
  313. };
  314. struct Border Border2 = {
  315.     -2,-3,
  316.     3,0,JAM1,
  317.     5,
  318.     BorderVectors2,
  319.     NULL
  320. };
  321.  
  322. struct Gadget YoffGad = {
  323.     &OverrideGad,
  324.     143,55,
  325.     103,11,
  326.     NULL,
  327.     RELVERIFY+STRINGCENTER,
  328.     STRGADGET,
  329.     (APTR)&Border2,
  330.     NULL,
  331.     NULL,
  332.     NULL,
  333.     (APTR)&YoffGadSInfo,
  334.     NULL,
  335.     NULL
  336. };
  337.  
  338. UBYTE XoffGadSIBuff[10];
  339. struct StringInfo XoffGadSInfo = {
  340.     XoffGadSIBuff,
  341.     UNDOBUFFER,
  342.     0,
  343.     10,
  344.     0,
  345.     0,0,0,0,0,
  346.     0,
  347.     0,
  348.     NULL
  349. };
  350.  
  351. SHORT BorderVectors3[] = {
  352.     0,0,
  353.     106,0,
  354.     106,12,
  355.     0,12,
  356.     0,0
  357. };
  358. struct Border Border3 = {
  359.     -2,-3,
  360.     3,0,JAM1,
  361.     5,
  362.     BorderVectors3,
  363.     NULL
  364. };
  365.  
  366. struct Gadget XoffGad = {
  367.     &YoffGad,
  368.     143,29,
  369.     103,11,
  370.     NULL,
  371.     RELVERIFY+STRINGCENTER,
  372.     STRGADGET,
  373.     (APTR)&Border3,
  374.     NULL,
  375.     NULL,
  376.     NULL,
  377.     (APTR)&XoffGadSInfo,
  378.     NULL,
  379.     NULL
  380. };
  381.  
  382. SHORT BorderVectors4[] = {
  383.     0,0,
  384.     45,0,
  385.     45,12,
  386.     0,12,
  387.     0,0
  388. };
  389. struct Border Border4 = {
  390.     -2,-1,
  391.     3,0,JAM1,
  392.     5,
  393.     BorderVectors4,
  394.     NULL
  395. };
  396.  
  397. struct TextAttr TOPAZ60 = {
  398.     (STRPTR)"topaz.font",
  399.     TOPAZ_SIXTY,0,0
  400. };
  401. struct IntuiText IWinText2 = {
  402.     3,0,JAM2,
  403.     12,2,
  404.     &TOPAZ60,
  405.     (UBYTE *)"OK",
  406.     NULL
  407. };
  408.  
  409. struct Gadget OKGad = {
  410.     &XoffGad,
  411.     50,77,
  412.     42,11,
  413.     NULL,
  414.     RELVERIFY,
  415.     BOOLGADGET,
  416.     (APTR)&Border4,
  417.     NULL,
  418.     &IWinText2,
  419.     NULL,
  420.     NULL,
  421.     NULL,
  422.     NULL
  423. };
  424.  
  425. UBYTE YscaleGadSIBuff[10];
  426. struct StringInfo YscaleGadSInfo = {
  427.     YscaleGadSIBuff,
  428.     UNDOBUFFER,
  429.     0,
  430.     10,
  431.     0,
  432.     0,0,0,0,0,
  433.     0,
  434.     0,
  435.     NULL
  436. };
  437.  
  438. SHORT BorderVectors5[] = {
  439.     0,0,
  440.     106,0,
  441.     106,12,
  442.     0,12,
  443.     0,0
  444. };
  445. struct Border Border5 = {
  446.     -2,-3,
  447.     3,0,JAM1,
  448.     5,
  449.     BorderVectors5,
  450.     NULL
  451. };
  452.  
  453. struct Gadget YscaleGad = {
  454.     &OKGad,
  455.     26,55,
  456.     103,11,
  457.     NULL,
  458.     RELVERIFY+STRINGCENTER,
  459.     STRGADGET,
  460.     (APTR)&Border5,
  461.     NULL,
  462.     NULL,
  463.     NULL,
  464.     (APTR)&YscaleGadSInfo,
  465.     NULL,
  466.     NULL
  467. };
  468.  
  469. UBYTE XscaleGadSIBuff[10];
  470. struct StringInfo XscaleGadSInfo = {
  471.     XscaleGadSIBuff,
  472.     UNDOBUFFER,
  473.     0,
  474.     10,
  475.     0,
  476.     0,0,0,0,0,
  477.     0,
  478.     0,
  479.     NULL
  480. };
  481.  
  482. SHORT BorderVectors6[] = {
  483.     0,0,
  484.     106,0,
  485.     106,12,
  486.     0,12,
  487.     0,0
  488. };
  489. struct Border Border6 = {
  490.     -2,-3,
  491.     3,0,JAM1,
  492.     5,
  493.     BorderVectors6,
  494.     NULL
  495. };
  496.  
  497. struct Gadget XscaleGad = {
  498.     &YscaleGad,
  499.     26,29,
  500.     103,11,
  501.     NULL,
  502.     RELVERIFY+STRINGCENTER,
  503.     STRGADGET,
  504.     (APTR)&Border6,
  505.     NULL,
  506.     NULL,
  507.     NULL,
  508.     (APTR)&XscaleGadSInfo,
  509.     NULL,
  510.     NULL
  511. };
  512.  
  513. #define GadgetList1 XscaleGad
  514.  
  515. struct IntuiText IWinText8 = {
  516.     3,0,JAM2,
  517.     257,57,
  518.     NULL,
  519.     (UBYTE *)"Y",
  520.     NULL
  521. };
  522.  
  523. struct IntuiText IWinText7 = {
  524.     3,0,JAM2,
  525.     256,31,
  526.     NULL,
  527.     (UBYTE *)"X",
  528.     &IWinText8
  529. };
  530.  
  531. struct IntuiText IWinText6 = {
  532.     3,0,JAM2,
  533.     142,11,
  534.     NULL,
  535.     (UBYTE *)"Select Offset",
  536.     &IWinText7
  537. };
  538.  
  539. struct IntuiText IWinText5 = {
  540.     3,0,JAM2,
  541.     10,56,
  542.     NULL,
  543.     (UBYTE *)"Y",
  544.     &IWinText6
  545. };
  546.  
  547. struct IntuiText IWinText4 = {
  548.     3,0,JAM2,
  549.     9,31,
  550.     NULL,
  551.     (UBYTE *)"X",
  552.     &IWinText5
  553. };
  554.  
  555. struct IntuiText IWinText3 = {
  556.     3,0,JAM2,
  557.     29,11,
  558.     NULL,
  559.     (UBYTE *)"Select Scale",
  560.     &IWinText4
  561. };
  562.  
  563. #define IWinText IWinText3
  564.  
  565. struct NewWindow NewScaleWindow = {
  566.     61,26,
  567.     280,120,
  568.     0,1,
  569.     GADGETUP,
  570.     NULL,
  571.     &XscaleGad,
  572.     NULL,
  573.     NULL,
  574.     NULL,
  575.     NULL,
  576.     5,5,
  577.     640,200,
  578.     CUSTOMSCREEN
  579. };
  580.  
  581. /*
  582.  * Text for requesters 
  583.  */
  584.  
  585. char filename[80];
  586.  
  587.  
  588. struct IntuiText ffmtmsg2 = {
  589.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  590.     14,20,    /* XY origin relative to container TopLeft */
  591.     NULL,    /* font pointer or NULL for default */
  592.     (UBYTE *) filename,    /* pointer to text */
  593.     NULL    /* next IntuiText structure */
  594. };
  595.  
  596. struct IntuiText ffmtmsg = {
  597.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  598.     14,10,    /* XY origin relative to container TopLeft */
  599.     NULL,    /* font pointer or NULL for default */
  600.     (UBYTE *)"File has format error",    /* pointer to text */
  601.     &ffmtmsg2    /* next IntuiText structure */
  602. };
  603.  
  604.  
  605. struct IntuiText openfimsg2 = {
  606.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  607.     14,26,    /* XY origin relative to container TopLeft */
  608.     NULL,    /* font pointer or NULL for default */
  609.     (UBYTE *) filename,
  610.     NULL    /* next IntuiText structure */
  611. };
  612.  
  613. struct IntuiText openfimsg = {
  614.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  615.     14,16,    /* XY origin relative to container TopLeft */
  616.     NULL,    /* font pointer or NULL for default */
  617.     (UBYTE *)"Can't open file:",    /* pointer to text */
  618.     &openfimsg2    /* next IntuiText structure */
  619. };
  620.  
  621. struct IntuiText cantxt = {
  622.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  623.     5,3,    /* XY origin relative to container TopLeft */
  624.     NULL,    /* font pointer or NULL for default */
  625.     (UBYTE *)"CANCEL",    /* pointer to text */
  626.     NULL    /* next IntuiText structure */
  627. };
  628.  
  629. struct IntuiText retrytxt = {
  630.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  631.     5,3,    /* XY origin relative to container TopLeft */
  632.     NULL,    /* font pointer or NULL for default */
  633.     (UBYTE *)"RETRY",    /* pointer to text */
  634.     NULL    /* next IntuiText structure */
  635. };
  636.  
  637.  
  638. struct IntuiText oktxt = {
  639.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  640.     5,3,    /* XY origin relative to container TopLeft */
  641.     NULL,    /* font pointer or NULL for default */
  642.     (UBYTE *)"OK",    /* pointer to text */
  643.     NULL    /* next IntuiText structure */
  644. };
  645.  
  646. struct IntuiText nodatamsg = {
  647.     0,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  648.     14,16,    /* XY origin relative to container TopLeft */
  649.     NULL,    /* font pointer or NULL for default */
  650.     (UBYTE *)"No data selected - check options",    /* pointer to text */
  651.     NULL    /* next IntuiText structure */
  652. };
  653.  
  654. struct IntuiText prfailtxt = {
  655.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  656.     14,16,    /* XY origin relative to container TopLeft */
  657.     NULL,    /* font pointer or NULL for default */
  658.     (UBYTE *)"Printer failed to open",    /* pointer to text */
  659.     NULL    /* next IntuiText structure */
  660. };
  661.  
  662. #define XOPT 60
  663. #define YOPT 100
  664.  
  665. /*
  666.  * Text for error messages in scale window 
  667.  */
  668.  
  669. struct IntuiText ErrText1 = {
  670.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  671.     XOPT+10,YOPT+5,    /* XY origin relative to container TopLeft */
  672.     NULL,    /* font pointer or NULL for default */
  673.     (UBYTE *)"Invalid X scale",    /* pointer to text */
  674.     NULL    /* next IntuiText structure */
  675. };
  676.  
  677. struct IntuiText ErrText2 = {
  678.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  679.     XOPT+10,YOPT+5,    /* XY origin relative to container TopLeft */
  680.     NULL,    /* font pointer or NULL for default */
  681.     (UBYTE *)"Invalid Y scale",    /* pointer to text */
  682.     NULL    /* next IntuiText structure */
  683. };
  684.  
  685. struct IntuiText ErrText3 = {
  686.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  687.     XOPT+10,YOPT+5,    /* XY origin relative to container TopLeft */
  688.     NULL,    /* font pointer or NULL for default */
  689.     (UBYTE *)"Invalid X offset",    /* pointer to text */
  690.     NULL    /* next IntuiText structure */
  691. };
  692.  
  693. struct IntuiText ErrText4 = {
  694.     2,1,JAM2,    /* front and back text pens, drawmode and fill byte */
  695.     XOPT+10,YOPT+5,    /* XY origin relative to container TopLeft */
  696.     NULL,    /* font pointer or NULL for default */
  697.     (UBYTE *)"Invalid Y offset",    /* pointer to text */
  698.     NULL    /* next IntuiText structure */
  699. };
  700.  
  701. char *HelpText[40] = {
  702. "          PlotView - UNIX Plot file viewer for the Amiga.",
  703. "                   by Joel Swank - 9-30-88",
  704. "",
  705. "   PlotView draws UNIX plot format files on an Amiga Hi-Res screen. It has",
  706. "Menu options to Draw a file, Clear the screen, set Scaling, Print, set the",
  707. "Colors, and Quit. It can be started from the CLI or Workbench.",
  708. "",
  709. "From CLI:",
  710. "",
  711. ">plotview file . . .",
  712. "",
  713. "  Files will be read and drawn in order. Files can also be read by selecting",
  714. "the 'Draw File' Menu item. The FileIO requester by RJ Mical will be used",
  715. "to select a file name.",
  716. "",
  717. "  The scaling of the drawing can be modified by selecting the 'Set Scale'",
  718. "Menu item. This brings up the scale selection window. Enter Scale factors",
  719. "in the left two string gadgets. Default is 3120. Valid entrys are from 100",
  720. "to 10000. A smaller number means a larger drawing. Enter the offset in the",
  721. "right two string gadgets to shift the picture in the window. A positive or",
  722. "negative number may be entered. Toggle on the 'OVERRIDE FILE' gadget if you",
  723. "want the entered values to override any 'space' commands in the file.",
  724. "Otherwise these numbers will olny be used for files with no space command.",
  725. "",
  726. "The screen can be printed using the 'Print' Menu item. You may have to",
  727. "adjust preferences to get a good printout on a one-color printer. Try",
  728. "Black & White, Negative, and threshold = 5.",
  729. "",
  730. "If you prefer other colors, you can set them with the ColorWindow menu",
  731. "item. It allows you to set the colors using the ColorWindow by RJ Mical.",
  732. "",
  733. "After viewing plot files click the (invisable) close gadget in the",
  734. "upper left corner of the PlotView window, or select the 'Close' Menu item.",
  735. NULL
  736. };
  737.