Recent

Author Topic: TRichmemo wheel speed  (Read 6847 times)

Ign_17

  • New Member
  • *
  • Posts: 43
TRichmemo wheel speed
« on: May 03, 2018, 09:36:06 am »
Hi Everybody.

I am using the Trichmemo component in a project, and there is some behavior related with the wheel speed i can´t take control over.
I have compiled the project under several lazarus versions, 32 and 64 bit, and sometimes the speed of the wheel is fast, but in most cases the speed is low. But i do not modifiy nothing, it seems to be a default value that controls the wheel speed. (I mean, the number of lines in a TRichmemo that moves up or down when using the mouse wheel). 

¿Does anybody knows what is the variable or property that controls the speed of the wheel on Trichmemo component?

Thanks in advance.
« Last Edit: May 03, 2018, 12:00:05 pm by Ign_71 »

Ign_17

  • New Member
  • *
  • Posts: 43
Re: TRichmemo wheel speed
« Reply #1 on: May 03, 2018, 10:55:58 am »
Well, i must correct something in the last post.
I think the problem with the wheel speed on TRichmemo component it seems to be something related with the lazarus version. With version 1.6.4 the wheel goes fast, but with version 1.8.2 the wheel speed is low.

I don´t know exactly what could be the reason for this...

Regards.
« Last Edit: May 03, 2018, 11:57:38 am by Ign_71 »

rick2691

  • Sr. Member
  • ****
  • Posts: 444
Re: TRichmemo wheel speed
« Reply #2 on: May 03, 2018, 12:57:26 pm »
I have the same problem with 1.8.2, and I have gone back to 1.6.4

There are other issues that have with 1.8.2, and they are with all applications, whether they are 32bit or 64bit. I don't have time to mess with anything that I don't know how to fix.

Rick
Windows 11, LAZ 2.0.10, FPC 3.2.0, SVN 63526, i386-win32-win32/win64, using windows unit

vladimirr

  • New Member
  • *
  • Posts: 29
Re: TRichmemo wheel speed
« Reply #3 on: January 29, 2020, 03:41:26 pm »
I have the same problem  :(
I've sent a bug report https://bugs.freepascal.org/view.php?id=36636
Hope @skalogryz can fix it.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: TRichmemo wheel speed
« Reply #4 on: January 29, 2020, 04:17:55 pm »
few questions.
1) is there a sample RTF? (related to the second question)

2) how's RichMemo scrolling works compared to Windows Wordpad on the same RTF?

vladimirr

  • New Member
  • *
  • Posts: 29
Re: TRichmemo wheel speed
« Reply #5 on: January 29, 2020, 08:26:16 pm »
RichMemo mouse scrolling works always slow compared to Wordpad on the same RTF.




vladimirr

  • New Member
  • *
  • Posts: 29
Re: TRichmemo wheel speed
« Reply #6 on: January 30, 2020, 09:38:38 am »
A bug was fixed. Thank you, Dmitry!

antoniog

  • New member
  • *
  • Posts: 7
Re: TRichmemo wheel speed
« Reply #7 on: June 12, 2020, 01:15:52 am »
example
Code: Pascal  [Select][+][-]
  1. procedure TCapitolatoF.RichMemo1MouseWheel(Sender: TObject; Shift: TShiftState;
  2.   WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
  3. begin
  4.   case WheelDelta of
  5.     120: begin
  6.       SendMessage(RichMemo1.Handle, EM_LINESCROLL,0,-1);
  7.     end;
  8.     -120: begin
  9.       SendMessage(RichMemo1.Handle, EM_LINESCROLL,0,1);
  10.     end;
  11.   end;
  12. end;  
  13.  

rick2691

  • Sr. Member
  • ****
  • Posts: 444
Re: TRichmemo wheel speed
« Reply #8 on: October 24, 2020, 02:34:49 pm »
Code: Pascal  [Select][+][-]
  1. // The following will give you complete control:
  2.  
  3. procedure TCmdForm.PageMemoWheelDown(Sender: TObject; Shift: TShiftState;     // scroll-wheel down
  4.                                      MousePos: TPoint; var Handled: Boolean); // for line or image
  5. begin
  6.   PageMemo.VertScrollBar.Position:= PageMemo.VertScrollBar.Position + 20;  // + 20 is twips down
  7.   Handled:= true; // set to "true" over-rides system response              // as one 12pt line
  8. end;
  9.  
  10. procedure TCmdForm.PageMemoWheelUp(Sender: TObject; Shift: TShiftState;     // scroll-wheel up
  11.                                    MousePos: TPoint; var Handled: Boolean); // for line or image
  12. begin
  13.   PageMemo.VertScrollBar.Position:= PageMemo.VertScrollBar.Position - 20;  // - 20 is twips up
  14.   Handled:= true; // set to "true" over-rides system response              // as one 12pt line
  15. end;                    
  16.  
  17.  
  18. // set these as reactors to the page events
  19.  
  20. OnMouseWheelUp:= @PageMemoWheelUp;     // controls image & text scrolling
  21. OnMouseWheelDown:= @PageMemoWheelDown; // controls image & text scrolling
  22.  
  23.  
  24. // the above is for when pages are built on-the-fly.
  25. // normally you would just reference the procedures to the page events.
  26.  
  27. // as noted, this uses the same speed for images in the file;
  28. // without them an image is treated as a line.

[Edited to add code tags - please see How to use the Forum]
« Last Edit: October 24, 2020, 03:52:02 pm by trev »
Windows 11, LAZ 2.0.10, FPC 3.2.0, SVN 63526, i386-win32-win32/win64, using windows unit

 

TinyPortal © 2005-2018