UIPainterView.st
changeset 1520 eb77c52704c7
parent 1500 36c0b4b268b8
child 1543 09c4ed98434d
--- a/UIPainterView.st	Fri Oct 26 19:53:42 2001 +0200
+++ b/UIPainterView.st	Tue Oct 30 15:47:54 2001 +0100
@@ -516,24 +516,30 @@
 !
 
 drop:anObjectOrCollection at:aPoint
-    |spec newSel oldSel dragOffset|
+    |spec newSel oldSel dragOffset widg|
 
     self selection notNil ifTrue:[
         oldSel := self singleSelection.
 
-        (self canPasteInto:oldSel) ifFalse:[
-            oldSel := nil.
-            self setSelection:nil withRedraw:true
-        ]
+        "/ search selections hierarchy for a widget into which we can paste
+        widg := oldSel.
+        [widg isNil or:[self canPasteInto:widg]] whileFalse:[
+            widg notNil ifTrue:[
+                widg := widg container
+            ].
+        ].
+
+        oldSel := nil.
+        self setSelection:widg withRedraw:true.
     ].
     spec := (anObjectOrCollection at:1) theObject.
     dragOffset := DragAndDropManager dragOffsetQuerySignal query.
     newSel := self pasteSpecifications:spec keepLayout:false at:aPoint - dragOffset.
 
-    oldSel isNil ifTrue:[self select:newSel]
-                ifFalse:[self select:oldSel]
+    self select:(oldSel ? newSel)
 
     "Modified: / 18.3.1999 / 18:29:43 / stefan"
+    "Modified: / 30.10.2001 / 14:02:35 / cg"
 ! !
 
 !UIPainterView methodsFor:'event handling'!
@@ -1962,6 +1968,7 @@
                         name := props name
                     ]
                 ].
+
                 aSpec name:name.
                 self createUndoSpecModify:props.
                 self rebuildView:aView fromSpec:aSpec withBuilder:nil.
@@ -1971,7 +1978,7 @@
         ]
     ]
 
-    "Modified: 4.7.1997 / 23:49:44 / cg"
+    "Modified: / 30.10.2001 / 13:59:45 / cg"
 ! !
 
 !UIPainterView methodsFor:'testing'!
@@ -2127,6 +2134,12 @@
     self forEach:something do:[:anId|self remove:(self findViewWithId:anId)].
 !
 
+undoHistory
+    ^ undoHistory
+
+    "Created: / 30.10.2001 / 13:42:45 / cg"
+!
+
 undoLayout:args
     "undo method to set the old layout; see 'createUndoLayout:'
     "