Select text by position [message #452382] |
Fri, 18 March 2005 19:59 |
Eclipse User |
|
|
|
Originally posted by: doug-list.threepenny.net
Is there any way to set the caret in a text widget based on a position
(x,y coordinate)?
The setSelection(Point) method seems to treat the Point as (start, end)
so no use there.
I'm looking for something to match the Windows:
EM_CHARFROMPOS message.
Thanks,
Doug
|
|
|
|
Re: Select text by position [message #452604 is a reply to message #452495] |
Wed, 23 March 2005 04:49 |
Eclipse User |
|
|
|
Originally posted by: doug-list.threepenny.net
That's excellent Grant -- just what I needed.
Many thanks (I'd been rolling my own by adding EM_CHARFROMPOS
messages...not exactly cross platform :)
Many thanks,
Doug
Grant Gayed wrote:
> Hi Doug,
>
> Text does not do what you want, but you could use a StyledText instead,
> which has:
> - getOffsetAtLocation(Point)
> - setCaretOffset(int)
>
> Grant
>
> "Doug Pearson" <doug-list@threepenny.net> wrote in message
> news:d1fbtb$p4f$1@www.eclipse.org...
>
>>Is there any way to set the caret in a text widget based on a position
>>(x,y coordinate)?
>>
>>The setSelection(Point) method seems to treat the Point as (start, end)
>>so no use there.
>>
>>I'm looking for something to match the Windows:
>>EM_CHARFROMPOS message.
>>
>>Thanks,
>>
>>Doug
>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04322 seconds