How to disable "auto-scrolling" in TSRichViewEdit?

General TRichView support forum. Please post your questions here
Post Reply
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

How to disable "auto-scrolling" in TSRichViewEdit?

Post by Vitalii »

Hi everyone!

Is it possible to disable automatic scrolling in TSRichViewEdit? Scrolling starts automatically when, for example, I edit a math equation, then close the editor, and simply move the cursor up or down. If then I click in the editor (set focus), scrolling is stopped.

I reviewed all topics of the forum about scrolling but did not find an answer...
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to disable "auto-scrolling" in TSRichViewEdit?

Post by Sergey Tkachenko »

Can you give me step-by-step instructions how to reproduce this problem?
Vitalii
Posts: 61
Joined: Sat Oct 20, 2018 2:55 pm

Re: How to disable "auto-scrolling" in TSRichViewEdit?

Post by Vitalii »

Sergey Tkachenko wrote: Tue Feb 22, 2022 9:00 am Can you give me step-by-step instructions how to reproduce this problem?
Yes, it's very simple. There is a test program in the archive. What we need to do:
1) run the program
2) add equation
3) double-click on the equation, close the editor
4) move cursor down to the bottom (no clicks)
5) move cursor up, to the top of the editor and beyond (no clicks)

I noticed that this scrolling is dynamic (responds to the intensity of movement and cursor position). Very similar to finger movements on a smartphone.

I also recorded the whole process on video:
https://youtu.be/vuJ4-xHYV9E

I hope it helps)
Attachments
srve_scroll.zip
(58.03 KiB) Downloaded 763 times
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to disable "auto-scrolling" in TSRichViewEdit?

Post by Sergey Tkachenko »

It happens because the dialog "eats" a mouse up message, and the editor thinks that mouse selection continues.
In SclRView.pas, find procedure TSRichViewEdit.MouseMove, and add at the very beginning of this method (after all sub-procedures):

Code: Select all

  if (srvs_IsScrollTimer in FState) and not (ssLeft in Shift) then
    SetScrollTimer(False);
I'll add this change in the next update.
Post Reply