Page 1 of 1

How to disable "auto-scrolling" in TSRichViewEdit?

Posted: Mon Feb 21, 2022 2:38 pm
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...

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

Posted: Tue Feb 22, 2022 9:00 am
by Sergey Tkachenko
Can you give me step-by-step instructions how to reproduce this problem?

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

Posted: Tue Feb 22, 2022 9:44 am
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)

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

Posted: Mon Feb 28, 2022 1:13 pm
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.