home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / gtmouse / opdemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-01-24  |  3.7 KB  |  75 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. program OPDemo;
  9. uses
  10.     gtMouse,
  11.     opMouse,
  12.     opCrt;
  13. Const
  14.   Hand: ImageArray=($C0,$A0,$50,$2B,$15,$2E,$5F,$BF,$7F,$3F,$1F,$1F,$1F,$1F,$00,$00);
  15.  
  16. var
  17.  Finish       : boolean;
  18.  Count        : word;
  19.  LastX,LastY  : byte;
  20. begin
  21.      Finish:=false;
  22.      InitializeMouse;
  23.      if not MouseInstalled then begin
  24.           writeln('Mouse not installed');
  25.           Halt;
  26.      end;
  27.      EnableEventHandling;
  28.      clrScr;
  29.      writeln;
  30.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  31.      writeln('          │GtMouse with OPMouse demo program, (c) 1993, Igor Evsikov.│');
  32.      writeln('          └──────────────────────────────────────────────────────────┘');
  33.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  34.      writeln('          │          Move Cursor, Press Right & Left buttons         │');
  35.      writeln('          │                    Press Esc for Exit                    │');
  36.      writeln('          └──────────────────────────────────────────────────────────┘');
  37.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  38.      writeln('          │                                                          │');
  39.      writeln('          │                                                          │');
  40.      writeln('          │                                                          │');
  41.      writeln('          │                                                          │');
  42.      writeln('          │                                                          │');
  43.      writeln('          │                                                          │');
  44.      writeln('          │                                                          │');
  45.      writeln('          │                                                          │');
  46.      writeln('          │                                                          │');
  47.      writeln('          │                                                          │');
  48.      writeln('          │                                                          │');
  49.      writeln('          └──────────────────────────────────────────────────────────┘');
  50.      window(30, 10, 60, 20);
  51. {**********************************************************************}
  52.      LinkUserImageWith(UserArrow,Hand);
  53.      SelectNotPressedImage(UserArrow);
  54.      ShowMouse;                                    { display the cursor }
  55. {***********************************************************************}
  56.      repeat
  57.            DRAWARROW;           {To make the cursor movement more smooth }
  58.            {^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
  59.            if MouseButtonPressed(leftButton,Count,LastX,LastY) then begin
  60.               hideMouse; { we hide the cursor }
  61.               writeLn('Left Button Pressed');
  62.               showMouse; { display the cursor }
  63.            end;
  64.            if  MouseButtonPressed(RightButton,Count,LastX,LastY) then begin
  65.               hideMouse; { we hide the cursor }
  66.               writeLn('Right Button Pressed');
  67.               showMouse; { display the cursor }
  68.            end;
  69.            if keypressed then Finish:=(readKey=^[);
  70.      until Finish;
  71.      hideMouse; { we hide the cursor }
  72.      DisableEventHandling;
  73. end.
  74. 
  75.