Page 1 of 1

Get if the caret is in last line, with resize

Posted: Fri Dec 29, 2006 6:10 pm
by RichviewFan
A Old your answer:

1) If you really mean "lines":
Code:
rve.GetCurrentLineCol(Line, Col);
InTheFirstLine := (rve.InplaceEditor=nil) and (Line=1);
InTheLastLine := (rve.InplaceEditor=nil) and (Line=rve.GetLineNo(rve.ItemCount-1, rve.GetOffsAfterItem(rve.ItemCount-1));

Lines depend on word wrapping, so when user resizes the editor window, results will be different. The method above is simple, but not very efficient. If you need to call this code often, I can give alternative version.

Dear Sergey, I really need a procedure that works also when the user resize the richviewedit.

Thank you very much.

Posted: Fri Dec 29, 2006 6:24 pm
by Sergey Tkachenko
Sorry, I do not understand the question.
The code works, it just may give different results after resizing.
You can rerun this code in OnResize event

oh indeed, it works

Posted: Fri Dec 29, 2006 6:53 pm
by RichviewFan
thank you Sergey