- ChangeZoomBy(ADelta, zoCursor);
- ScrollCenter(CursorPos); ChangeZoomBy(ADelta, zoCenter);
- ZoomGraph;
- ZoomRect(ARect);
- ChangeZoom(100, zoTopLeft);
Kambiz wrote:elias's idea is somehow combination of zoCursor and zoCenter.
I think he wants it a bit fancy and animated like. As soon as initial and final states are known, he can throw in a few intermediate steps.Kambiz wrote:The point under cursor should move toward center.
procedure TMainForm.SimpleGraphMouseWheelDown(Sender: TObject;
Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
var
I: Integer;
begin
MousePos := SimpleGraph.ScreenToClient(MousePos);
if PtInRect(SimpleGraph.ClientRect, MousePos) then
begin
for I := 1 to 5 do
begin
SimpleGraph.ChangeZoomBy(-1, zoCursor);
SimpleGraph.Update;
end;
Handled := True;
end;
end;
procedure TMainForm.SimpleGraphMouseWheelUp(Sender: TObject;
Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
var
I: Integer;
begin
MousePos := SimpleGraph.ScreenToClient(MousePos);
if PtInRect(SimpleGraph.ClientRect, MousePos) then
begin
for I := 1 to 5 do
begin
SimpleGraph.ChangeZoomBy(+1, zoCursor);
SimpleGraph.Update;
end;
Handled := True;
end;
end;
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 1 guest