home *** CD-ROM | disk | FTP | other *** search
-
-
- program mtrial;
- { demonstration program. get two points with the mouse and
- connect them with a line }
-
- type
- curarray = array[0..31] of INTEGER;
-
- var
- cursor : curarray;
- i,nbut,mx,my,mbt,x,y : integer;
- {$I MOUSE.PAS }
-
- procedure bdraw;
- begin
- gotoxy(1,2);
- write('Use left button for first point, right button for second point.');
- mshow;
- repeat
- mpos(mbt,x,y)
- until mbt=1;
- mhide;
- plot(x,y,1);
- mshow;
- repeat
- mpos(mbt,mx,my)
- until mbt=2;
- mhide;
- draw (x,y,mx,my,1);
- end;
-
- begin {MTRIAL main line}
- for i := 0 to 3 do {load cursor image in hex}
- cursor[i] := $FFFF; {these values could be set up as typed constants}
- cursor[4] := $F00F;
- for i := 5 to 10 do
- cursor[i] := $F7EF;
- cursor[11] := $F00F;
- for i := 12 to 15 do
- cursor[i] := $FFFF;
- for i := 16 to 19 do
- cursor[i] := $0000;
- cursor[20] := $0FF0;
- for i := 21 to 26 do
- cursor[i] := $0810;
- cursor[27] := $0FF0;
- for i := 28 to 31 do
- cursor[i] := $0000;
- HiRes;
- HiResColor(10); {set color green}
- mstatus(i,nbut); {initialize mouse}
- mshape(8,8,cursor); {set cursor shape}
- mshow; {display cursor}
- bdraw {get 2 points and draw line}
- end.
-
-