# HG changeset patch # User ca # Date 1033709208 -7200 # Node ID 9b0f45e63e248fe418fa42de4a8fb60dce830974 # Parent 00275352f251232bdddbc383d8e244636bc03f27 bug fix if operation cancled by #Escape, must invoke #leave diff -r 00275352f251 -r 9b0f45e63e24 DragAndDropManager.st --- a/DragAndDropManager.st Wed Oct 02 11:35:53 2002 +0200 +++ b/DragAndDropManager.st Fri Oct 04 07:26:48 2002 +0200 @@ -1263,18 +1263,30 @@ ! keyPress:aKey x:x y:y view:aView - escapePressed == true ifTrue:[^ self ]. + "any key is pressed: + #Escape cancel drag & drop operation + " + |dropTarget| - escapePressed := aKey == #Escape. + escapePressed == true ifTrue:[^ self ]. "/ already canceled + + aKey == #Escape ifTrue:[ + "/ cancel drag & drop operation + escapePressed := true. - escapePressed ifFalse:[ - ^ self + handler ifNotNil:[ + "/ restore handler + dropTarget := dropContext dropTarget. + handler postDragging. + + dropTarget ifNotNil:[ + "/ invoke leave operation + dropTarget leave:dropContext. + dropContext dropTarget:nil. + ]. + ]. + ^ self ]. - handler ifNotNil:[ - handler postDragging - ]. -"/ self buttonMotion:#select x:x y:y view:aView. -"/ restoreBlock value. ! ! !DragAndDropManager methodsFor:'initialization'! @@ -1446,6 +1458,7 @@ !DragAndDropManager class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.41 2002-09-16 10:17:07 ca Exp $' + ^ '$Header: /cvs/stx/stx/libview2/DragAndDropManager.st,v 1.42 2002-10-04 05:26:48 ca Exp $' ! ! + DragAndDropManager initialize!