From 6fe7f8cd0cb14185b04ea532e1ce453f1003b8cb Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 10 Jul 2011 12:17:12 +1000 Subject: Allow drag to trash to delete. --- cocoa/ScintillaView.mm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 5c14560a7..5025fe209 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -501,7 +501,19 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI"; */ - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL) flag { - return NSDragOperationCopy | NSDragOperationMove; + return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete; +} + +//-------------------------------------------------------------------------------------------------- + +/** + * Finished a drag: may need to delete selection. + */ + +- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation { + if (operation == NSDragOperationDelete) { + mOwner.backend->WndProc(SCI_CLEAR, 0, 0); + } } //-------------------------------------------------------------------------------------------------- -- cgit v1.2.3