Page 1 of 1

Set Cursorposition (Line, Col) in RichViewEdit

Posted: Mon Aug 09, 2021 5:47 am
by AsteruxBT
Hello,

I copy a text 1:1 from a RichViewEdit to a DBRichViewEdit and then I want to stand with the cursor in the DBRichViewEdit at the same position in the text as before in the RichViewEdit.
With the function: GetCurrentLineCol(Row,Col) I get the current row and column in the text.
But how can I set them again.
A command like SetCurrentLineCol does not exist.

Can someone help me here?

Greetings from Bavaria in Germany
AsterixBT

Re: Set Cursorposition (Line, Col) in RichViewEdit

Posted: Mon Aug 09, 2021 7:47 am
by Sergey Tkachenko
The simplest way is using functions from RVLinear unit

If you need only to store the caret position, use RVGetLinearCaretPos and RVSetLinearCaretPos.

If you want to store not only the caret position, but also selection, use RVGetSelectionEx/RVSetSelectionEx.

Re: Set Cursorposition (Line, Col) in RichViewEdit

Posted: Mon Aug 16, 2021 9:16 am
by AsteruxBT
Hello,

thank you very much for the answer.
RVGetLinearCaretPos and RVSetLinearCaretPos worked fine in the first test.

Greetings from Bavaria in Germany
AsterixBT