Text disappears after Typing in ScaleRichView with scaling (150%)

General TRichView support forum. Please post your questions here
Post Reply
tomr
Posts: 25
Joined: Wed Dec 09, 2020 9:36 am

Text disappears after Typing in ScaleRichView with scaling (150%)

Post by tomr »

Hi, I have the following problem:
In my program, I use the ScalerichviewEdit. In Windows, a scaling of 150% is configured.
The Scalerichview already contains the following Text:
Already Contained Text.png
Already Contained Text.png (18.69 KiB) Viewed 4508 times
If I open the text with scaling and click at the end of the text, the cursor seems to change to the beginning.
ClickWithScaling.png
ClickWithScaling.png (31.73 KiB) Viewed 4508 times
Additionally, I can not properly select the different parts of the text.

If I manually change the cursor to the end of the document and type in one letter the ScaleRichview is displayed white.
AfterTypingWithScaling.png
AfterTypingWithScaling.png (34.79 KiB) Viewed 4508 times
After scrolling up or pressing the left arrow key, everything displays normally again.
AfterScrollUp_LeftArrow.png
AfterScrollUp_LeftArrow.png (28.01 KiB) Viewed 4508 times
Do you have any suggestions regarding what might be causing this issue? If you need more information about the properties or settings, please let me know.

Thank you!
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Text disappears after Typing in ScaleRichView with scaling (150%)

Post by Sergey Tkachenko »

I cannot reproduce this problem.

Do you use the newest version of ScaleRichView?
tomr
Posts: 25
Joined: Wed Dec 09, 2020 9:36 am

Re: Text disappears after Typing in ScaleRichView with scaling (150%)

Post by tomr »

Hi Sergey,
yes i use the newest version of Scalerichview.
i tried reproducing this effect using the Scalerichview "Action Test Demo". Unfortunately i could not reproduce it.
It seems like this is a problem caused by other code.
tomr
Posts: 25
Joined: Wed Dec 09, 2020 9:36 am

Re: Text disappears after Typing in ScaleRichView with scaling (150%)

Post by tomr »

Hi Sergey,
After analyzing and debugging my Code I found a solution for my described issue.
If I use an invalidate instead of an update in the method TRVScroller.SetVPos
RVScroller SetVPos Invalidate.png
RVScroller SetVPos Invalidate.png (91.35 KiB) Viewed 2095 times
everything is displayed correctly.
It seems that the difference between these two is that invalidate is handled with "post message" and update with "send message."
TSRichViewEdit.DoOnRvRepaint Update and Invalidate.png
TSRichViewEdit.DoOnRvRepaint Update and Invalidate.png (81.23 KiB) Viewed 2095 times
Would it not be better to use invalidate instead to ensure that the scalerichview updates? Or could these changes create other problems?
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Text disappears after Typing in ScaleRichView with scaling (150%)

Post by Sergey Tkachenko »

Maybe you can reproduce this problem in a sample project?

In TSRichViewEdit, there is an invisible internal TRichViewEdit. When it is invalidated, it sends message to TSRichViewEdit to repaint the corresponding area.
But;
1) This hidden TRichViewEdit should not be scrolled (or, at least, redrawing of TSRichViewEdit should not rely on its scrolling)
2) In SetVPos, ScrollWindowEx invalidates newly shown area.
Post Reply