Get if the caret is in last line, with resize

General TRichView support forum. Please post your questions here
Post Reply
RichviewFan
Posts: 6
Joined: Fri Dec 29, 2006 6:08 pm

Get if the caret is in last line, with resize

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
RichviewFan
Posts: 6
Joined: Fri Dec 29, 2006 6:08 pm

oh indeed, it works

Post by RichviewFan »

thank you Sergey
Post Reply