home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / das_buch / dos / mausdemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-29  |  1.5 KB  |  48 lines

  1. {$A+,B-,D-,E-,F-,G-,I-,L-,N-,O-,P-,Q-,R-,S-,T-,V-,X-,M 16384,0,655360}
  2. (*===================================================================*)
  3. (*                           MAUSDEMO.PAS                            *)
  4. (*         Demonstration der Routinen der Unit MOUSE.PAS             *)
  5. (*            Copyright (C) 1993 te-wi Verlag, München               *)
  6. (*===================================================================*)
  7.  
  8. PROGRAM MouseDemonstration;
  9.  
  10. USES
  11.   Dos, Graph, Crt, Mouse;
  12.  
  13. VAR
  14.   gd,  gm : INTEGER;
  15.   s1,  s2 : STRING;
  16.   x, y    : INTEGER;
  17.  
  18. BEGIN
  19.   DetectGraph(gd, gm);
  20.   InitGraph(gd, gm, GetEnv('BGIPATH'));
  21.   IF GraphResult <> grOk THEN Halt(1);
  22.   Rectangle(49, 49, GetMaxX - 49, GetMaxY - 49);
  23.   SetMouseWindow(50, 50, GetMaxX - 50, GetMaxY - 50);
  24.   DisplayCursor;
  25.   GraphCursor(0, 0, ArrowCursor);
  26.   SetTextJustify(CenterText, CenterText);
  27.   OutTextXY(GetMaxX DIV 2, GetMaxY - 30,
  28.      'Punkte setzen mit linker Maustaste');
  29.   OutTextXY(GetMaxX DIV 2, GetMaxY - 15, 'Ende mit rechter Maustaste');
  30.   SetTextJustify(LeftText, TopText);
  31.   REPEAT
  32.    LeftXY(x, y);
  33.    PutPixel(x, y, LightCyan);
  34.    SetColor(White);
  35.    Str(Mouse.WhereX, s1);
  36.    OutTextXY(10, 10, s1);
  37.    Str(Mouse.WhereY, s2);
  38.    OutTextXY(100, 10, s2);
  39.    SetColor(Black);
  40.    OutTextXY(10, 10, s1);
  41.    OutTextXY(100, 10, s2);
  42.   UNTIL Pressed = Right;
  43.   HideCursor;
  44.   CloseGraph;
  45. END.
  46.  
  47. (*===================================================================*)
  48.