Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
NXDraggingInfo |
Adopted By: | no NEXTSTEP classes | |
Declared In: | appkit/drag.h |
Protocol Description |
The NXDraggingInfo protocol declares methods that supply information about a dragging session (see the NXDraggingDestination protocol for definitions of dragging terms). The NXDraggingInfo methods are designed to be invoked from within an object's implementation of the NXDraggingDestination protocol methods. An NXDraggingInfo-conforming object is passed as the argument to each of the methods defined by NXDraggingDestination; it is to this object that the NXDraggingInfo messages should be sent. The Application Kit supplies an NXDraggingInfo object automatically such that you never need to create a class that implements this protocol. |
Method Types |
Dragging-session information | isDraggingSourceLocal |
draggingSource draggingSourceOperationMask draggingDestinationWindow draggingPasteboard draggingSequenceNumber draggingLocation |
Image information | draggedImage |
draggedImageCopy draggedImageLocation |
Sliding the image | slideDraggedImageTo: |
Instance Methods |
draggedImage |
(NXImage *)draggedImage |
Returns the NXImage object that's being dragged. You shouldn't invoke this method after the user has released the image, nor should you free the object that this method returns.
See also: draggedImageCopy, draggedImageLocation |
draggedImageCopy |
(NXImage *)draggedImageCopy |
Returns a copy of the NXImage object that's being dragged. You should only invoke this method after the user has released the image, typically from within the destination's implemenation of performDragOperation:. You must free the NXImage when you're done with it.
See also: draggedImage, draggedImageLocation |
draggedImageLocation |
(NXPoint)draggedImageLocation |
Returns the current location of the dragged image's origin. The image moves in lockstep with the cursor (the position of which is given by draggingLocation) but may be positioned at some offset. The point that's returned is reckoned in the base coordinate system of the destination object's Window.
See also: draggedImage, draggingLocation |
draggingDestinationWindow |
draggingDestinationWindow |
Returns the destination object's Window. |
draggingLocation |
(NXPoint)draggingLocation |
Returns the current location of the cursor's hot spot, reckoned in the base coordinate system of the destination object's Window.
See also: draggedImageLocation |
draggingPasteboard |
(Pasteboard *)draggingPasteboard |
Returns the Pasteboard object that holds the data that the dragged image represents. |
draggingSequenceNumber |
(int)draggingSequenceNumber |
Returns an integer that uniquely identifies the current dragging session. |
draggingSource |
draggingSource |
Returns the source, or "owner," of the dragged image. However, this method returns nil if the source isn't in the same application as the destination.
See also: isDraggingSourceLocal |
draggingSourceOperationMask |
(NXDragOperation)draggingSourceOperationMask |
Returns the dragging operation mask declared by the dragging source (through its draggingSourceOperationMaskForLocal: method). The elements in the mask will be one or more of the following: |
NX_DragOperationCopy NX_DragOperationLink NX_DragOperationGeneric NX_DragOperationPrivate |
If the user is holding down a modifier key during the drag, the NXDragOperation value that corresponds to the key (as shown in the table below) is AND'ed with the source's mask. |
Modifier Key | NXDragOperation Value | |
Control | NX_DragOperationLink | |
Alternate | NX_DragOperationCopy | |
Command | NX_DragOperationGeneric |
isDraggingSourceLocal |
(BOOL)isDraggingSourceLocal |
Returns YES if the source and destination objects are in the same application. Otherwise returns NO. |
slideDraggedImageTo: |
slideDraggedImageTo:(NXPoint *)screenPoint |
Causes the image to move to the given location in the screen coordinate system. This method should only be invoked from within the destination's implementation of prepareForDragOperation:--in other words, after the user has released the image but before it's removed from the screen. |