# HG changeset patch # User Claus Gittinger # Date 1242027568 -7200 # Node ID 89612a372d8b4d96be1c533ca8a5f72cf5262a8a # Parent d9dc378aaf8d630551f181a5fc145f7186e6ff1c code cleanup diff -r d9dc378aaf8d -r 89612a372d8b UIPainterView.st --- a/UIPainterView.st Mon May 11 08:36:06 2009 +0200 +++ b/UIPainterView.st Mon May 11 09:39:28 2009 +0200 @@ -2782,8 +2782,8 @@ !UIPainterView methodsFor:'undo actions'! createUndoLayout:aView - "create undo action before changing a views layout - " + "create undo action before changing a views layout" + |lyt args prop| undoHistory isTransactionOpen ifTrue:[ @@ -2840,6 +2840,26 @@ ] ! +createUndoStartPointEndPoint:aComponent + "create an undo action before changing aComponent" + + |args prop| + + undoHistory isTransactionOpen ifTrue:[ + prop := self propertyOfView:aComponent. + + prop notNil ifTrue:[ + args := Array new:4. + args at:1 put:(prop identifier). + args at:2 put:#'startPoint:endPoint:'. + args at:3 put:(aComponent startPoint). + args at:4 put:(aComponent endPoint). + undoHistory addUndoSelector:#undoStartPointEndPoint: withArgs:args. + self undoHistoryChanged. + ] + ] +! + undoCreate:something "undo method for creating or pasting an object " @@ -2903,6 +2923,18 @@ self rebuildView:view fromSpec:spec withBuilder:nil. treeView propertyChanged:props. ] +! + +undoStartPointEndPoint:args + "undo method to set the old start/endPoint; see 'createUndoStartPointEndPoint:' + " + |view| + + (view := self findViewWithId:(args at:1)) notNil ifTrue:[ + view perform:(args at:2) with:(args at:3) with:(args at:4). + self elementChangedSize:view. + self layoutChanged. + ] ! ! !UIPainterView::ViewProperty class methodsFor:'instance creation'!