Important: The information in this document is obsolete and should not be used for new development.
Drag-and-Drop Initialization
To initialize MacApp drag-and-drop support, an application calls theInitUDragManager
routine from itsmain
routine, as shown in "Initializing Additional MacApp Units," beginning on page 92.Initializing the Drag Session Object
TheInitUDragManager
routine creates the global drag session object, initializes it by calling theIDragDropSession
method, and sets the static global fieldTDragDropSession::fgDragDropSession
to refer to the object.The
IDragDropSession
method sets up three procedure pointer fields that the drag session object can later install as callback routines for the Drag Manager. Each of the three fields points to a glue routine that sets up a failure handler and then calls a similarly named method of the drag session object.For example,
DragTrackingHandlerGlue
sets up a failure handler, then callsfgDragDropSession->DragTrackingHandler
to handle tracking during a drag session. It is necessary to set up failure handling in this way to prevent destroying the failure-handler list while in a Drag Manager callback.Initializing View Drag Data
TheTView
class has fields that indicate whether a view object can initiate drags, whether it can accept drops, and whether dragged data should be moved or copied when it is dropped. By default, a view does not support dragging or dropping. An application can make a view draggable or droppable by setting these fields in code or by attaching aTDragDropBehavior
object to the view in a resource template. You don't set these fields directly--you use accessor methods defined in theTView
class.The
TView
fields used with drag and drop are defined as follows:
The
Boolean
- fDraggable;
Boolean
- fDroppable;
short
- fDragMoveDeterminer;
IDType
- fDragMoveFamily;
fDragMoveDeterminer
andfDragMoveFamily
fields, which determine whether dragged data should be copied or moved, are described more fully beginning on page 268.