Recent

Author Topic: TRichmemo wheel speed  (Read 3214 times)

Ign_17

  • New Member
  • *
  • Posts: 38
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: 38
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: 376
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 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

vladimirr

  • New Member
  • *
  • Posts: 21
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: 2520
    • 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?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

vladimirr

  • New Member
  • *
  • Posts: 21
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: 21
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: 376
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 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

 

TinyPortal © 2005-2018