--- 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'!