Recent

Author Topic: [SOLVED] Very slow scrolling on windows  (Read 9991 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1055
[SOLVED] Very slow scrolling on windows
« on: March 30, 2011, 03:24:58 pm »
Hi,

I notify that on windows scrollbars are scrolling very slow (mouse wheel or arrows on scrollbars). Nothing matters if I have TScrollBar.Increment = 0 or 300, speed is always this same. On GTK scrollbars works better. Tested with TScrollBox and TIPHTMLPanel (stable Lazarus 0.9.30). Any idea how tweak this?

Regards.
« Last Edit: April 07, 2011, 11:23:41 pm by Dibo »

eny

  • Hero Member
  • *****
  • Posts: 1646
Re: Very slow scrolling on windows
« Reply #1 on: March 30, 2011, 03:40:13 pm »
I'm assuming this is because the mouse scroll speed is configured in the windows control panel (Mouse config).
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: Very slow scrolling on windows
« Reply #2 on: March 30, 2011, 06:05:03 pm »
Yes but TSynEdit and TMemo scrollbars works normal.

SunyD

  • Guest
Re: Very slow scrolling on windows
« Reply #3 on: April 06, 2011, 11:15:29 pm »
Hi,

I notify that on windows scrollbars are scrolling very slow (mouse wheel or arrows on scrollbars). Nothing matters if I have TScrollBar.Increment = 0 or 300, speed is always this same. On GTK scrollbars works better. Tested with TScrollBox and TIPHTMLPanel (stable Lazarus 0.9.30). Any idea how tweak this?

Regards.

Just I had same problem with TIpHtmlPanel.
I am changing LHelp for Tabbed-View and some other things.
Google showed me this topic so i had solve it self.

Now it scrolls good, just add in TIpHtmlPanel this lines:

In \lazarus\components\turbopower_ipro\iphtml.pas

Code: [Select]
TIpHtmlInternalPanel = class(
  ...
  protected
    //you can add at line 3123:
    function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; //sunyd
...
end;

//you can add at line 17690
function TIpHtmlInternalPanel.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean;
begin
  Result:=inherited DoMouseWheel(Shift, WheelDelta, MousePos);
  if WheelDelta < 0 then Perform(WM_VSCROLL, MAKELONG(SB_PAGEDOWN, 0), 0)
  else Perform(WM_VSCROLL, MAKELONG(SB_PAGEUP, 0), 0);
end;

You don't need recompile Lazarus. Just compile turbopoweripro.lpk from same folder again and all new compiled programms will be use this modification.

There is in TIpHtmlInternalPanel class 2 other MousWheelfunctions:
-DoOnMouseWheel
-MouseWheelHandler
But they don't called. I check them with debugger.

You will be happy with my solution :)


Edit:
Use this Code if you don't want pagescroll. This is like firefox many lines scroll.
Quote
function TIpHtmlInternalPanel.DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; //sunyd
var I : Integer;
begin
  Result:=inherited DoMouseWheel(Shift, WheelDelta, MousePos);
  if WheelDelta < 0 then begin
    for I := 1 to 10 do Perform(WM_VSCROLL, MAKELONG(SB_LINEDOWN, 0), 0);
  end
  else if WheelDelta > 0 then begin
    for I := 1 to 10 do Perform(WM_VSCROLL, MAKELONG(SB_LINEUP, 0), 0);
  end;
end; 
« Last Edit: April 06, 2011, 11:25:39 pm by SunyD »

Dibo

  • Hero Member
  • *****
  • Posts: 1055
Re: Very slow scrolling on windows
« Reply #4 on: April 07, 2011, 11:23:15 pm »
It is working perfect! You should report this trick as patch on http://bugs.freepascal.org . I resigned from TScrollBox in my project so your solution for TIpHTMLPanel solve all my problems with scrolling. Thanks and regards.

 

TinyPortal © 2005-2018