|
Re: Special dnd features [message #446753 is a reply to message #446748] |
Thu, 02 December 2004 13:43 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
In the dragEnter event and the dragOperationChanged event you can determine
the key modifier pressed by looking at the event.operation field. Of
particular interest to you would be the values below:
/**
* Drag and Drop Operation: During a dragEnter event or a
dragOperationChanged, if no modifier keys
* are pressed, the operation is set to DROP_DEFAULT. The application can
choose what the default
* operation should be by setting a new value in the operation field. If no
value is choosen, the
* default operation for the platform will be selected (value is 1 <<
4).
*
* @see DropTargetListener#dragEnter
* @see DropTargetListener#dragOperationChanged
* @since 2.0
*/
public final static int DROP_DEFAULT = 1 << 4;
/**
* Drag and Drop Operation: a copy of the data in the drag source is
* added to the drop target (value is 1 << 0).
*/
public final static int DROP_COPY = 1 << 0;
"hortiz" <hortiz@nospam.com> wrote in message
news:comrmr$b1j$1@www.eclipse.org...
> Hi,
>
> I use a TreeViewer as a DragSource and a Composite as a DropTarget, thus,
> I can drag a tree item and drop a representation of it in my Composite
> instance.
>
> I would like to implement special features such as :
>
> - to view data associated with the selected tree item, the user simply
> drags and drops it,
>
> - to modify data associated with the selected tree item, the user should
> press "CTRL" (on Linux) or "Apple" (on Mac) key while dragging.
>
> I've managed to detect if a key is pressed but not particularly the CTRL
> one...
>
> Thanks
> Helene
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03009 seconds