Page 1 of 1

How can use AddText right?

Posted: Mon Jan 23, 2006 7:48 pm
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

Posted: Tue Jan 24, 2006 11:46 am
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.