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 theInitUDragManagerroutine from itsmainroutine, as shown in "Initializing Additional MacApp Units," beginning on page 92.Initializing the Drag Session Object
TheInitUDragManagerroutine creates the global drag session object, initializes it by calling theIDragDropSessionmethod, and sets the static global fieldTDragDropSession::fgDragDropSessionto refer to the object.The
IDragDropSessionmethod 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,
DragTrackingHandlerGluesets up a failure handler, then callsfgDragDropSession->DragTrackingHandlerto 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
TheTViewclass 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 aTDragDropBehaviorobject to the view in a resource template. You don't set these fields directly--you use accessor methods defined in theTViewclass.The
TViewfields used with drag and drop are defined as follows:
The
Boolean- fDraggable;
Boolean- fDroppable;
short- fDragMoveDeterminer;
IDType- fDragMoveFamily;
fDragMoveDeterminerandfDragMoveFamilyfields, which determine whether dragged data should be copied or moved, are described more fully beginning on page 268.