home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / tvision / gtmous / opdemo.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-30  |  4KB  |  87 lines

  1. {*********************************************************}
  2. {*                   GtMOUSE.PAS 1.00                    *}
  3. {*  Copyright (c) I.Evsikov, S.Shmakov & P.Sychov, 1993  *}
  4. {*                 All rights reserved.                  *}
  5. {*           Demo with Object Profesional 1.10           *}
  6. {*    Copyright (c) TurboPower Software 1988, 1989.      *}
  7. {*********************************************************}
  8. {$M 2000,4000, 14000}
  9. program OPDemo;
  10. uses
  11.     gtMouse,
  12.     opMouse,
  13.     Dark,
  14.     opCrt;
  15. Const
  16.   Hand: ImageArray=($C0,$A0,$50,$2B,$15,$2E,$5F,$BF,$7F,$3F,$1F,$1F,$1F,$1F,$00,$00);
  17.  
  18. var
  19.  Finish       : boolean;
  20.  Button       : word;
  21.          CONST newarray : Array[1..8] of Char =
  22.                                    (^A,^B,^C,^T,'╠','═','╬','╧');
  23. var crtmode : byte;
  24. begin
  25.      Randomize;
  26.      crtmode:=getcrtmode;
  27.      Finish:=false;
  28.      InitializeMouse;
  29.      if not MouseInstalled then begin
  30.           writeln('Mouse not installed');
  31.           Halt;
  32.      end;
  33.      EnableEventHandling;
  34.      clrScr;
  35.      LinkUserImageWith(UserArrow,Hand);
  36.      setNewCharacters(newarray);
  37.      SelectNotPressedImage(UserArrow);
  38.      setVGA8x16;
  39.      writeln;
  40.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  41.      writeln('          │GtMouse with OPMouse demo program, (c) 1993, Igor Evsikov.│');
  42.      writeln('          └──────────────────────────────────────────────────────────┘');
  43.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  44.      writeln('          │          Move Cursor, Press Right & Left buttons         │');
  45.      writeln('          │                    Press Esc for Exit                    │');
  46.      writeln('          └──────────────────────────────────────────────────────────┘');
  47.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  48.      writeln('          │                                                          │');
  49.      writeln('          │                                                          │');
  50.      writeln('          │                                                          │');
  51.      writeln('          │                                                          │');
  52.      writeln('          │                                                          │');
  53.      writeln('          │                                                          │');
  54.      writeln('          │                                                          │');
  55.      writeln('          │                                                          │');
  56.      writeln('          │                                                          │');
  57.      writeln('          │                                                          │');
  58.      writeln('          │                                                          │');
  59.      writeln('          └──────────────────────────────────────────────────────────┘');
  60.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  61.      writeln('          │                 S l e e p i n g   H e r e                │');
  62.      writeln('          └──────────────────────────────────────────────────────────┘');
  63.      window(30, 10, 60, 20);
  64. {**********************************************************************}
  65.      ShowMouse;                                    { display the cursor }
  66. {***********************************************************************}
  67.      HiddenCursor;
  68.      repeat
  69.        if MousePressed then begin
  70.           hideMouse; { we hide the cursor }
  71.           Button:=MouseKeyWord;
  72.           if Button=MouseLft then   writeLn('Left Button Pressed');
  73.           if Button=MouseRt then writeLn('Right Button Pressed');
  74.           if Button=MouseBoth then writeLn('Both Buttons Pressed');
  75.           showMouse; { display the cursor }
  76.        end;
  77.        if keypressed then Finish:=(readKey=^[);
  78.        InitSleeper(Random(5),10,10,22,70,24);
  79.        Sleeper;
  80.      until Finish;
  81.      hideMouse; { we hide the cursor }
  82.      DisableEventHandling;
  83.      ReturnVGA:=true;
  84.      NormalCursor;
  85. end.
  86. 
  87.