Page 1 of 1

WheelEvent queue in the OnZoom handler

Posted: Tue Apr 05, 2022 2:58 pm
by 16590113
Our test team performs negative testing.
The testers have discovered a performance issue using the MouseWheel zoom.
They roll the wheel is both directions rapidly and multiple times.
This causes the WheelEvent queue to load up.
The user stops the wheel movement, but the Zoom in/out actions continue on the screen for some time as the queue is emptied.

Is there a way to clear the WheelEvent queue in the OnZoom handler?

Re: WheelEvent queue in the OnZoom handler

Posted: Thu Apr 07, 2022 9:50 pm
by Marc
Hello,

Is the test being run on an older PC? We can't reproduce the issue on straightforward tests.

You can likely use the following two events and run a counter in there:

Code: Select all

procedure TForm1.Chart1MouseWheel(Sender: TObject; Shift: TShiftState;
  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
 //check counter...
end;

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  //check counter... set following until counters coincide
  Chart1.AllowZoom :=False;
end;
Regards,
Marc Meumann