--- a/UIPainterView.st Fri Jul 28 19:35:45 2000 +0200
+++ b/UIPainterView.st Wed Aug 09 11:32:15 2000 +0200
@@ -10,6 +10,8 @@
hereby transferred.
"
+"{ Package: 'stx:libtool2' }"
+
UIObjectView subclass:#UIPainterView
instanceVariableNames:'treeView listHolder superclassName className methodName
categoryName handleColor handleMasterColor'
@@ -247,24 +249,21 @@
"cut the selection into the cut&paste-buffer
and open a transaction
"
- |specs coll oldSelectedNode newSelectedNode newSelection|
+ |specs coll oldSelection newSelection treeModel|
coll := self minSetOfSuperViews:(self selection).
coll notNil ifTrue:[
treeView cvsEventsDisabledDo:[
-
- ((oldSelectedNode := (treeView model selectedNodes at: 1 ifAbsent: nil)) notNil and:
- [oldSelectedNode parent notNil]) ifTrue: [
- oldSelectedNode parent children size <= 1 ifTrue: [
- newSelectedNode := oldSelectedNode parent
- ]
- ifFalse: [
- newSelectedNode := oldSelectedNode parent children
- at: (oldSelectedNode parent indexOfChild: oldSelectedNode) - 1
- ifAbsent: [oldSelectedNode parent children at: 2]
- ].
+ treeModel := treeView model.
+ oldSelection := treeModel selectedNodes at:1 ifAbsent: nil.
+
+ oldSelection notNil ifTrue:[
+ oldSelection := (treeModel indexOf:oldSelection) max:1
+ ] ifFalse:[
+ oldSelection := 1.
].
+
self hideSelection.
selection := nil.
specs := coll collect:[:aView| self fullSpecFor:aView ].
@@ -275,13 +274,11 @@
self remove:aView.
]
].
- buffered ifTrue: [self setSelection: specs].
- treeView selection: nil.
- (newSelection := (treeView model indexOf:newSelectedNode)) > 0 ifFalse: [
- newSelection := 1
- ].
- treeView selection: (Array with: newSelection).
- self setSelection:treeView selectedNode contents view withRedraw: true.
+ buffered ifTrue: [self setSelection:specs].
+ treeView selection:nil.
+ newSelection := oldSelection min:(treeModel list size).
+ treeView selection:(Array with: newSelection).
+ self setSelection:treeView selectedNode contents view withRedraw:true.
]
]
!
@@ -344,7 +341,7 @@
pasteSpecifications:aSpecificationOrList keepLayout:keepLayout at:aPointOrNil
"add the specs to the object view; returns list of pasted components
"
- self
+ ^ self
pasteSpecifications:aSpecificationOrList
keepLayout:keepLayout
keepPosition:false
@@ -369,7 +366,6 @@
(frame := self singleSelection) isNil ifTrue:[
frame := self
].
-
self selection:nil.
newSel := OrderedCollection new.