Page 1 of 1

Resizing Form - RVE

Posted: Sun Jun 21, 2009 2:20 am
by LonelyRanger
Hi there,

I cannot remember for the likes of me what I did last time to stop the following issue...

Click a button and it puts whatever is in the editbox into the RVE. As below is the result.

Code: Select all

This is a test
This is a test 2
This is a test 3
Now if I resize the form it ends up like the following...

Code: Select all

This is a testThis is a test 2This is a test 3
I have fixed this before but I cannot remember!

Cheers.

Posted: Sun Jun 21, 2009 5:04 pm
by Sergey Tkachenko
How did you add this text?

Posted: Sun Jun 21, 2009 11:26 pm
by LonelyRanger
Hi Sergey,

Add("this is a test", 0);
Add("this is a test 2", TextStyleInc);
FormatTail;

It is fine if the entire line can be the same text style as i simply use AddNL(). However, as shown above I use 2 different styles on the same line.

Cheers.

Posted: Mon Jun 22, 2009 4:15 pm
by Sergey Tkachenko
If I understand the problem correctly, it is because FormatTail.
This method works correctly only if, since the last call of Format/FormatTail, new content was added from new line.
Use Format instead of FormatTail.

Posted: Mon Jun 22, 2009 11:31 pm
by LonelyRanger
I didnt have this problem in another project about 3 weeks ago and was using formattail. I looked over and over the old code and couldnt find what I had done. So it must have been a property that allowed me to set an option to maintain current layout or something. Wish I knew what i did.

Cheers,
LR.

Posted: Mon Jun 22, 2009 11:37 pm
by LonelyRanger
Ok, sorry Sergey but I finally worked out what it was that I had been doing...

I would start the line with AddNL() first and then append using Add() and called FormatTail when I was all done. This prevents the issue that I outlined in the original post.

Thx for your time.
LR.

Posted: Tue Jun 23, 2009 8:05 am
by Sergey Tkachenko
Yes, the first item after the last call of Format/FormatTail must be added from new line. Otherwise, FormatTail works incorrectly.