home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / gtmouse / libdemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-01-24  |  3.1 KB  |  65 lines

  1. {*********************************************************}
  2. {*                   GtMOUSE.PAS 1.00                    *}
  3. {*  Copyright (c) I.Evsikov, S.Shmakov & P.Sychov, 1993  *}
  4. {*                 All rights reserved.                  *}
  5. {*                 Demo with mouseLib6                   *}
  6. {*********************************************************}
  7. program LibDemo;
  8.  
  9. uses
  10.    gtMouse,
  11.    mouseLib,
  12.    Crt;
  13.  
  14. var Finish : boolean;
  15. begin
  16.      clrScr;
  17.      Finish:=false;
  18.      if not (mouse_present) then begin
  19.      { mouse_present was set by the mouseLib initialization code .. }
  20.           write('mouse not installed');
  21.           exit;
  22.      end;
  23.      writeln;
  24.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  25.      writeln('          │GtMouse with MouseLib6 demo program,(c) 1993 ,Igor Evsikov│');
  26.      writeln('          └──────────────────────────────────────────────────────────┘');
  27.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  28.      writeln('          │          Move Cursor, Press Right & Left buttons         │');
  29.      writeln('          │                    Press Esc for Exit                    │');
  30.      writeln('          └──────────────────────────────────────────────────────────┘');
  31.      writeln('          ┌──────────────────────────────────────────────────────────┐');
  32.      writeln('          │                                                          │');
  33.      writeln('          │                                                          │');
  34.      writeln('          │                                                          │');
  35.      writeln('          │                                                          │');
  36.      writeln('          │                                                          │');
  37.      writeln('          │                                                          │');
  38.      writeln('          │                                                          │');
  39.      writeln('          │                                                          │');
  40.      writeln('          │                                                          │');
  41.      writeln('          │                                                          │');
  42.      writeln('          │                                                          │');
  43.      writeln('          └──────────────────────────────────────────────────────────┘');
  44.      window(30, 10, 60, 20);
  45.      showMouseCursor; { display the cursor }
  46.      repeat
  47.            DRAWARROW;
  48.            if getButton(leftButton) = buttonDown then
  49.            begin
  50.               hideMouseCursor; { we hide the cursor }
  51.               writeLn('Left Button Pressed');
  52.               showMouseCursor; { display the cursor }
  53.            end;
  54.            if getButton(rightButton) = buttonDown then
  55.            begin
  56.               hideMouseCursor; { we hide the cursor }
  57.               writeLn('Right Button Pressed');
  58.               showMouseCursor; { display the cursor }
  59.            end;
  60.            if keypressed then Finish:=(readKey=^[);
  61.      until Finish;
  62.      hideMouseCursor; { we hide the cursor }
  63. end.
  64. 
  65.