Page 1 of 1

Insert new text and keeping the selecion

Posted: Tue Apr 27, 2010 12:37 pm
by Prometeus
Hello,



I need to do some processing in a selected text and after that (the text will have the same length as before) keep the selection. I tried doing that:

Code: Select all

rv.Format;
rv.GetSelectionBounds(StartItemNo,StartItemOffs,EndItemNo,EndItemOffs,false);
work_str := rv.GetSelText;
...
(Do some text processing on 'work_str')
...
rv.InsertText(work_str,true);
rv.Format;
rv.SetSelectionBounds(StartItemNo,StartItemOffs,EndItemNo,EndItemOffs);
Unfortunatelly this did not work. I tried looking other topics about similar situation but found nothing. How can I do that?

Thanks for any help.

Posted: Tue Apr 27, 2010 2:41 pm
by Sergey Tkachenko
Use the function from RVLinear.pas: http://www.trichview.com/help/idh_rvlinear.html

Posted: Tue Apr 27, 2010 6:10 pm
by Prometeus
Hello, Sergey,



It worked perfectly!


Thanks!