home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-09 | 1.6 KB | 64 lines | [TEXT/CWIE] |
- // ============================================================================
- // CDragAndDropFSSpec.cp
- // ©1995 J. Rodden, DD/MF & Associates. All rights reserved
- // ============================================================================
-
- #include <CDragAndDropFSSpec.h>
-
- #include <Finder.h>
-
- #include <LPane.h>
-
- // ============================================================================
-
- CDragAndDropFSSpec::CDragAndDropFSSpec(WindowPtr inMacWindow, LPane *inPane)
- : CDragAndDrop(inMacWindow, inPane)
- {
- mFlavorAccepted = flavorTypeHFS;
- }
-
-
- // ============================================================================
-
- void
- CDragAndDropFSSpec::RetrieveDragData(
- DragReference inDragRef,
- ItemReference inItemRef,
- Size inDataSize,
- Boolean inCopyData,
- Boolean inFromFinder,
- Rect& inItemBounds)
- {
-
- HFSFlavor theFlavorData; // Where we will put the data.
- Size theDataSize = inDataSize;
-
- if ( inDataSize <= mFlavorSize ) {
- ::GetFlavorData(inDragRef, inItemRef, mFlavorTypeRcve,
- (Ptr) &theFlavorData, &theDataSize, 0L);
-
- // resolve alias files
- if( theFlavorData.fdFlags & kIsAlias ) {
- Boolean targetIsFolder, wasAliased;
- ::ResolveAliasFile( &theFlavorData.fileSpec, true, &targetIsFolder, &wasAliased);
- }
-
- CopyOrMoveData( &theFlavorData, inDataSize, inCopyData, inFromFinder, inItemBounds);
- }
- }
-
-
- // ============================================================================
-
- void
- CDragAndDropFSSpec::CopyOrMoveData(
- void* theFlavorData,
- Size inDataSize,
- Boolean inCopyData,
- Boolean inFromFinder,
- Rect& inItemBounds)
- {
- mPane->SetDescriptor(((HFSFlavor*) theFlavorData)->fileSpec.name);
- }
-
-