--- a/DragAndDropManager.st Thu Mar 20 13:17:56 2008 +0100
+++ b/DragAndDropManager.st Thu Mar 20 13:40:28 2008 +0100
@@ -14,7 +14,8 @@
Object subclass:#DragAndDropManager
instanceVariableNames:'dropContext dragView dropAction dragOffset handler restoreBlock
alienCursor enabledCursor disabledCursor canDrop escapePressed
- passiveAction autoScrollTask disabledFlag giveFocusToTargetWidget'
+ passiveAction autoScrollTask disabledFlag giveFocusToTargetWidget
+ notifyEndOfDropAction'
classVariableNames:'DragContextQuerySignal DragOriginatorQuerySignal
DragOffsetQuerySignal ActiveDragAndDropManagers'
poolDictionaries:''
@@ -879,6 +880,12 @@
^ disabledFlag ? false
!
+notifyEndOfDropAction: aNoneArgBlock
+ "the action is triggered after the drop has finished"
+
+ notifyEndOfDropAction := aNoneArgBlock.
+!
+
passiveAction:aBlockOrNil
self removePassiveAction.
aBlockOrNil notNil ifTrue:[
@@ -1290,7 +1297,7 @@
escapePressed
"handle the escape key"
- |dropTarget|
+ | dropTarget |
escapePressed ~~ true ifTrue:[
escapePressed := true.
@@ -1306,6 +1313,7 @@
dropContext dropTarget:nil.
].
].
+ self triggerEndOfDropAction.
].
!
@@ -1371,6 +1379,18 @@
]
].
^ true
+!
+
+triggerEndOfDropAction
+ "handle the escape key"
+
+ |action|
+
+ action := notifyEndOfDropAction.
+ action isNil ifTrue:[ ^ self ].
+
+ notifyEndOfDropAction := nil.
+ action value.
! !
!DragAndDropManager methodsFor:'initialization'!
@@ -1519,6 +1539,8 @@
windowGroup removePreEventHook:self.
windowGroup removePostEventHook:self.
dragView cursor:savedCursor.
+
+ self triggerEndOfDropAction.
].
aHandler preDraggingIn:dragView.
@@ -1583,7 +1605,7 @@
!DragAndDropManager class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.75 2008-03-10 09:21:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.76 2008-03-20 12:40:28 ca Exp $'
! !
DragAndDropManager initialize!