This is MiscDragView-Delegate.m in view mode; [Download] [Up]
{\rtf0\ansi{\fonttbl\f4\fmodern Courier;\f0\fswiss Helvetica;\f1\fmodern Ohlfs;} \paperw11760 \paperh7800 \margl120 \margr120 \pard\tx540\tx1140\tx1680\tx2300\tx3340\tx3920\tx4500\tx5040\tx9200\tx11520\f4\b0\i0\ulnone\fs24\fc0\cf0 /***************************************************************\ CATEGORY: MiscDragView (Delegate)\ * Copyright (C) 1995 Robert Todd Thomas\ * Use is governed by the MiscKit license\ \ See the header for more information on this category.\ ***************************************************************/\ \ #import <appkit/appkit.h>\ #import "MiscDragView-BackwardCompat.h"\ #import "MiscDragView-Delegate.h"\ \ \ \f0\b @implementation MiscDragView (Delegate) \f4\b0 \ \ \f0\b - delegate \f4\b0 \ \{\ return delegate;\ \}\ \ \ \ // The delegate will only be sent messages that it can respond to.\ \ \f0\b - setDelegate: (id)theDelegate \f4\b0 \ \{ if(!theDelegate)\ \{ [self unregisterDraggedTypes];\ [self setImage:nil];\ [self setAcceptingImage:nil];\ \}\ delegate = theDelegate;\ if ([delegate respondsTo:@selector(image:)])\ [self setImage:[delegate image:self]];\ else if([delegate respondsTo:@selector(image)])\ [self setImage:[delegate image]];\ if ([delegate respondsTo:@selector(acceptingImage:)])\ [self setAcceptingImage:[delegate acceptingImage:self]];\ else if([delegate respondsTo:@selector(acceptingImage)])\ [self setAcceptingImage:[delegate acceptingImage]];\ [self initDragTypes];\ return self;\ \}\ \ \ \ // Sent from "mouseDown" just before the dragging starts to take place\ \ \f0\b - _sourceDragInitiated: sender \f4\b0 \ \{\ // here for backward compatibility, please use new delegate\ // methods\ if ([delegate respondsTo: @selector(sourceDragInitiated:)])\ [delegate sourceDragInitiated: sender];\ \ // newly renamed delegate methods\ if ([delegate respondsTo: @selector(didInitiateSourceDrag:)])\ [delegate didInitiateSourceDrag: sender];\ \ return self;\ \}\ \ \ \ // Sent when "draggedImage: endedAt: screenPoint: deposited:" is given \ // control and success is whether the image was deposited in another\ // view somewhere.\ \ \f0\b - _sourceDragFinished: (BOOL)successful \f4\b0 \ \{\ // here for backward compatibility, please use new delegate\ // methods\ if ([delegate respondsTo: @selector(sourceDragFinished:)])\ [delegate sourceDragFinished: successful];\ \ // new delegate method\ if ([delegate respondsTo: @selector(didFinishSourceDrag:)])\ [delegate didFinishSourceDrag: successful];\ \ return self;\ \}\ \ \ \ // Sent when "draggingEntered:" is given control.\ \ \f0\b - _destinationDragInitiated: sender \f4\b0 \ \{\ // here for backward compatibility, please use new delegate\ // methods\ if ([delegate respondsTo: @selector(destinationDragInitiated:)])\ [delegate destinationDragInitiated: sender];\ \ // new delegate method\ if ([delegate respondsTo: @selector(didInitiateDestinationDrag:)])\ [delegate didInitiateDestinationDrag: sender];\ \ return self;\ \}\ \ \ \ // Sent when "concludeDragOperation:" is given control\ \ \f0\b - _destinationDragFinished: (BOOL)successful \f4\b0 \ \{\ // here for backward compatibility, please use new delegate\ // methods\ if ([delegate respondsTo: @selector(destinationDragFinished:)])\ [delegate destinationDragFinished: successful];\ \ // new delegate method\ if ([delegate respondsTo: @selector(didFinishDestinationDrag:)])\ [delegate didFinishDestinationDrag: successful];\ \ return self;\ \}\ \ \f0\b @end \f4\b0 \ \ }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.