Text Moving Down

General TRichView support forum. Please post your questions here
Post Reply
DelphiLove

Text Moving Down

Post by DelphiLove » Sat Sep 10, 2005 5:08 pm

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?

Sergey Tkachenko
Site Admin
Posts: 14779
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sat Sep 10, 2005 6:22 pm

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

Guest

Post by Guest » Sat Sep 10, 2005 7:17 pm

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.

Guest

Post by Guest » Sat Sep 10, 2005 7:18 pm

Actually you should see http://www.pastehere.com/PasteImages/yuitnt.jpg instead.

Sergey Tkachenko
Site Admin
Posts: 14779
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sat Sep 10, 2005 8:11 pm

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;

Guest

Post by Guest » Sun Sep 11, 2005 1:02 pm

This didn't work. Any other suggestions? In OnCreate of the form I set VSmallStep but no luck. I don't call Format anywhere.

jonjon
Posts: 323
Joined: Sat Aug 27, 2005 4:19 pm

Post by jonjon » Sun Sep 11, 2005 1:21 pm

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.

Sergey Tkachenko
Site Admin
Posts: 14779
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Sep 11, 2005 2:48 pm

Please create a simple project reproducing this problem and send it to me.

Post Reply