A function identified as deprecated has been superseded and may become unsupported in the future.
Associates an image with a drag reference. (Deprecated in Mac OS X v10.4. Use SetDragImageWithCGImage
instead.)
OSErr SetDragImage ( DragRef inDrag, PixMapHandle inImagePixMap, RgnHandle inImageRgn, Point inImageOffsetPt, DragImageFlags inImageFlags );
The drag reference.
A handle to a PixMap
describing the image. The Drag Manager temporarily locks the PixMapHandle
during the drag. The Drag Manager does not copy the information in this parameter; you must ensure that the data to which this parameter refers continues to exist until TrackDrag
completes.
A mask describing the portion of the PixMap
contained in the imagePixMap
parameter which contains the drag image. Pass NULL
for imageRgn
if the entire PixMap
, including white space, should be dragged.
The Drag Manager does not copy the imageRgn
parameter data. Until TrackDrag
completes or SetDragImage
is called again to update the image, you must ensure that the data to which this parameter refers continues to exist.
Don't confuse the region passed to the function TrackDrag
and that passed to the SetDragImage
function. The former is what's drawn to the screen during dragging, while the latter is used only for drawing the correct portion of the drag image.
The offset required to move the PixMap
specified in the imagePixMap
parameter to the global coordinates where the image initially appears. If this parameter is (0,0), the PixMap
should already be in global coordinates.
Flags controlling the appearance of the drag image. See “Drag Image Flags” for a description of the values you can use in this parameter.
A result code. See “Drag Manager Result Codes.”
The sending application should call SetDragImage
prior to calling TrackDrag
. Prior to calling SetDragImage
, the application should draw a solid, opaque image into the PixMap
specified in the imagePixMap
parameter. The Drag Manager will provide translucency effects. Your application can obtain a PixMap
by calling the QuickDraw function GetGWorldPixMap
and supplying a GWorld
into which your application has drawn the image.
To allow the Drag Manager to analyze the PixMap
’s colors in order to determine if it can be rendered on the available screens, Apple recommends using an 8-bit GWorld
for the PixMap
.
SetDragImage
installs a custom drawing procedure to do the translucent drawing. Applications calling SetDragImage
should not also call SetDragDrawingProc
for the same drag.
Drag.h
Adds a flavor to a drag item, creating a new item if necessary. (Deprecated in Mac OS X v10.5.)
OSErr AddDragItemFlavor ( DragRef theDrag, DragItemRef theItemRef, FlavorType theType, const void *dataPtr, Size dataSize, FlavorFlags theFlags );
A drag reference.
The drag item to add the flavor to. You create a new drag item by providing a unique item reference number here. You add a flavor to an existing item by using the same item reference number as in a previous call. You may use any item reference number when adding a flavor to an item. Item reference numbers do not need to be specified in order, nor must they be sequential. In many cases it is easiest to use index numbers as item reference numbers (1, 2, 3...). Item reference numbers are only used as unique “key” numbers for each item. Depending on your application, it might be easier to use your own internal memory addresses as item reference numbers (as long as each item being dragged has a unique item reference number).
The data type of the flavor to add. This may be any four-character scrap type. You may use your application’s signature for a unique type for internal use. You must add all of the drag item flavors to a drag item before calling the TrackDrag
function. Once the TrackDrag
function is called, receiving applications may not operate properly if new drag items or drag item flavors are added.
A pointer to the flavor data to add. Pass NULL
to defer the creation of a particular data type until a receiver has specifically requested it. If you pass NULL
, a promise is added to the drag; when the flavor is requested, the Drag Manager calls the drag’s send data function to get the data from your application.
Note that this method of setting promises differs from the method of setting Scrap Manager promises. See the Scrap Manager function PutScrapFlavor
for more information.
The size, in bytes, of the flavor data to add. If you pass NULL
in the dataPtr
parameter, the value in this parameter is ignored.
The set of attributes to set for this flavor.
A result code. See “Drag Manager Result Codes.”
Drag.h
Gets the number of flavors that are contained within a drag item. (Deprecated in Mac OS X v10.5.)
OSErr CountDragItemFlavors ( DragRef theDrag, DragItemRef theItemRef, UInt16 *numFlavors );
The drag reference.
An item reference number.
On return, a pointer to the number of flavors in the specified drag item. When the CountDragItemFlavors
function is called by an application other than the sender, the flavors that are marked with the flavorSenderOnly
flag are not included in the count.
A result code. See “Drag Manager Result Codes.”
Drag.h
Gets the number of drag items that are contained in a drag reference. (Deprecated in Mac OS X v10.5.)
OSErr CountDragItems ( DragRef theDrag, UInt16 *numItems );
The drag reference.
On return, a pointer to the number of drag items in the specified drag reference.
A result code. See “Drag Manager Result Codes.”
Drag.h
Disposes of the universal procedure pointer (UPP) to a drag drawing callback. (Deprecated in Mac OS X v10.5.)
void DisposeDragDrawingUPP ( DragDrawingUPP userUPP );
The UPP to dispose of.
Drag.h
Disposes of the universal procedure pointer (UPP) to a drag receive handler. (Deprecated in Mac OS X v10.5.)
void DisposeDragReceiveHandlerUPP ( DragReceiveHandlerUPP userUPP );
The UPP to dispose of.
Drag.h
Disposes of the universal procedure pointer (UPP) to a drag send data callback. (Deprecated in Mac OS X v10.5.)
void DisposeDragSendDataUPP ( DragSendDataUPP userUPP );
The UPP to dispose of.
Drag.h
Disposes of the universal procedure pointer (UPP) to a drag tracking handler. (Deprecated in Mac OS X v10.5.)
void DisposeDragTrackingHandlerUPP ( DragTrackingHandlerUPP userUPP );
The UPP to dispose of.
Drag.h
Restores the drag highlight after scrolling part of your window. (Deprecated in Mac OS X v10.5.)
OSErr DragPostScroll ( DragRef theDrag );
The drag reference.
A result code. See “Drag Manager Result Codes.”
The DragPostScroll
function restores the drag highlight after scrolling part of your window. This function must be called following each call to the DragPreScroll
function and any subsequent scrolling.
Drag.h
Prepares your window or pane for scrolling. (Deprecated in Mac OS X v10.5.)
OSErr DragPreScroll ( DragRef theDrag, SInt16 dH, SInt16 dV );
The drag reference.
The horizontal distance you intend to scroll.
The vertical distance you intend to scroll.
A result code. See “Drag Manager Result Codes.”
Removes any drag highlighting that would be scrolled away from the hiliteFrame
specified to the ShowDragHilite
function when scrolling part of your window while drag highlighting is showing. Use this function if you plan to scroll part of your window using the ScrollRect
or CopyBits
functions.
Scrolling part of your window may inadvertently move part of the drag highlighting with it. The DragPreScroll
function is optimized to remove from the screen only the parts of the highlighting that will be scrolled away from the hiliteFrame
region. After calling the DragPreScroll
function with the dH
and dV
that you are going to scroll, you can then scroll your window followed by a call to the DragPostScroll
function which redraws any necessary highlighting after the scroll.
If you use an offscreen port to draw your window into while scrolling, it is recommended that you simply use the HideDragHilite
and ShowDragHilite
functions to preserve drag highlighting in your offscreen port. The DragScroll
functions are optimized for onscreen scrolling.
Drag.h
Returns the drag highlight color for a window. (Deprecated in Mac OS X v10.5.)
OSErr GetDragHiliteColor ( WindowRef window, RGBColor *color );
The window for which to return the drag highlight color.
On return, a pointer to the highlight color.
A result code. See “Drag Manager Result Codes.”
Use the GetDragHiliteColor
function to determine the color the Drag Manager will use for a particular window. GetDragHiliteColor
can safely be called when the gestaltDragMgrHasImageSupport
bit is set in the Gestalt
response to the selector gestaltDragMgrAttr
. For more information on the gestaltDragMgrAttr
selector, see Inside Mac OS X: Gestalt Manager Reference.
The Drag Manager chooses an appropriate color for highlighting, based on the color used for drag highlighting in the current Appearance Manager theme.
Drag.h
Gets the reference number of a specific item in a drag reference. (Deprecated in Mac OS X v10.5.)
OSErr GetDragItemReferenceNumber ( DragRef theDrag, UInt16 index, DragItemRef *theItemRef );
The drag reference.
The index of an item in a drag for which to get the reference.
On return, a pointer to the reference number of the item with the specified index.
A result code. See “Drag Manager Result Codes.” If index
is 0 or larger than the number of items in the drag, GetDragItemReferenceNumber
returns the badDragItemErr
result code.
Drag.h
Gets the Apple Event descriptor of the drop location. (Deprecated in Mac OS X v10.5.)
OSErr GetDropLocation ( DragRef theDrag, AEDesc *dropLocation );
A drag reference.
On return, a pointer to the Apple Event descriptor of the drop location. The drop location is only valid after the receiver has set the drop location by calling the SetDropLocation
function. If the destination is in the Finder, the drop location will be an alias to the location in the file system that received the drag. If the receiver of the drag has not set a drop location by calling the SetDropLocation
function, typeNull
will be returned.
A result code. See “Drag Manager Result Codes.”
The GetDropLocation
function may be called both during a drag as well as after a drag has completed.
Drag.h
Gets all or part of the data for a specific flavor in a drag item. (Deprecated in Mac OS X v10.5.)
OSErr GetFlavorData ( DragRef theDrag, DragItemRef theItemRef, FlavorType theType, void *dataPtr, Size *dataSize, UInt32 dataOffset );
A drag reference.
The reference number of the drag item containing the flavor data.
The flavor type of the flavor to get the data from.
A pointer to a data buffer. On return, the buffer contains the requested flavor data. Your application is responsible for allocating the memory for the flavor data and for setting the dataSize parameter to the number of bytes that you have allocated for the data.
On input, a pointer to the size of the data (in bytes) that you have allocated memory for and wish to receive from the flavor. On return, a pointer to the actual number of bytes copied into the buffer specified by the dataPtr
parameter.
If you specify a dataSize
that is smaller than the amount of data in the flavor, the data is copied into your buffer and the dataSize
parameter is unchanged. If you specify a dataSize
that is larger than the amount of data in the flavor, only the amount of data in the flavor is copied into your buffer and the dataSize
parameter contains, on return, the actual number of bytes copied. You have reached the end of the flavor’s data when the dataSize
parameter points to a number of bytes lower than you provided.
If you wish to receive the flavor data in smaller pieces than the entire size of the data, you can set the dataSize
parameter to be as large as your buffer and call the GetFlavorData
function multiple times while incrementing the dataOffset
parameter by the size of your buffer. If the dataOffset
parameter is larger than the amount of data contained within the flavor, 0 (zero) will be returned in the number pointed to by the dataSize
parameter indicating that no data was copied into your buffer.
A pointer to the offset (in bytes) within the flavor structure at which to begin copying data.
A result code. See “Drag Manager Result Codes.”
You can first determine the size of a flavor’s data by calling the GetFlavorDataSize
function.
Note that calling the GetFlavorData
function on a flavor that requires translation will force that translation to occur in order to return the data.
Drag.h
Gets the size of the data for a specific flavor in a drag item. (Deprecated in Mac OS X v10.5.)
OSErr GetFlavorDataSize ( DragRef theDrag, DragItemRef theItemRef, FlavorType theType, Size *dataSize );
A drag reference.
The reference number of the drag item containing the flavor.
The flavor type for which to get the size of the data.
On return, a pointer to the size of the data for the specified drag item flavor.
A result code. See “Drag Manager Result Codes.”
Note that calling the GetFlavorDataSize
function on a flavor that requires translation will force that translation to be performed in order to determine the data size. Since translation may require a significant amount of time and memory during processing, call the GetFlavorDataSize
function only when necessary.
Drag.h
Gets the flags for a specific flavor in a drag item. (Deprecated in Mac OS X v10.5.)
OSErr GetFlavorFlags ( DragRef theDrag, DragItemRef theItemRef, FlavorType theType, FlavorFlags *theFlags );
A drag reference.
The reference number of the drag item containing the flavor.
The flavor type for which to get the attributes.
On return, a pointer to the attributes of the specified flavor. If a flavor is marked with the flavorSenderOnly
flag, it is not returned to any application other than the sender.
A result code. See “Drag Manager Result Codes.”
Drag.h
Gets the type of a specific flavor in a drag item. (Deprecated in Mac OS X v10.5.)
OSErr GetFlavorType ( DragRef theDrag, DragItemRef theItemRef, UInt16 index, FlavorType *theType );
A drag reference.
The reference number of the drag item containing the flavor.
The index of the desired flavor.
On return, a pointer to the type of the specified flavor. If a flavor is marked with the flavorSenderOnly
flag, it is not returned to any application other than the sender.
A result code. See “Drag Manager Result Codes.” If index
is 0 or larger than the number of flavors in the item, GetFlavorType
returns the badDragFlavorErr
result code.
Drag.h
Gets the standard drop location set by the receiver of a drag. (Deprecated in Mac OS X v10.5.)
OSStatus GetStandardDropLocation ( DragRef theDrag, StandardDropLocation *outDropLocation );
The drag reference.
A pointer to a value that, on return, represents the location where the drag was dropped. You can use the GetStandardDropLcoation
function to easily determine whether a drag landed in the trash; if the drop location is the trash, the value of this parameter is kDragStandardDropLocationTrash
. Otherwise, the value returned here is kDragStandardDropLocationUnknown
. See “Standard Drop Locations” for more information on these values.
A result code. See “Drag Manager Result Codes.”
Drag.h
Removes highlighting created with the ShowDragHilite
function. (Deprecated in Mac OS X v10.5.)
OSErr HideDragHilite ( DragRef theDrag );
The drag reference that is currently showing a drag highlight.
A result code. See “Drag Manager Result Codes.”
The HideDragHilite
function assumes that the highlighting should be erased from the current port. Your application should make sure that the correct port is set before calling the HideDragHilite
function. Also, highlighting erased by the HideDragHilite
function is clipped to the current port. Make sure that the port’s clip region is appropriately sized to remove the highlighting.
Drag.h
Installs a receive handler function for one or all of your application’s windows. (Deprecated in Mac OS X v10.5.)
OSErr InstallReceiveHandler ( DragReceiveHandlerUPP receiveHandler, WindowRef theWindow, void *handlerRefCon );
A pointer to a receive handler function. Installing a receive handler function allows your application to accept a drag by getting drag item flavor data from the Drag Manager when the user releases the mouse button while dragging over one of your application’s windows.
A reference to the window for which to install the receive handler. When a drop occurs over this window, the Drag Manager calls your receive handler function to allow your application to accept the drag. If you pass NULL
, the receive handler function is installed in the default handler space for your application. Receive handler functions installed in this way are called when a drop occurs over any window that belongs to your application. You may install more than one receive handler function on a single window.
A pointer to a reference constant that will be forwarded to your receive handler function when it is called by the Drag Manager. Use this constant to pass any data you wish to forward to your drag receive handler.
A result code. See “Drag Manager Result Codes.”
The Drag Manager sequentially calls all of the receive handler functions installed on a window when a drop occurs in that window.
Drag.h
Installs a tracking handler function for one or all of your application’s windows. (Deprecated in Mac OS X v10.5.)
OSErr InstallTrackingHandler ( DragTrackingHandlerUPP trackingHandler, WindowRef theWindow, void *handlerRefCon );
A pointer to a tracking handler function. Installing a tracking handler function allows your application to track the user’s movements through your application’s windows during a drag.
A reference to the window for which to track and handle dragging. When the cursor moves into this window during a drag, the Drag Manager sends tracking messages to the tracking handler function. If you pass NULL
, the tracking handler function is installed in the default handler space for your application. Tracking handler functions installed in this way are called when the user moves the mouse over any window that belongs to your application. You may install more than one drag tracking handler on a single window.
A pointer to a reference constant that will be forwarded to your tracking handler function when it is called by the Drag Manager. Use this constant to pass any data you wish to forward to your tracking handler function.
A result code. See “Drag Manager Result Codes.”
The Drag Manager sequentially calls all of the tracking handler functions installed for a window when the user moves the cursor over that window during a drag.
Drag.h
Calls your drag drawing callback. (Deprecated in Mac OS X v10.5.)
OSErr InvokeDragDrawingUPP ( DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, DragRef theDrag, DragDrawingUPP userUPP );
A result code. See “Drag Manager Result Codes.”
You should not need to use the function InvokeDragDrawingUPP
, as the system calls your drag drawing callback for you.
Drag.h
Calls your drag receive handler. (Deprecated in Mac OS X v10.5.)
OSErr InvokeDragReceiveHandlerUPP ( WindowRef theWindow, void *handlerRefCon, DragRef theDrag, DragReceiveHandlerUPP userUPP );
A result code. See “Drag Manager Result Codes.”
You should not need to use the function InvokeDragReceiveHandlerUPP
, as the system calls your drag receive handler for you.
Drag.h
Calls your drag send data callback. (Deprecated in Mac OS X v10.5.)
OSErr InvokeDragSendDataUPP ( FlavorType theType, void *dragSendRefCon, DragItemRef theItemRef, DragRef theDrag, DragSendDataUPP userUPP );
A result code. See “Drag Manager Result Codes.”
You should not need to use the function InvokeDragSendDataUPP
, as the system calls your drag send data callback for you.
Drag.h
Calls your drag tracking handler. (Deprecated in Mac OS X v10.5.)
OSErr InvokeDragTrackingHandlerUPP ( DragTrackingMessage message, WindowRef theWindow, void *handlerRefCon, DragRef theDrag, DragTrackingHandlerUPP userUPP );
A result code. See “Drag Manager Result Codes.”
You should not need to use the function InvokeDragTrackingHandlerUPP
, as the system calls your drag tracking handler for you.
Drag.h
Creates a new universal procedure pointer (UPP) to a drag drawing callback. (Deprecated in Mac OS X v10.5.)
DragDrawingUPP NewDragDrawingUPP ( DragDrawingProcPtr userRoutine );
A pointer to your drag drawing callback.
On return, a UPP to the drag drawing callback. See the description of the DragDrawingUPP
data type.
Drag.h
Creates a new universal procedure pointer (UPP) to a drag receive handler. (Deprecated in Mac OS X v10.5.)
DragReceiveHandlerUPP NewDragReceiveHandlerUPP ( DragReceiveHandlerProcPtr userRoutine );
A pointer to your drag receive handler.
On return, a UPP to the drag receive handler. See the description of the DragReceiveHandlerUPP
data type.
Drag.h
Creates a new universal procedure pointer (UPP) to a drag send data callback. (Deprecated in Mac OS X v10.5.)
DragSendDataUPP NewDragSendDataUPP ( DragSendDataProcPtr userRoutine );
A pointer to your drag send data callback.
On return, a UPP to the drag send data callback. See the description of the DragSendDataUPP
data type.
Drag.h
Creates a new universal procedure pointer (UPP) to a drag tracking handler. (Deprecated in Mac OS X v10.5.)
DragTrackingHandlerUPP NewDragTrackingHandlerUPP ( DragTrackingHandlerProcPtr userRoutine );
A pointer to your drag tracking handler.
On return, a UPP to the drag tracking handler. See the description of the DragTrackingHandlerUPP
data type.
Drag.h
Removes a receive handler function from one or all of your application’s windows. (Deprecated in Mac OS X v10.5.)
OSErr RemoveReceiveHandler ( DragReceiveHandlerUPP receiveHandler, WindowRef theWindow );
A pointer to a receive handler function.
A reference to the window from which to remove the receive handler function. Pass NULL
to remove the specified receive handler function from the default handler space for your application.
A result code. See “Drag Manager Result Codes.”
Drag.h
Removes a tracking handler function from one or all of your application’s windows. (Deprecated in Mac OS X v10.5.)
OSErr RemoveTrackingHandler ( DragTrackingHandlerUPP trackingHandler, WindowRef theWindow );
A pointer to the tracking handler function to be removed.
A reference to the window from which to remove the drag tracking handler function. Pass NULL
to remove the specified tracking handler function from the default handler space for your application.
A result code. See “Drag Manager Result Codes.”
Drag.h
Sets the drag drawing function for the Drag Manager to use with a particular drag. (Deprecated in Mac OS X v10.5.)
Not recommended
OSErr SetDragDrawingProc ( DragRef theDrag, DragDrawingUPP drawingProc, void *dragDrawingRefCon );
The drag reference for which the drag drawing function will be set.
The drag drawing function to be called by the Drag Manager to draw, move, and hide the “dotted outline” drag feedback on the screen during a drag.Your drag drawing function can implement any type of drag feedback, such as dragging a bitmap of the object being dragged. Details for how to write a drag drawing function are covered in the “Drag Manager Callbacks” section.
A pointer to a reference constant that will be forwarded to your drag drawing function when it is called by the Drag Manager. Use this constant to pass any data you wish to forward to your drag drawing function.
A result code. See “Drag Manager Result Codes.”
Drag drawing functions are not supported in Mac OS X, although they continue to work in CarbonLib when running Mac OS 8 and Mac OS 9.
Drag.h
Sets the data or part of the data contained within an existing flavor. (Deprecated in Mac OS X v10.5.)
OSErr SetDragItemFlavorData ( DragRef theDrag, DragItemRef theItemRef, FlavorType theType, const void *dataPtr, Size dataSize, UInt32 dataOffset );
The drag reference whose flavor data will be set.
The drag item reference of the item that contains the flavor you wish to set all or part of the data for. The data pointed to by the dataPtr parameter with the size specified in the dataSize parameter is placed into the flavor structure at the offset specified by the dataOffset parameter.
The data type of the existing flavor for which all or part of the data will be set.
A pointer to the flavor data.
The size, in bytes, of the flavor data.
The offset, in bytes, into the flavor structure at which to place the data specified by the dataPtr and the dataSize parameters.
A result code. See “Drag Manager Result Codes.”
This function is commonly used in situations where a flavor’s data is not added to the flavor when the flavor is created using the AddDragItemFlavor
function. When the sender's drag send data function is called, the SetDragItemFlavorData
function can be used to provide the requested data to the Drag Manager. This method is useful when the data needs to be translated by the sender and it would be expensive to compute the data before it is required.
Unlike the functions that add flavors, this function may be called both before and during a drag.
Drag.h
Sets the send data function for the Drag Manager to use with a particular drag. (Deprecated in Mac OS X v10.5.)
OSErr SetDragSendProc ( DragRef theDrag, DragSendDataUPP sendProc, void *dragSendRefCon );
The drag reference to set the send data function for.
The send data function that will be called by the Drag Manager when the receiver of a drop requests the flavor data of a flavor that has not been cached by the Drag Manager.
A pointer to a reference constant that will be forwarded to your send data function when it is called by the Drag Manager. Use this constant to pass any data you wish to forward to your send data function.
A result code. See “Drag Manager Result Codes.”
The Drag Manager caches drag item flavor data when the flavor is added to a drag by calling the AddDragItemFlavor
function. If NULL
is passed to the AddDragItemFlavor
function as the data pointer, the flavor data is not cached and the Drag Manager will call your send data function when the drag item flavor data is requested.
You do not need to provide a send data function if your application never passes NULL
to the AddDragItemFlavor
function when adding a drag item flavor to a drag.
Details for how to write a send data function are covered in the “Drag Manager Callbacks” section.
Drag.h
Sets the Apple Event descriptor for the drop location of a drag. (Deprecated in Mac OS X v10.5.)
OSErr SetDropLocation ( DragRef theDrag, const AEDesc *dropLocation );
A drag reference.
A pointer to the Apple Event descriptor of the drop location to set.
A result code. See “Drag Manager Result Codes.”
This function is typically called by a receive handler before attempting to get any flavor data using the GetFlavorDataSize
or GetFlavorData
functions. When a sender application's drag send data function is called to provide flavor data to a receiver, the GetDropLocation
function can be called to determine the drop location while providing data.
Drag.h
Used by the receiver of a drag to set the standard drop location for a drag. (Deprecated in Mac OS X v10.5.)
OSStatus SetStandardDropLocation ( DragRef theDrag, StandardDropLocation dropLocation );
The drag reference.
A value representing the location where the drag was dropped. See “Standard Drop Locations” for a description of the values you may use here.
A result code. See “Drag Manager Result Codes.”
Drag.h
Highlights an area of your window during a drag. (Deprecated in Mac OS X v10.5.)
OSErr ShowDragHilite ( DragRef theDrag, RgnHandle hiliteFrame, Boolean inside );
The drag reference of the drag currently in progress.
A QuickDraw region of the frame of the window, pane, or shape you wish to highlight, in the window’s local coordinate system.
Pass true
to draw the highlighting inside the frame shape. Otherwise it will be drawn outside the frame shape. Note that in either case, the highlight will not include the boundary edge of the frame. This allows you to highlight inside a window frame or a pane, or to highlight outside of a container or object in your window.
A result code. See “Drag Manager Result Codes.”
The ShowDragHilite
function creates a standard drag and drop highlight in your window. Your tracking handler function should call this if a drop is allowed at the current mouse position.
You can only have one highlight showing at a time, and if you call this function when a highlight is currently visible, the first one is removed before the newly requested highlight is shown.
The ShowDragHilite
function uses a two pixel thick line when drawing the highlight.
The ShowDragHilite
function assumes that the highlighting should be drawn in the current port. Your application should make sure that the correct port is set before calling the ShowDragHilite
function. Also, highlighting drawn by the ShowDragHilite
function is clipped to the current port. Make sure that the port’s clip region is appropriately sized to draw the highlighting.
The Drag Manager maintains the currently highlighted portion of your window if you use the HideDragHilite
and UpdateDragHilite
functions. If you intend to scroll the window that contains the highlighting, you can use the DragPreScroll
and DragPostScroll
functions to properly update the drag highlighting.
Drag.h
Updates the portion of the drag highlight that was drawn over by your application. (Deprecated in Mac OS X v10.5.)
OSErr UpdateDragHilite ( DragRef theDrag, RgnHandle updateRgn );
The drag reference.
The region that needs to be updated, typically the port’s updateRgn
.
A result code. See “Drag Manager Result Codes.”
Use this function if your application draws into the highlighted portion of your window during a drag. For example, dragging over a folder icon in the Finder causes the Finder to redraw the folder icon in its darkened (selected) color. The Finder calls the UpdateDragHilite
function to redraw any portion of the drag highlight that may have intersected with the folder icon.
You must guarantee, however, that any current highlighting within the updateRgn
has been completely erased or is clipped out. If this function is asked to highlight over an area which is still highlighted, it will be redrawn incorrectly.
Drag.h
Animates a rectangle into a second rectangle. (Deprecated in Mac OS X v10.5.)
OSErr ZoomRects ( const Rect *fromRect, const Rect *toRect, SInt16 zoomSteps, ZoomAcceleration acceleration );
A pointer to the starting rectangle to animate from, in global coordinates.
A pointer to the ending rectangle to animate to, in global coordinates.
Specifies the number of animation steps to be shown between the source and destination rectangles. The minimum number of steps is 4. If less than 4 steps are specified, 4 will be used. The maximum number of steps is 25. If more than 25 steps are specified, 25 will be used.
Specifies how the intermediate animation steps will be calculated. Using the kZoomNoAcceleration
constant makes the distance between steps from the source to the destination equal. Using the kZoomAccelerate
constant makes each step from the source to the destination increasingly larger, making the animation appear to speed up as it approaches the destination. Using the kZoomDecelerate
constant makes each step from the source to the destination smaller, making the animation appear to slow down as it approaches the destination.
A result code. See “Drag Manager Result Codes.”
The ZoomRects
function animates a movement between two rectangles on the screen. It does this by drawing gray dithered rectangles incrementally toward the destination rectangle.
The ZoomRects
function draws on the entire screen, outside of the current port. It does not change any pixels on the screen except during the animation. It also preserves the current port and the port’s settings.
Drag.h
Animates a region’s outline from one screen location to another. (Deprecated in Mac OS X v10.5.)
OSErr ZoomRegion ( RgnHandle region, Point zoomDistance, SInt16 zoomSteps, ZoomAcceleration acceleration );
The region to animate.
The horizontal and vertical distance from the starting point that the region will animate to.
Specifies the number of animation steps to be shown between the source and destination rectangles. The minimum number of steps is 4. If less than 4 steps are specified, 4 will be used. The maximum number of steps is 25. If more than 25 steps are specified, 25 will be used.
Specifies how the intermediate animation steps will be calculated. Using the kZoomNoAcceleration
constant makes the distance between steps from the source to the destination equal. Using the kZoomAccelerate
constant makes each step from the source to the destination increasingly larger, making the animation appear to speed up as it approaches the destination. Using the kZoomDecelerate
constant makes each step from the source to the destination smaller, making the animation appear to slow down as it approaches the destination.
A result code. See “Drag Manager Result Codes.”
The ZoomRegion
function animates a region from one location to another on the screen. It does this by drawing gray dithered regions incrementally toward the destination region.
The ZoomRegion
function draws on the entire screen, outside of the current port. It does not change any pixels on the screen except during its animation. It also preserves the current port and the port’s settings.
Drag.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-12)