How can use AddText right?

General TRichView support forum. Please post your questions here
Post Reply
RichEnjoyer
Posts: 14
Joined: Fri Jan 20, 2006 11:05 am
Location: Germany

How can use AddText right?

Post by RichEnjoyer »

Hi,

i have a little problem with TRichViewEdit.
I add short strings with AddText;
Example:

rv.AddText('hel', 0);
rv.AddText('lo wor', 0);
rv.AddText('ld', 0);

In the RichView "rv" shown the text "hello world", thats great!
When i dubleclick the text then marks the component only the words,

"hel"
"lo"
"wor"
"ld"

What is the mistake on my side?
I don't select the words "hello" and "World" as one complete. :(

best wishes, Frank
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Currently, it's a designed behavior.
Double clicking can select text only inside one item, but you add 3 different items.
Add*** methods (unlike editing methods, i.e. InsertText) do not combine adjacent items of the same style in one item.

You can call NormalizeRichView (from RVNormalize.pas of RichViewActions) after the document generation. Among other things, this procedure will assemble one item from these 3 items.
Post Reply