Skip to content
Browse files

Add 10.7 supported drag and drop methods

  • Loading branch information...
1 parent 5c616dd commit de1019eb30021aef38e53ee83eeba1fc63ac7ffd @Abizern Abizern committed Sep 12, 2012
Showing with 37 additions and 0 deletions.
  1. +31 −0 PXSourceList/PXSourceList.m
  2. +6 −0 PXSourceList/PXSourceListDataSource.h
View
31 PXSourceList/PXSourceList.m
@@ -748,6 +748,37 @@ - (NSArray *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppe
return nil;
}
+#pragma mark 10.7 only methods
+
+- (id <NSPasteboardWriting>)outlineView:(NSOutlineView *)outlineView pasteboardWriterForItem:(id)item
+{
+ if ([_secondaryDataSource respondsToSelector:@selector(sourceList:pasteboardWriterForItem:)]) {
+ return [_secondaryDataSource sourceList:self pasteboardWriterForItem:item];
+ }
+
+ return nil;
+}
+- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItems:(NSArray *)draggedItems
+{
+ if ([_secondaryDataSource respondsToSelector:@selector(sourceList:draggingSession:willBeginAtPoint:forItems:)]) {
+ return [_secondaryDataSource sourceList:self draggingSession:session willBeginAtPoint:screenPoint forItems:draggedItems];
+ }
+
+}
+
+- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation
+{
+ if ([_secondaryDataSource respondsToSelector:@selector(sourceList:draggingSession:endedAtPoint:operation:)]) {
+ return [_secondaryDataSource sourceList:self draggingSession:session endedAtPoint:screenPoint operation:operation];
+ }
+}
+
+- (void)outlineView:(NSOutlineView *)outlineView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo
+{
+ if ([_secondaryDataSource respondsToSelector:@selector(sourceList:updateDraggingItemsForDrag:)]) {
+ return [_secondaryDataSource sourceList:self updateDraggingItemsForDrag:draggingInfo];
+ }
+}
#pragma mark -
#pragma mark NSOutlineView Delegate methods
View
6 PXSourceList/PXSourceListDataSource.h
@@ -38,4 +38,10 @@
- (BOOL)sourceList:(PXSourceList*)aSourceList acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index;
- (NSArray *)sourceList:(PXSourceList*)aSourceList namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items;
+//Drag and drop methods added for 10.7
+- (id <NSPasteboardWriting>)sourceList:(PXSourceList *)aSourceList pasteboardWriterForItem:(id)item;
+- (void)sourceList:(PXSourceList *)aSourceList draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItems:(NSArray *)draggedItems;
+- (void)sourceList:(PXSourceList *)aSourceList draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation;
+- (void)sourceList:(PXSourceList *)aSourceList updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo;
+
@end

0 comments on commit de1019e

Please sign in to comment.
Something went wrong with that request. Please try again.