Page 1 of 1

Text Moving Down

Posted: Sat Sep 10, 2005 5:08 pm
by DelphiLove
I have TRichViewEdit height set to 22. When I enter text all is fine but soon as I insert 16x16 image, the text moves down. How can I stop this from occuring?

Btw do you think you'll ever add support so TRichViewEdit could be used in single line mode like TEdit? I can already do it myself but maybe a SingleLine property?

Posted: Sat Sep 10, 2005 6:22 pm
by Sergey Tkachenko
What do you mean - text moves down?

As for single line editor,
1) Include rvoDoNotWantReturns in Editor.EditorOptions
2) Forbid d&d (exclude all options from AcceptDragDropFormats)
3) Process OnPaste to allow inserting only one line text

Posted: Sat Sep 10, 2005 7:17 pm
by Guest
To see what I mean visit http://www.pastehere.com/?yuitnt


The one on top is before and the one on the bottom is the after. See how the text shifts down.

Posted: Sat Sep 10, 2005 7:18 pm
by Guest
Actually you should see http://www.pastehere.com/PasteImages/yuitnt.jpg instead.

Posted: Sat Sep 10, 2005 8:11 pm
by Sergey Tkachenko
I think it's because a height of document is increased after inserting a picture, and now it takes one more scrollbar step, so it can be scrolled down. By default, scrollbar step = 10 pixels.
You can set it to 1 before calling Format, it may help

rv.VSmallStep := 1;

Posted: Sun Sep 11, 2005 1:02 pm
by Guest
This didn't work. Any other suggestions? In OnCreate of the form I set VSmallStep but no luck. I don't call Format anywhere.

Posted: Sun Sep 11, 2005 1:21 pm
by jonjon
I might be wrong but isn't it something to do with image vertical alignment ? On the second picture, the image is clearly baseline aligned. The new middle alignment should solve this I think.

Regards,
John.

Posted: Sun Sep 11, 2005 2:48 pm
by Sergey Tkachenko
Please create a simple project reproducing this problem and send it to me.