|
Turbo Pascal Twoje źródło wiedzy o Turbo Pascalu. |
|
|
|
|
|
![](http://picsrv.fora.pl/Avalanche/images/thLeft_quote.gif) |
Śro 10:17, 24 Maj 2006 |
![](http://picsrv.fora.pl/Avalanche/images/thRight.gif) |
Autor |
Wiadomość |
PoOm
Początkujący
Dołączył: 23 Maj 2006
Posty: 15
Przeczytał: 0 tematów
Ostrzeżeń: 2/3 Skąd: Thousand thousand miles away..
|
Temat postu: PoOm present: MOUSE |
|
|
Kod: |
unit M_mouse;
interface
uses Dos;
type
{MOUSE OBJECT}
Mouse = object
x,y:integer;
button:word;
r:registers;
constructor Ini(x1,y1,x2,y2:integer);
destructor Dead;
procedure Show;
procedure Hidden;
procedure Get;
end;{Object Mause}
implementation
constructor Mouse.Ini(x1,y1,x2,y2:integer);
begin
r.ax:=$0007;
r.cx:=x1;
r.dx:=x2;
Intr($33,r);
r.ax:=$0008;
r.cx:=y1;
r.dx:=y2;
Intr($33,r);
end;{mouse constructor}
procedure Mouse.Show;
begin
r.ax:=$0001;
Intr($33,r);
end;{mouse show}
procedure Mouse.Hidden;
begin
r.ax:=$0002;
Intr($33,r);
end;{mouse hidden}
procedure Mouse.Get;
begin
r.ax:=$0003;
Intr($33,r);
x:=r.cx;
y:=r.dx;
button:=r.bx;
end;{mouse get}
destructor Mouse.Dead;
begin
r.ax:=$0000;
Intr($33,r);
end;{mouse dead ^;;^}
{End of def Mouse object}
begin
end.
|
OPISY:
Mouse.Ini(x1,y1,x2,y2:integer);
Inicjalizacja myszy: x1,y1,x2,y2 - obaszary ograniczen poruszania sie kursora. Np: Obiekt_myszy.Ini(0,0,400,400);
I porusza sie kursor tylko do 400/400
procedure Mouse.Show;
Pokazuje mysze....Wystarczy raz wlaczyc i bedzie dzialac.
Do momentu az sie ja wylaczy.
procedure Mouse.Hidden;
Chowa mysz.
procedure Mouse.Get;
Pobieramy stan klawiszy. Oraz wspx myszy (x/y).
if(Obiekt_myszy.button=1 ) then (zostal nacisniety lewy przycisk myszy)
Post został pochwalony 0 razy
|
|
|
|
|
|
|
![](http://picsrv.fora.pl/subSilver/images/spacer.gif) |
![Odpowiedz do tematu](http://picsrv.fora.pl/Avalanche/images/lang_polish/reply.gif) |
|
![](http://picsrv.fora.pl/Avalanche/images/thLeft.gif) |
|
![](http://picsrv.fora.pl/Avalanche/images/thRight.gif) |
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach
|
|
|
|
|
|
|
fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|