Registriert seit: 2. Feb 2003
611 Beiträge
Delphi 2009 Professional
|
Re: Scrollbox mit Mousemopve beeinflussen
9. Mai 2005, 12:28
Hmm scheitn immer noch nicht richtig zu funktionieren
Hier einfach mal der gesamte "Bewegungs"-Code
Delphi-Quellcode:
procedure TPic_chldfrm.ImageMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
IsMoved := True;
StartX := X;
StartY := Y;
MoveX := X;
MoveY := Y;
Scrollbox1.DoubleBuffered := True;
end;
cursor :=crhandpoint;
end;
procedure TPic_chldfrm.ImageMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if isMoved then
begin
if (X <> MoveX) then
scrollbox1.horzScrollBar.Position :=scrollbox1.horzScrollBar.Position+ round((X - StartX) div 2);
if (Y <> MoveY) then
scrollbox1.VertScrollBar.Position :=scrollbox1.VertScrollBar.Position+ round((Y - StartY) div 2);
//MoveX := X;
//MoveY := Y;
x :=MoveX;
y :=MoveY;
end;
end;
procedure TPic_chldfrm.ImageMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
IsMoved := False;
Scrollbox1.DoubleBuffered := False;
end;
cursor :=crdefault;
end;
Max „If you have any great suggestions, feel free to mail me, and I'll probably feel free to ignore you.“ . Linus Torvalds
|