Text Moving Down

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

Text Moving Down

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
Guest

Post 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.
Guest

Post by Guest »

Actually you should see http://www.pastehere.com/PasteImages/yuitnt.jpg instead.
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
Guest

Post 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.
jonjon
Posts: 467
Joined: Sat Aug 27, 2005 4:19 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

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