I find that when using a mouse wheel to scroll through a long list implemented with TDrawStringGrid, the scrolling speed is so high that it makes borderline unusable. A tiny movement on the wheel translates in more than a pageful of items - it's more than annoying, it's just unusable, very quickly one gives up and goes to use the scrollbar instead.
Today, after yet another complaint from a user, I decided to find a solution, and I came up with the following approach: an Integer property WheelBrakes which slows down the scrolling speed as follows.
TMyDrawGrid = class (TDrawGrid)
private
fWheelCount: integer;
fWheelDelta: integer;
fWheelBrakes: integer;
protected
procedure GridMouseWheel(shift: TShiftState; Delta: Integer); override;
published
property WheelBrakes: integer read fWheelBrakes write fWheelBrakes;
end;
Implementation:
procedure TMyDrawGrid.GridMouseWheel(shift: TShiftState; Delta: Integer);
begin
if WheelBrakes > 0 then begin
if fWheelDelta <> Delta then begin
fWheelDelta := delta;
fWheelCount := 0;
end;
inc(fWheelCount);
if fWheelCount <= fWheelBrakes then exit;
fWheelCount := 0;
end;
inherited GridMouseWheel(shift, Delta);
end;
Basically, if WheelBrakes > 0, a corresponding number of scroll commands are skipped, and the scrolling becomes correspondingly slower. I find that WheelBrakes = 4 is about right for my purposes.
I hope this may be useful to someone.
Best regards to all!