diff -r 7b250285547b -r 112670159075 UIPainterView.st --- a/UIPainterView.st Tue Oct 08 17:28:30 2002 +0200 +++ b/UIPainterView.st Tue Oct 08 18:00:46 2002 +0200 @@ -252,6 +252,8 @@ " |specs coll index oldSelection newSelection treeModel children size nd| + treeView askForSelectionChangeAllowed ifFalse:[^ self]. + coll := self minSetOfSuperViews:(self selection). coll notNil ifTrue:[ @@ -364,7 +366,19 @@ pasteSpecifications:aSpecificationOrList keepLayout:keepLayout keepPosition:keepPosition at:aPointOrNil "add the specs to the object view; returns list of pasted components " - |paste frame pasteOrigin pasteOffset builder newSel bounds| + |paste frame pasteOrigin pasteOffset builder newSel bounds container| + + treeView askForSelectionChangeAllowed ifFalse:[^ nil]. + + (self canPasteInto:(self singleSelection)) ifFalse:[ + (container := self singleSelection) notNil ifTrue:[ + "/ search up parent list for something we can paste into + [container notNil and:[(self canPasteInto:container) not]] whileTrue:[ + container := container container. + ]. + self selection:container. + ]. + ]. (self canPaste:aSpecificationOrList) ifFalse:[ ^ nil @@ -378,7 +392,7 @@ (frame := self singleSelection) isNil ifTrue:[ frame := self ]. - self selection:nil. + self setSelection:nil. newSel := OrderedCollection new. builder := UIBuilder new isEditing:true. @@ -2293,4 +2307,5 @@ version ^ '$Header$' ! ! + UIPainterView initialize!