|
Re: how to get current cursor location relative to current editor [message #463367 is a reply to message #463341] |
Fri, 04 November 2005 08:22  |
Eclipse User |
|
|
|
This is a multipart message in MIME format.
--=_alternative 00496EC0C12570AF_=
Content-Type: text/plain; charset="US-ASCII"
Yes you can use that one,
However, the location you will get is absolute and not relative to the
current active control.
If you need the position relative to your control you can use the
following:
Point absolutePosition = Display.getCurrent().getCursorLocation();
Point relativePosition = yourControl.toControl(absolutePosition);
hth
Philipp
--=_alternative 00496EC0C12570AF_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">Yes you can use that one, </font>
<br>
<br><font size=2 face="sans-serif">However, the location you will get is
absolute and not relative to the current active control.</font>
<br>
<br><font size=2 face="sans-serif">If you need the position relative to
your control you can use the following:</font>
<br>
<br><font size=2 face="sans-serif">Point absolutePosition = Display.getCurrent().getCursorLocation();</font>
<br><font size=2 face="sans-serif">Point relativePosition = yourControl.toControl(absolutePosition);</font>
<br>
<br><font size=2 face="sans-serif">hth </font>
<br><font size=2 face="sans-serif">Philipp</font>
--=_alternative 00496EC0C12570AF_=--
|
|
|
Powered by
FUDForum. Page generated in 0.04099 seconds