Page 1 of 1

Caret outside margins at window startup

Posted: Mon Feb 05, 2024 2:35 pm
by GoranBru
Hi,
In the nearest past we have observed a strange feature in our software where the clients can write down documents. At the startup of the window, after quite some initialization procedure, if the requested view is Print (which is often) the caret is placed outside (paragraph) margins, almost left to the page border (on about 0,25mm). The caret's top position is okay. If one switches view to e.g. Draft and back using the horizontal menu buttons, then the caret is placed as expected at the left paragraph margin.
During the initialization procedure the program sets the margins for page and text border, clears all the text and paragraph styles as well as adds the default ones (two text styles and one paragraph, nothing special).
I know this is something special on this form only. I use TScaleRichView on some other forms, which are far more easy but they use draft view. I compared to the actions sample but I can't find the differences.
TRichView is 22.1, TScaleRIchView is 12.2, Delphi Sydney, Windows 10. Our software has High DPI (Per Monitor V2) enabled. Please don't ask for deo software as it is virtually impossible to make it due to the inheritance and complexitiy. Any ideas where to look?

Thanks in advance,
Goran

Re: Caret outside margins at window startup

Posted: Mon Feb 05, 2024 2:38 pm
by Sergey Tkachenko
Maybe the editor was not reformatted after some changes... Try calling SRichViewEdit.Format.

Re: Caret outside margins at window startup

Posted: Tue Feb 06, 2024 8:09 am
by GoranBru
Thank You Sergey, it helped. The biggest problem was where to put the instruction - after setting page/border margins.