home *** CD-ROM | disk | FTP | other *** search
- {▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒}
- {▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ UNIT GTMouse.pas v.1.1▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒}
- {▒▒ (c) 1993 Copyright JINR, Dubna by I. Evsikov, S. Shmakov, P. Sychov ▒▒}
- {▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒}
-
- UNIT GTMouse;
-
- interface
-
- uses DOS;
-
- Type
-
- tDisplay = (VGA,EGA,NogrMouse);
- imageArray = array[0..15] of byte;
- ImageNames = (
- NormalArrow, DragArrow,
- DragArrowL, DragArrowR,
- ClockArrow, HandArrow,
- Hand1Arrow, Clock2Arrow,
- Hand2Arrow, BigArrow,
- SU29Arrow, Hand3Arrow,
- PencilArrow, FootArrow,
- PlusArrow, Big2Arrow,
- SightArrow, UserArrow);
-
- dPoint=record
- X:word;
- Y:word;
- end;
-
- const
-
- UpperHandler : pointer = nil;
- SaveHandle : pointer=nil;
- grMouse : boolean = false;
- grShow : boolean = false; { True if arrow curros is visible }
- _ScreenWidth : integer = 80; { Screen Width }
- _ScreenHeight : integer = 25; { Screen Height }
- _ButtonCount : integer = 0;
-
- var
-
- crMouseStatus : byte;
- ImageNoPressed : ImageNames;
- ImagePressed : ImageNames;
- DisplayType : tDisplay;
- _VideoSegment : WORD; {Segment of Video Memory }
- _MouseWhere : dPoint; { Current Mouse position }
-
-
-
- { MAIN PROCEDURES }
- { --------------- }
-
-
-
- Procedure InitGtMouse;
-
- { Reactivate GTMouse. }
- { Detect mouse driver, reinitiate Arrow Mouse, set Event Handler, }
- { initiate variables, select default Mouse Image etc. }
- { GTMouse initiates automatically, so this procedure is nessesary only }
- { after deactivating of GTMouse by DoneMouse. }
-
-
- Procedure DoneGtMouse;
-
- { Deactivate GTMouse CORRECTLY. }
- { Use this procedure before exit to DOS or start child process }
- { or before any screen mode changing }
-
-
-
- Procedure DrawArrow;
-
- { Redraw mouse cursor. }
- { GTMouse call this procedure at any timer tick (about 18 times per sec) }
- { To improve the smoothnes of cursor movement include this procedure }
- { to any event wait cycle of your program }
-
-
-
-
-
- { ADDITIONAL PROCEDURES }
-
-
-
- Procedure SelectNotPressedImage( NameOfImage : ImageNames);
-
- { Select new notpressed mouse cursor image. }
- { For example: }
- { SelectNotPressedImage(FootArrow); }
-
-
-
- Procedure SelectPressedImage( NameOfImage : ImageNames);
-
- { Select new pressed mouse cursor image. }
- { For example: }
- { ... }
- { SelectPressedImage(ClockArrow); }
-
-
-
- Procedure SetNewCharacters( var CharSet);
-
- { Set new Character Array for mouse cursor building. }
- { Parameter is 8-bytes array of chars. }
- { This array is used to construct the grahics mouse cursor form }
- { as superposition of four characters adjacent to mouse position }
- { and mouse cursor image. Eight symbols are used because of VGA }
- { peculiarities in text mode. Last four symbols must be in pseudo }
- { graphics range ($c0..$df), first ones have not to be in this range. }
- { You have to avoid usage of these symbols on your screen images. }
- { Null symbol at any position means not to change this symbol. }
- { Default array is (^A,^B,^C,^D,'╨','╥','╫','╪'). }
- { For example: }
- { CONST newarray : Array[1..8] of Char = }
- { (^A,^B,^C,^T,'╠','═','╬','╧); }
- { ... }
- { (*Hide mouse cursor befor set new characters*) }
- { SetNewCharacters(newarray); }
-
-
-
- Procedure LinkUserImageWith(
- ArrowName : ImageNames;
- var UserImage : ImageArray);
-
- { Define User Mouse Cursor Image with ArrowName from ImageNames. }
- { Example: }
- { CONST MyArrow : ImageArray = }
- { ($00,$00,$18,$18,$18,$18,$00,$C3,$00,$18,$18,$18,$18,$00,$00,$00); }
- { ... }
- { LinkUserImageWith(UserArrow,MyArrow); }
- { SelectNotPressedImage(UserArrow); }
-
-
-
-