home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / grafik / gp / gp.doc < prev    next >
Encoding:
Text File  |  1994-05-17  |  28.0 KB  |  946 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                      GP
  21.  
  22.                                Revision 5/17/94
  23.  
  24.  
  25.                       A graphics package for Turbo Pascal
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.                                  H. J. MACKEY
  34.  
  35.                                  UNT PHYSICS
  36.                                  P. O. BOX 5368
  37.                                  NT STATION
  38.                                  DENTON, TEXAS 76203
  39.  
  40.                                  (817) 565-3266
  41.                                 MACKEY@GAB.UNT.EDU
  42.                             74363.1553@CompuServe.Com
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. UNIT GP;
  61.  
  62. INTERFACE
  63.  
  64. USES Graph, BGIDrvr, BGIFont, Crt, Printer, GraphPrn, HpCopy, Powers, Mouse;
  65.  
  66. CONST  { included for reference and so that GRAPH not necessarily needed }
  67.  
  68. { EGA VGA COLORS       DRIVERS            MODES FOR DRIVERS }
  69.   Black        =  0;   Detect   = 0;      CGAc0   = 0;   CGAc1 = 1; CGAc2 = 2;
  70.   Blue         =  1;   CGA      = 1;      CGAc3   = 3;   CGAhi = 4;
  71.   Green        =  2;
  72.   Cyan         =  3;   EGA      = 3;      EGALo   = 0;   EGAhi   = 1;
  73.   Red          =  4;   EGA64    = 4;      EGA64Lo = 0;   EGA64hi = 1;
  74.   Magenta      =  5;
  75.   Brown        =  6;
  76.   LightGray    =  7;   HercMono = 7;      HercMonoHi = 0;
  77.   DarkGray     =  8;
  78.   LightBlue    =  9;   VGA      = 9;      VGALo = 0; VGAmed = 1; VGAhi = 2;
  79.   LightGreen   =  10;
  80.   LightCyan    =  11;   { SEE Ref Guide GRAPH UNIT def's }
  81.   LightRed     =  12;
  82.   LightMagenta =  13;   {>>>> HERC, CGA, EGAVGA drivers are linked into }
  83.   Yellow       =  14;   {>>>> *.EXE along with SmallFont driver         }
  84.   White        =  15;   {>>>> USE unit VESA16U.TPU if wish to use VESA16 }
  85.  
  86. VAR    { GLOBALS FOR POSSIBLE USE BY MAIN }
  87.  
  88.   { graph driver and graph mode variables }
  89.       Gdrvr, Gmode : INTEGER;
  90.  
  91.   { current world values }
  92.       WorldXmin, WorldXmax, WorldYmin, WorldYmax : REAL;
  93.  
  94.   { current window values }
  95.       WindowXmin, WindowXmax, WindowYmin, WindowYmax : INTEGER;
  96.  
  97.   { values labeled at ends of axes created by MakeWorldAndAxes }
  98.       AxesXmin, AxesXmax, AxesYmin, AxesYmax : REAL;
  99.  
  100. PROCEDURE BeginGraphic(VAR Gdrvr, Gmode : INTEGER);
  101. PROCEDURE EndGraphic;
  102.  
  103. PROCEDURE GoGraphic;
  104. PROCEDURE GoText;
  105.  
  106. PROCEDURE DefineWorld(Num : INTEGER; Xmin, Xmax, Ymin, Ymax : REAL);
  107. PROCEDURE SelectWorld(Num : INTEGER);
  108. PROCEDURE BoxWorld(Color : WORD);
  109.  
  110. PROCEDURE DefineWindow(Num : INTEGER; Xmin, Xmax, Ymin, Ymax : REAL);
  111. PROCEDURE SelectWindow(Num : INTEGER);
  112. PROCEDURE ClearCurrentWindow;
  113.  
  114. PROCEDURE MakeWorldAndAxes(WindowNum,WorldNum:INTEGER;
  115.       Xmin, Xmax, Ymin, Ymax : REAL; AxesColor, BoxColor : WORD;
  116.       Xtitle : STRING; XtitleColor : WORD;
  117.       Ytitle : STRING; YtitleColor : WORD;
  118.       MainTitle : STRING; MainTitleColor : WORD);
  119.  
  120. FUNCTION XperPixel : REAL;
  121. FUNCTION YperPixel : REAL;
  122. FUNCTION NowX : REAL;
  123. FUNCTION NowY : REAL;
  124. PROCEDURE GetXYfromPixels(VAR X,Y : REAL; Xpos, Ypos : INTEGER);
  125. FUNCTION XtoYAspFac : REAL;
  126.  
  127. PROCEDURE PlotPoint(X, Y : REAL; Color : WORD);
  128. FUNCTION  GetPoint(X, Y : REAL) : WORD;
  129.  
  130. PROCEDURE PlotTextXY(X, Y : REAL; TextString : STRING; Color : WORD);
  131. PROCEDURE PlotText(TextString : STRING; Color : WORD);
  132.  
  133. PROCEDURE PlotRealXY(LabelStr : STRING;
  134.            Value : REAL;W, d : INTEGER;X,Y : REAL;Color : WORD);
  135.                   { for X:w format type use d = -1 }
  136. PROCEDURE PlotReal(LabelStr : STRING;
  137.                      Value : REAL;W, d : INTEGER; Color : WORD);
  138.                      { for X:w format type use d = -1 }
  139.  
  140. PROCEDURE PlotIntegerXY(LabelStr : STRING; Value, w : INTEGER;
  141.                         X, Y : REAL; Color : WORD);
  142.  
  143. PROCEDURE PlotInteger(LabelStr : STRING; Value, w : INTEGER; Color : WORD);
  144.  
  145. PROCEDURE PlotLine(X1, Y1, X2, Y2 : REAL; Color : WORD);
  146. PROCEDURE PlotLineTo(X,Y : REAL; Color : WORD);
  147. PROCEDURE PlotLineRel(Dx,Dy : REAL; Color : WORD);
  148.  
  149. PROCEDURE PlotMoveTo(X,Y : REAL);
  150. PROCEDURE PlotMoveRel(Dx, Dy : REAL);
  151.  
  152. PROCEDURE PlotEllipse(Xmin, Xmax, Ymin, Ymax : REAL; Color : WORD);
  153. PROCEDURE PlotRect(Xmin, Xmax, Ymin, Ymax : REAL; Color : WORD);
  154. PROCEDURE PlotCircle(X, Y, R : REAL; Color : WORD);
  155. PROCEDURE Flood(x,y :REAL; FillColor,BorderColor : WORD);
  156.  
  157. PROCEDURE SaveImage(Num:INTEGER; Xmin,Xmax,Ymin,Ymax: REAL);
  158. PROCEDURE UnSaveImage(Num : INTEGER);
  159. PROCEDURE ClearImage(Num:INTEGER);
  160. PROCEDURE PlotImage(Num:INTEGER; Xlow,Yhi : REAL; PutType : WORD);
  161. PROCEDURE MoveImage(Num:INTEGER; Xlow, Yhi : REAL);
  162. PROCEDURE HeapImageToDisk(ImageNum : INTEGER; FileName : STRING);
  163. PROCEDURE DiskImageToHeap(FileName : STRING; ImageNum : INTEGER);
  164.  
  165. PROCEDURE CrossCursor(VAR CursorX, CursorY : REAL;
  166.                       ColorCursor:WORD;ShowXY:Boolean;
  167.                       Col, Row : INTEGER; ColorText : WORD);
  168. PROCEDURE BoxCursor(VAR BoxXmin, BoxXmax, BoxYmin, BoxYmax : REAL;
  169.                     ColorCursor : WORD; ShowXY : BOOLEAN;
  170.                     Col, Row : INTEGER; ColorText : WORD);
  171. PROCEDURE GetPixelArea(CurveColor, RefillColor : Word; VAR Area : REAL);
  172.  
  173. FUNCTION MouseOK : BOOLEAN;
  174. PROCEDURE RestrictMouseToWindow;
  175. PROCEDURE GetMouseXY(VAR X,Y:REAL);
  176. FUNCTION LeftMouseXY(VAR X, Y :REAL): BOOLEAN;
  177. FUNCTION LeftButtonClicked(VAR X, Y : REAL) : BOOLEAN;
  178. FUNCTION RightMouseXY(VAR X, Y :REAL): BOOLEAN;
  179. FUNCTION RightButtonClicked(VAR X, Y : REAL) : BOOLEAN;
  180. PROCEDURE MousePointer(VAR X, Y : REAL; Show : BOOLEAN;
  181.                        Row, Col : INTEGER; Color : BYTE);
  182. PROCEDURE MouseRubberBox(VAR X1,X2,Y1,Y2:REAL;Color : Word;
  183.                          EraseBox : BOOLEAN);
  184. PROCEDURE MouseRubberLine(VAR X1, Y1, X2, Y2 : REAL; Color : WORD;
  185.                           EraseLine : Boolean);
  186. PROCEDURE MouseDraw(Color : WORD);
  187.  
  188. PROCEDURE CopyToEpson;
  189. PROCEDURE CopyToHPLaserJet;
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.      GP.TPU is a real number based graphics  unit for Turbo Pascal which
  241.  
  242. utilizes many of the pixel based procedures in the standard GRAPH.TPU unit in
  243.  
  244. a manner transparent to the user.  The user is completely freed from pixel
  245.  
  246. counting, and he is allowed to think in terms of real numbers appropriate to
  247.  
  248. the results of computation.
  249.  
  250.  
  251.     HERCULES, CGA, and EGAVGA drivers are linked, along with that for
  252.  
  253. SmallFont.  This allows the final EXE file to contain these drivers.
  254.  
  255.     The unit supplies 47 procedures and 11 functions organized into 17 groups.
  256.  
  257. The preceeding printout of the UNIT INTERFACE section shows the formal
  258.  
  259. parameter list for each procedure or function along with the GLOBAL VAR and
  260.  
  261. GLOBAL CONST's that are provided.  These will now be described individually.
  262.  
  263. ------------------------------------------------------------------------------
  264.  
  265. Procedure BeginGraphic:
  266.  
  267.     This is the FIRST procedure called.  It places the video into graphics
  268.  
  269. mode, and loads the graphics system into memory.  All other procedures may now
  270.  
  271. be used.  The GLOBAL VAR Gdrvr is the name of the graphics driver to be used.
  272.  
  273. The GLOBAL VAR Gmode is the mode selected for that driver. See the GLOBAL
  274.  
  275. CONST list for some of the allowed parameters.  See the USER'S MANUAL for
  276.  
  277. other choices.  If the line     Gdrvr := Detect;  is used, the system will
  278.  
  279. automatically determine the graphics card in use and set Gmode to the most
  280.  
  281. dense mode available.  IN ALL OTHER CASES Gmode MUST BE ASSIGNED before
  282.  
  283. BeginGraphic is executed.  Gdrvr is initialized to   Gdrvr := Detect.
  284.  
  285. ------------------------------------------------------------------------------
  286.  
  287. Procedure EndGraphic:
  288.  
  289.     This is the LAST procedure called.  It causes the graphics system to be
  290.  
  291. unloaded from memory, and puts the video into standard text mode.  Generally,
  292.  
  293. all other procedures are bracketed between BeginGraphic and EndGraphic.
  294.  
  295. ------------------------------------------------------------------------------
  296.  
  297.  
  298.  
  299.  
  300. Procedures GoGraphic and GoText:
  301.  
  302.     These procedures allow switching back and forth between graphics mode and
  303.  
  304. text mode WITHOUT unloading the graphics system from memory.  After using
  305.  
  306. GoGraphic, the full screen is made the current window.
  307.  
  308. ------------------------------------------------------------------------------
  309.  
  310. Procedure DefineWorld:
  311.  
  312.     The user may define up to 10 "worlds".  These are merely statements of the
  313.  
  314. range of real numbers horizontally LEFT to RIGHT and vertically BOTTOM to TOP
  315.  
  316. which map to a window on the screen.
  317.  
  318.     Num   : integer 1 .. 10 index to assign to this world.
  319.     Xmin  : real number to associate with LEFT side of window.
  320.     Xmax  : real number to associate with RIGHT side of window.
  321.     Ymin  : real number to associate with BOTTOM of window.
  322.     Ymax  : real number to associate with TOP of window.
  323.  
  324. ------------------------------------------------------------------------------
  325.  
  326. Procedure SelectWorld:
  327.  
  328.     Any world which has been defined may be selected as the current world.
  329.  
  330. Only one world is the current world at any instant.  All 10 available worlds
  331.  
  332. are initialized by BeginGraphic to the values Xmin = -10.0, Xmax = 10.0,
  333.  
  334. Ymin = -10.0, Ymax = 10.0, and this common world is made the current world.
  335.  
  336. The real GLOBAL variables WorldXmin, WorldXmax, WorldYmin, and WorldYmax are
  337.  
  338. set to the values which define the world.
  339.  
  340. ------------------------------------------------------------------------------
  341.  
  342. Procedure BoxWorld:
  343.  
  344.     Causes a rectangle to be drawn at the boundaries of the current window
  345.  
  346.     in the color specified.
  347.  
  348. ------------------------------------------------------------------------------
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360. Procedure DefineWindow:
  361.  
  362.     The user may define up to 10 graphic windows or regions on the screen.
  363.  
  364. The screen is imagined ruled from 0.0 to 100.0 % from LEFT (0) to RIGHT (100),
  365.  
  366. and fron BOTTOM (0) to TOP (100).  The parameter list supplies the window
  367.  
  368. number or index, and describes its location and size by giving the REALs
  369.  
  370. Xmin, Xmax, Ymin, and Ymax.  An example of a window defined as window number 3,
  371.  
  372. which occupies the center ninth of the screen is :
  373.  
  374.                     DefineWindow(3,33.3,66.6,33.3,66.6);
  375.  
  376. ------------------------------------------------------------------------------
  377.  
  378. Procedure SelectWindow:
  379.  
  380.     This procedure makes window number "Num" the current window.  Only one
  381.  
  382. window may be the active current window at any instant.  BeginGraphic
  383.  
  384. initializes all 10 available windows to the entire screen and selects this
  385.  
  386. common window to be the current window.  Note that any defined world may be
  387.  
  388. selected independent of the index of the current window.  All drawing takes
  389.  
  390. place in the current window and is visible if the points or lines are
  391.  
  392. described by numeric values falling within the boundaries of the current
  393.  
  394. world.  Drawings are clipped at the edges of the window and no error takes
  395.  
  396. place if points are "drawn" outside the window.  They are just not visible.
  397.  
  398. The INTEGER globals WindowXmin, WindowXmax, WindowYmin and WindowYmax are
  399.  
  400. given values.  These are full screen pixel counts across and DOWN from the
  401.  
  402. upper left corner of the screen.  These are the ONLY values of this type
  403.  
  404. which count Y position from TOP to BOTTOM.
  405.  
  406. ------------------------------------------------------------------------------
  407.  
  408. Procedure ClearCurrentWindow:
  409.  
  410.     This procedure erases the current window to the default background color
  411.  
  412. black unless changed by procedure SetBkColor(Color) in the GRAPH unit.
  413.  
  414. ------------------------------------------------------------------------------
  415.  
  416.  
  417.  
  418.  
  419.  
  420. Procedure MakeWorldAndAxes:
  421.  
  422.   This procedure is provided to draw axes.  It will CREAT a world which is
  423.  
  424. appropriate for the range in X and Y described by Xmin, Xmax, Ymin, Ymax and
  425.  
  426. will assign this world the index WorldNum  (1 .. 10).  This world is then made
  427.  
  428. the current world.  The previously defined window of index WindowNum is
  429.  
  430. selected as the current window.  Fully annotated axes are then drawn along
  431.  
  432. with titles.  The size of the annotations is varied dependent upon the size
  433.  
  434. of the window.  Window(WindowNum) is then REDEFINED to correspond to the
  435.  
  436. drawing area, and World(WorldNum) is redefined to correspond to the values of
  437.  
  438. the real GLOBALs AxesXmin, AxesXmax, AxesYmin and AxesYmax which label the
  439.  
  440. extremes of the axes.
  441.  
  442. ------------------------------------------------------------------------------
  443.  
  444. Functions XperPixel and YperPixel:
  445.  
  446.     The function XperPixel returns the real positive number which is the
  447.  
  448. the change in X which represents a one pixel horizontal displacement for the
  449.  
  450. current window and world.  YperPixel returns similar information for a one
  451.  
  452. pixel vertical displacement.
  453.  
  454. ------------------------------------------------------------------------------
  455.  
  456. Functions NowX and NowY:
  457.  
  458.     These functions return the real number X and Y coordinates of the
  459.  
  460. invisible graphics cursor.
  461.  
  462. ------------------------------------------------------------------------------
  463.  
  464. Procedure GetXYfromPixels:
  465.  
  466.     This procedure returns the real values X, Y corresponding to the pixel
  467.  
  468. integer coordinates Xpos, Ypos.  Note that Xpos and Ypos are viewport relative.
  469.  
  470. ------------------------------------------------------------------------------
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480. Function XtoYAspFac:
  481.  
  482.     This function returns the factor required in order to draw square
  483.  
  484. rectangles and circular ellipses on the screen.  This factor depends upon
  485.  
  486. the graphics driver, graphics mode, current window and current world.  If a
  487.  
  488. horizontal line is drawn between (X1, Y1) and (X2, Y1), then a vertical
  489.  
  490. line drawn from (X1,Y1) to (X1,Y2) will appear of the same length if
  491.  
  492.                     Y2 - Y1 = (X2 - X1)* XtoYAspFac.
  493.  
  494. Also, consider :
  495.  
  496.          PlotLine(0.0,0.0,R*Cos(Theta)/XtoYAspFac,R*Sin(Theta),Green);
  497.  
  498. This will draw a line whose length on screen is independent of the angle
  499.  
  500. Theta, and is independent of the window and world in use.
  501.  
  502. ------------------------------------------------------------------------------
  503.  
  504. Procedure PlotPoint:
  505.  
  506.     This procedure is used to plot a point in the current window at
  507.  
  508. coordinates X, Y in the current world.  The color may be set for EGA, VGA
  509.  
  510. as indicated in the interface listing.  NOTE : the invisible graphics cursor
  511.  
  512. is NOT moved to the point drawn by this procedure.
  513.  
  514. ------------------------------------------------------------------------------
  515.  
  516. Function GetPoint:
  517.  
  518.     This function returns the color of the pixel at world coordinates X, Y.
  519.  
  520. ------------------------------------------------------------------------------
  521.  
  522. Procedure PlotTextXY:
  523.  
  524.     Text is drawn in default font, direction and justification unless defaults
  525.  
  526. are modified by GRAPH procedures SetTextStyle, SetTextJustify.  Text is drawn
  527.  
  528. at world coordinates X and Y in the current window, using the specified
  529.  
  530. color.  NOTE : the invisible graphics cursor is NOT updated by this procedure.
  531.  
  532. ------------------------------------------------------------------------------
  533.  
  534. Procedure PlotText:
  535.  
  536.     As PlotTextXY except the text is plotted at the current position of the
  537.  
  538. invisible graphics cursor.  The graphics cursor IS updated if horizontal
  539.  
  540. direction and justification are set (default conditions).
  541.  
  542. ------------------------------------------------------------------------------
  543.  
  544.  
  545.  
  546.  
  547.  
  548. Procedure PlotRealXY:
  549.  
  550.     The real number, preceeded by the label string, is drawn in the selected
  551.  
  552. color at the world coordinates X and Y.  The format Value:w:d is selected
  553.  
  554. by the values of w and d.  To use format type Value:w, set d = -1.
  555.  
  556. The graphics cursor IS updated if horizontal direction and justification
  557.  
  558. are set (default conditions).
  559.  
  560. -----------------------------------------------------------------------------
  561.  
  562. Procedure PlotReal:
  563.  
  564.     As PlotRealXY except that the string is plotted at the current position
  565.  
  566. of the graphics cursor.  The graphics cursor IS updated if horizontal direction
  567.  
  568. and justification are set (default conditions).
  569.  
  570. -----------------------------------------------------------------------------
  571.  
  572. Procedure PlotIntegerXY:
  573.  
  574.     An integer value, preceeded by the label string, is drawn in the selected
  575.  
  576. color at world coordinates X and Y.  The width of the field occupied by the
  577.  
  578. integer is specified by "w".  The graphics cursor IS updated if horizontal
  579.  
  580. direction and justification are set (default conditions).
  581.  
  582. ------------------------------------------------------------------------------
  583.  
  584. Procedure PlotInteger:
  585.  
  586.     As procedure PlotIntegerXY except string is plotted at the current
  587.  
  588. position of the graphics cursor.  The graphics cursor IS updated if horizontal
  589.  
  590. direction and justification are set (default conditions).
  591.  
  592. ------------------------------------------------------------------------------
  593.  
  594. Procedure PlotLine:
  595.  
  596.     A line is drawn in color specified and default style to connect the two
  597.  
  598. points whose world coordinates are specified.  See GRAPH procedure SetLineStyle
  599.  
  600. SetWriteMode for optional appearance.  NOTE : the invisible graphics cursor is
  601.  
  602. NOT updated by this procedure.
  603.  
  604. ------------------------------------------------------------------------------
  605.  
  606. Procedure PlotLineTo:
  607.  
  608.     A line is drawn in specified color and default style from the current
  609.  
  610. graphics cursor position to that corresponding to the specified world
  611.  
  612. coordinates X and Y.  NOTE : the invisible graphics cursor IS updated by this
  613.  
  614. procedure.
  615.  
  616. ------------------------------------------------------------------------------
  617.  
  618. Procedure PlotLineRel:
  619.  
  620.     A line is drawn from the current invisible graphics cursor position (X, Y)
  621.  
  622. to a point (X + Dx, Y + Dy) in the current window using the current world.
  623.  
  624. NOTE: the graphics cursor IS updated by this procedure.
  625.  
  626. ------------------------------------------------------------------------------
  627.  
  628. Procedure PlotMoveTo:
  629.  
  630.     Positions the invisible graphics cursor at the specified position using
  631.  
  632. the current world and current window.
  633.  
  634. ------------------------------------------------------------------------------
  635.  
  636. Procedure PlotMoveRel:
  637.  
  638.     Moves the invisible graphics cursor from its present position (X, Y) to
  639.  
  640. a new point (X + Dx, Y + Dy) in the current window using the current world.
  641.  
  642. ------------------------------------------------------------------------------
  643.  
  644. Procedure PlotEllipse:
  645.  
  646.     Draws an ellipse inscribed in an imaginary rectangle whose sides are
  647.  
  648. specified.  Note that because the aspect ratio between horizontal and vertical
  649.  
  650. displacements is unlikely to be one, the world in use may be adjusted so that
  651.  
  652. if the rectangle is square, that the ellipse appears as a circle.  For
  653.  
  654. example DefineWorld(1,Ymin*XtoYaspFac,Ymax*XtoYaspFac,Ymin,Ymax).  See
  655.  
  656. Function XtoYAspFac above for more discussion of aspect ratio.
  657.  
  658. NOTE: the invisible graphics cursor is left at the center of the rectangle.
  659.  
  660. ------------------------------------------------------------------------------
  661. Procedure PlotRect:
  662.  
  663.     Draws a rectangle whose sides are specified in designated color.  See
  664.  
  665. PlotEllipse above for aspect considerations.
  666.  
  667. ------------------------------------------------------------------------------
  668.  
  669. Procedure PlotCircle:
  670.  
  671.     Draws a true circle on the screen regardless of world and window
  672.  
  673. chosen.  X and Y determine the center of the circle, while R is the radius
  674.  
  675. MEASURED IN X UNITS. NOTE: the invisible graphics cursor is NOT updated.
  676.  
  677. ------------------------------------------------------------------------------
  678.  
  679. Procedure Flood:
  680.  
  681.     A closed curve may be filled with color.  X, Y are the world coordinates
  682.  
  683. of any interior point.  FillColor is the color used to paint the interior.
  684.  
  685. BorderColor is the color in which the curve to be filled is drawn.
  686.  
  687. ---------------------------------------------------------------------------
  688.  
  689. Procedure SaveImage:
  690.  
  691.     Up to 10 rectangular screen regions or images may be saved in memory,
  692.  
  693. specifically on the heap.  Num is the image number or index, while Xmin, Xmax,
  694.  
  695. Ymin, Ymax are the world coordinates describing the rectangle.  Since any
  696.  
  697. data structure is limited to 64K bytes, there is a limit to the size of image
  698.  
  699. which can be saved.  An error message is issued if the region is too large
  700.  
  701. to save, or if not enough memory is available.
  702.  
  703. -------------------------------------------------------------------------
  704.  
  705. Procedure UnSaveImage:
  706.  
  707.     Image number Num is unloaded from memory, freeing the memory for use.
  708.  
  709. Image number Num is no longer valid until some image is saved using this index.
  710.  
  711. ------------------------------------------------------------------------------
  712.  
  713. Procedure ClearImage:
  714.  
  715.     The referenced image is erased (XORed) to background on the screen.  The
  716.  
  717. image is still saved in memory and may be placed back on the screen.  See
  718.  
  719. below.
  720.  
  721. ------------------------------------------------------------------------------
  722.  
  723. Procedure PlotImage:
  724.  
  725.     This procedure draws a saved image in the current window using the
  726.  
  727. current world coordinates.  Xlow and Yhi specify the location for
  728.  
  729. placement of the upper lefthand corner of the rectangular image.  PutType
  730.  
  731. specifies the BitBlt operation used.  The allowed values are :
  732.  
  733.            NormalPut : Copies bitmap image to screen.
  734.            XORPut    : XOR's  bitmap image to screen.
  735.            ORPut     : OR's   bitmap image to screen.
  736.            AndPut    : AND's  bitmap image to screen.
  737.            NotPut    : NOT's bitmap image to screen.
  738.  
  739. ------------------------------------------------------------------------------
  740.  
  741. Procedure MoveImage:
  742.  
  743.     The referenced image is erased (XORed) to background on the screen.  It
  744.  
  745. is then redrawn at the specified coordinates.  Xlow and Yhi are the world
  746.  
  747. coordinates for placement of the upper lefthand corner of the image rectangle.
  748.  
  749. ------------------------------------------------------------------------------
  750.  
  751. Procedure CrossCursor:
  752.  
  753.     This procedure will draw a cursor on the screen at the center of the
  754.  
  755. current window.  The cursor may be moved a single pixel unit horizontally or
  756.  
  757. vertically with the ARROW keys.  Home, End, PageUp and PageDown keys cause
  758.  
  759. similar movements of 10 pixel units.  The background is preserved.  The world
  760.  
  761. coordinates of the center of the cursor are returned through the real
  762.  
  763. variables CursorX and CursorY.  If desired, the values of these coordinates
  764.  
  765. may be displayed on the screen as the cursor is moved.  The formal parameters
  766.  
  767. are defined as follows:
  768.  
  769.      ColorCursor  : WORD        Color of cursor.
  770.      ShowXY       : BOOLEAN     TRUE => display CursorX and CursorY.
  771.      Col, Row     : INTEGER     Text position for display if ShowXY = TRUE.
  772.      ColorText    : WORD        Color of displayed text if ShowXY = TRUE.
  773.  
  774. Press <ENTER> to exit the procedure.
  775.  
  776. ------------------------------------------------------------------------------
  777.  
  778.  
  779.  
  780. Procedure BoxCursor:
  781.  
  782.     This procedure is similar to CrossCursor.  A rectangular box cursor is
  783.  
  784. placed at the center of the current window.  The cursor may be moved 20% of
  785.  
  786. the box dimension by use of the ARROW keys.  The background is preserved.
  787.  
  788. The (+) plus and (-) minus keys are used to expand or shrink the box.  The
  789.  
  790. coordinates of the corners of the box are available to the calling program
  791.  
  792. through the real variables BoxXmin, BoxXmax, BoxYmin and BoxYmax.
  793.  
  794. Formal parameters are:
  795.  
  796.      ColorCursor  : WORD        Color of cursor.
  797.      ShowXY       : BOOLEAN     TRUE => display CursorX and CursorY.
  798.      Col, Row     : INTEGER     Text position for display if ShowXY = TRUE.
  799.      ColorText    : WORD        Color of displayed text if ShowXY = TRUE.
  800.  
  801. Press <ENTER> to exit the procedure.
  802.  
  803. ------------------------------------------------------------------------------
  804.  
  805. Procedure GetPixelArea:
  806.  
  807.     The approximate area of a closed curve of color CurveColor is computed
  808.  
  809. based on the World in effect.  The interior must not be of the same color as
  810.  
  811. CurveColor.  As the area is scanned, the interior is colored with RefillColor.
  812.  
  813. The method is to count the pixels of CurveColor and use XperPixel and
  814.  
  815. YperPixel to caculate the approximate area.  Accuracy depends on size.
  816.  
  817. ------------------------------------------------------------------------------
  818.  
  819. Function MouseOK:
  820.  
  821.     The presence of the mouse hardware and driver are examined.  If both are
  822.  
  823. present, the value TRUE is assigned, otherwise FALSE is assigned.  The mouse
  824.  
  825. system is reset.
  826.  
  827. ------------------------------------------------------------------------------
  828.  
  829. Procedure RestrictMouseToWindow:
  830.  
  831.     The mouse cursor is restricted to move only in the current window.
  832.  
  833. ------------------------------------------------------------------------------
  834.  
  835. Procedure GetMouseXY:
  836.  
  837.     The current real world coordinates of the mouse cursor are returned.
  838.  
  839. ------------------------------------------------------------------------------
  840. Function LeftMouseXY:
  841.  
  842.     If returned TRUE, then X and Y are the real world coordinates of the mouse
  843.  
  844. cursor AND the LEFT BUTTON is currently pressed, ELSE X, Y are not valid.
  845.  
  846. ------------------------------------------------------------------------------
  847.  
  848. Function RightMouseXY:
  849.  
  850.     Same as LeftMouseXY, but refers to RIGHT BUTTON currently pressed.
  851.  
  852. ------------------------------------------------------------------------------
  853.  
  854. Function LeftButtonClicked:
  855.  
  856.     If LEFT BUTTON has been released since last use of this function, TRUE
  857.  
  858. is returned, and X, Y are real world coordinates of the mouse cursor when last
  859.  
  860. released.  If FALSE there has been NO CLICK and X, Y are not valid.
  861.  
  862. ------------------------------------------------------------------------------
  863.  
  864. Function RightButtonClicked:
  865.  
  866.     Same as for LeftButtonClicked, but refers to RIGHT BUTTON released.
  867.  
  868. ------------------------------------------------------------------------------
  869.  
  870. Procedure MousePointer:
  871.  
  872.     The mouse cursor appears, restricted to the current window.  If Show is
  873.  
  874. TRUE, then the X and Y coordinates of the cursor are updated at the indicated
  875.  
  876. text line and column as the cursor is moved.  Also, the message CLICK LEFT
  877.  
  878. TO EXIT is displayed on the same line.  Whether or not SHOW is TRUE, the
  879.  
  880. exit values of X and Y are returned.
  881.  
  882. ------------------------------------------------------------------------------
  883.  
  884. Procedure MouseRubberBox:
  885.  
  886.     The mouse cursor appears, restricted to the current window.  Move cursor
  887.  
  888. and CLICK LEFT to mark upper left corner of a rectangle.  Move cursor down
  889.  
  890. and to right expand the rectangle.  CLICK LEFT to set lower right corner.
  891.  
  892. Now move cursor to move rectangle about screen.  CLICK LEFT once more to exit.
  893.  
  894. IF EraseBox is TRUE the rectangle is erased from screen on exit.  The values
  895.  
  896. of the extremes of the rectangle are returned in X1, X2, Y1, Y2.
  897.  
  898. ------------------------------------------------------------------------------
  899.  
  900. Procedure MouseRubberLine:
  901.  
  902.     The mouse cursor appears, restricted to the current window.  Move cursor
  903.  
  904. and then CLICK LEFT to mark the beginning of a line segment at (X1, Y1).  Move
  905.  
  906. cursor to obtain a line from (X1, Y1) to the current cursor position (X2, Y2).
  907.  
  908. CLICK LEFT to anchor line and exit.  The values of X1,Y1,X2,Y2 are returned.
  909.  
  910. If EraseLine is TRUE, the line is erased on exit.
  911.  
  912. ------------------------------------------------------------------------------
  913.  
  914. Procedure MouseDraw:
  915.  
  916.     The mouse cursor appears, restricted to the current window.  PRESS LEFT
  917.  
  918. while moving mouse to draw.  RELEASE to stop drawing.  CLICK RIGHT to exit.
  919.  
  920. ------------------------------------------------------------------------------
  921.  
  922. Procedure CopyToEpson:
  923.  
  924.     Causes a copy of the CURRENT window graphics to be copied to the system
  925.  
  926. printer.  To be used if printer is EPSON compatible.  If multiple windows
  927.  
  928. are in use, define one window to be the entire screen; selecting this one will
  929.  
  930. result in the entire screen (all windows) being copied to Epson.  Note that all
  931.  
  932. windows are the entire screen by default.
  933.  
  934. ------------------------------------------------------------------------------
  935.  
  936. Procedure CopyToHPLaserJet:
  937.  
  938.     Same as CopyToEpson above, except for use with HP LaserJet printer.
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.