UIPainterView.st
changeset 1870 771fcc38ecb8
parent 1869 d7a4c2b7fddb
child 1872 ab5cc43b193a
--- a/UIPainterView.st	Fri Sep 17 15:14:36 2004 +0200
+++ b/UIPainterView.st	Tue Sep 21 12:30:01 2004 +0200
@@ -231,12 +231,10 @@
 
     coll notNil ifTrue:[
 "/        self select:nil.
-	specs := coll collect:[:aView| self fullSpecFor:aView ].
-	self setSelection:specs.
+        specs := coll collect:[:aView| self fullSpecFor:aView ].
+        self setClipboardObject:specs.
 "/        treeView selection: sel
     ].
-
-
 !
 
 deleteSelection
@@ -256,43 +254,43 @@
     coll := self minSetOfSuperViews:(self selection).
 
     coll notNil ifTrue:[
-	treeView cvsEventsDisabledDo:[
-	    treeModel    := treeView model.
-	    oldSelection := treeModel selectedNodes at:1 ifAbsent: nil.
-
-	    oldSelection notNil ifTrue:[
-		children := oldSelection parent children.
-		(size := children size) > 1 ifTrue:[
-		    index := children identityIndexOf:oldSelection.
-		    size == index ifTrue:[
-			index := index - 1
-		    ].
-		    newSelection := children at:index ifAbsent:1.
-		] ifFalse:[
-		    newSelection := oldSelection parent
-		].
-		newSelection := treeModel indexOf:newSelection.
-	    ] ifFalse:[
-		newSelection := 1
-	    ].
-
-	    self hideSelection.
-	    selection := nil.
-	    specs := coll collect:[:aView| self fullSpecFor:aView ].
-
-	    self withinTransaction:#cut objects:coll do:[
-		coll reverseDo:[:aView|
-		    self createUndoRemove:aView.
-		    self remove:aView.
-		]
-	    ].
-	    buffered ifTrue: [self setSelection:specs].
-	    treeView selection:nil.
-	    treeView selection:(Array with: newSelection).
-	    (nd := treeView selectedNode) notNil ifTrue:[
-		self setSelection:nd contents view withRedraw:true.
-	    ]
-	]
+        treeView cvsEventsDisabledDo:[
+            treeModel    := treeView model.
+            oldSelection := treeModel selectedNodes at:1 ifAbsent: nil.
+
+            oldSelection notNil ifTrue:[
+                children := oldSelection parent children.
+                (size := children size) > 1 ifTrue:[
+                    index := children identityIndexOf:oldSelection.
+                    size == index ifTrue:[
+                        index := index - 1
+                    ].
+                    newSelection := children at:index ifAbsent:1.
+                ] ifFalse:[
+                    newSelection := oldSelection parent
+                ].
+                newSelection := treeModel indexOf:newSelection.
+            ] ifFalse:[
+                newSelection := 1
+            ].
+
+            self hideSelection.
+            selection := nil.
+            specs := coll collect:[:aView| self fullSpecFor:aView ].
+
+            self withinTransaction:#cut objects:coll do:[
+                coll reverseDo:[:aView|
+                    self createUndoRemove:aView.
+                    self remove:aView.
+                ]
+            ].
+            buffered ifTrue: [self setClipboardObject:specs].
+            treeView selection:nil.
+            treeView selection:(Array with: newSelection).
+            (nd := treeView selectedNode) notNil ifTrue:[
+                self setSelection:nd contents view withRedraw:true.
+            ]
+        ]
     ]
 !
 
@@ -538,14 +536,13 @@
     "
     |prop|
 
-    aView notNil ifTrue:[
-	(prop := self propertyRespondsToView:aView) notNil ifTrue:[
-	    ^ prop spec class supportsSubComponents
-	].
-      ^ aView specClass supportsSubComponents.
+    aView isNil ifTrue:[ ^ false ].
+
+(aView isKindOf:VerticalPanelView) ifTrue:[self halt].
+    (prop := self propertyOfView:aView) notNil ifTrue:[
+        ^ prop spec class supportsSubComponents
     ].
-    ^ false
-
+    ^ aView specClass supportsSubComponents.
 !
 
 drop:anObjectOrCollection at:aPoint
@@ -1765,10 +1762,10 @@
     |view prop|
 
     view := super findObjectAt:aPoint.
-    prop := self propertyRespondsToView:view.
+    prop := self propertyOfView:view.
 
     prop notNil ifTrue:[^ prop view].
-  ^ nil
+    ^ nil
 !
 
 findViewWithId:aViewId
@@ -1808,32 +1805,23 @@
     "
     |item|
 
-    (item := treeView detectItemRespondsToView:aSubView) notNil ifTrue:[
-	(item := item parent) notNil ifTrue:[^ item contents]
+    (item := treeView detectItemCorespondingToView:aSubView) notNil ifTrue:[
+        (item := item parent) notNil ifTrue:[^ item contents]
     ].
     ^ nil
 !
 
 propertyOfView:aView
-    "returns property assigned to view
-    "
-    (aView isNil or:[aView == self]) ifFalse:[
-	^ treeView propertyDetect:[:p| p view == aView ]
-    ].
-    ^ nil
-!
-
-propertyRespondsToView:aView
-    "detect the property responding to the argument a view. The property of the view or
+    "detect the property for the argument, a view. The property of the view or
      the first subview providing the properties is returned. If no property is detected
      nil is returned.
     "
     |item|
 
-    item := treeView detectItemRespondsToView:aView.
+    item := treeView detectItemCorespondingToView:aView.
 
     (item notNil and:[item parent notNil]) ifTrue:[
-	^ item contents
+        ^ item contents
     ].
     ^ nil
 !