Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

Mouse wheel and scroll increment

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ere Maijala

Hi,

I was checking why TScrollBox scrolls so slowly with the mouse wheel. I found out that TControlScrollBar.ScrollHandler doesn't take FIncrement into account when scrolling causing it to scroll typically only three pixels per wheel click. I also noticed that there are a couple of places where higher level scroll handlers are used to get around this issue, but would it make sense to do it in TControlScrollBar instead? I'm thinking about a change like this:

Index: controlscrollbar.inc
=================================================================== --- controlscrollbar.inc (revision 19278)
+++ controlscrollbar.inc (working copy)
@@ -377,7 +377,7 @@
SB_PAGEDOWN:

        Inc(NewPos, FPage);
      SB_THUMBPOSITION, SB_THUMBTRACK:

- NewPos := Message.Pos;
+ NewPos := FPosition + (Message.Pos - FPosition) * FIncrement; SB_TOP:

        NewPos := 0;
      SB_BOTTOM:

Regards,

Ere

Reply by email