Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread TMultiLineEdit Question
Fri, Mar 3 2017 6:18 AMPermanent Link

Michael Dreher

Is there a way to set and get the location of the cursor in a TMultiLineEdit?
Something like SelText in Delphi.
Thanks!

M. Dreher
Tue, Mar 7 2017 1:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< Is there a way to set and get the location of the cursor in a TMultiLineEdit?  Something like SelText in Delphi. >>

There is, but I need to surface it.  I will do so shortly.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 20 2017 7:26 PMPermanent Link

Allen Hunt

Tim Young [Elevate Software] wrote:

<< There is, but I need to surface it.  I will do so shortly. >>

Is it possible to get the cursor position yet?  Thanks!

Best Regards,
Allen
Fri, Sep 22 2017 2:16 AMPermanent Link

Michael Dreher

Allen W. Hunt wrote:

 // Is it possible to get the cursor position yet?  Thanks!

Since 2.06 there are properties SelectionStart and SelectionEnd for all edit controls. If no text is selected, SelectionStart = SelectionEnd holds and you get the index of the cursor. The help says it's 1-base but from my experience I would say it's 0-based. For a TMultiLineEdit it should be easy to map the index in a (x,y) coordinate space.

Michael Dreher
Fri, Sep 22 2017 12:10 PMPermanent Link

Allen Hunt

Thank you!
Fri, Sep 22 2017 2:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< Since 2.06 there are properties SelectionStart and SelectionEnd for all edit controls. If no text is selected, SelectionStart = SelectionEnd holds and you get the index of the cursor. The help says it's 1-base but from my experience I would say it's 0-based. For a TMultiLineEdit it should be easy to map the index in a (x,y) coordinate space. >>

Yeah, that's a bug in the "getting" of the SelectionStart value.  It should definitely be a 1 instead of a 0.

I'll have a fix in a new build coming out mid-next-week.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image