Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drag And Drop & DropTargetEvent- Coordinates
Drag And Drop & DropTargetEvent- Coordinates [message #441743] Mon, 23 August 2004 12:43 Go to next message
Sami Lakka is currently offline Sami LakkaFriend
Messages: 47
Registered: July 2009
Member
Hi,

I noticed that DropTargetEvent.x and y are calculated relative to the
Display.
I need to calculate them relative to my DropTarget (in this case Canvas). Is
there some convenience method that I could use to do this?

- Sami
Re: Drag And Drop & DropTargetEvent- Coordinates [message #441746 is a reply to message #441743] Mon, 23 August 2004 13:39 Go to previous messageGo to next message
Simone Gianni is currently offline Simone GianniFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Sami,
try the toControl(Point p), toControl(int x, int y) ... this translates
global (Display) coordinates to local (Canvas or any other control) ones.

Ciao,
Simone Gianni


Sami Lakka wrote:

> Hi,
>
> I noticed that DropTargetEvent.x and y are calculated relative to the
> Display.
> I need to calculate them relative to my DropTarget (in this case Canvas). Is
> there some convenience method that I could use to do this?
>
> - Sami
>
>
Re: Drag And Drop & DropTargetEvent- Coordinates [message #441748 is a reply to message #441746] Mon, 23 August 2004 15:41 Go to previous message
Sami Lakka is currently offline Sami LakkaFriend
Messages: 47
Registered: July 2009
Member
Thanks. That did the trick


"Simone Gianni" <s.gianni@thebug.it> kirjoitti viestiss
Previous Topic:SWT and Java Web Start
Next Topic:SWT and Java3D
Goto Forum:
  


Current Time: Fri Apr 19 11:11:01 GMT 2024

Powered by FUDForum. Page generated in 0.02365 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top