# HG changeset patch # User Claus Gittinger # Date 1004453274 -3600 # Node ID eb77c52704c7abed2e1f50957f15ee5f6975e349 # Parent 6196930f9a1dd5db79149a703f4d661c8b816476 drop: paste in surrounding view if not possible to drop in selected. undo: show type of undo in menu; diff -r 6196930f9a1d -r eb77c52704c7 UIPainterView.st --- 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:' "