set selection interface changed
authorca
Tue, 21 Sep 2004 12:30:01 +0200
changeset 1870 771fcc38ecb8
parent 1869 d7a4c2b7fddb
child 1871 42729969c032
set selection interface changed
UIPainter.st
UIPainterView.st
UISelectionPanel.st
--- a/UIPainter.st	Fri Sep 17 15:14:36 2004 +0200
+++ b/UIPainter.st	Tue Sep 21 12:30:01 2004 +0200
@@ -4300,12 +4300,11 @@
 
     |parent| 
 
-    parent := self detectItemRespondsToView:(aProperty view superView).
+    parent := self detectItemCorespondingToView:(aProperty view superView).
 
     parent notNil ifTrue:[
-	model add:(TreeItem new contents:aProperty) below:parent
+        model add:(TreeItem new contents:aProperty) below:parent
     ]
-
 !
 
 removeAll
@@ -4755,20 +4754,19 @@
 
 !UIPainter::TreeView methodsFor:'searching'!
 
-detectItemRespondsToView:aView
-    "detects the item responding to the view. The item of the view or the first
+detectItemCorespondingToView:aView
+    "detects the item coresponding to the view. The item of the view or the first
      subview providing the item is returned. If no property is detected nil is
      returned"
 
     |view item|
 
     (view := aView) notNil ifTrue:[
-	[(item := self itemOfView:view) isNil] whileTrue:[
-	    (view := view superView) isNil ifTrue:[^ listOfNodes at:1]
-	].
+        [(item := self itemOfView:view) isNil] whileTrue:[
+            (view := view superView) isNil ifTrue:[^ listOfNodes at:1]
+        ].
     ].
     ^ item
-
 ! !
 
 !UIPainter::TreeView methodsFor:'user interaction'!
--- 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
 !
--- a/UISelectionPanel.st	Fri Sep 17 15:14:36 2004 +0200
+++ b/UISelectionPanel.st	Tue Sep 21 12:30:01 2004 +0200
@@ -1516,7 +1516,7 @@
             gallery update.
         ] ifFalse:[
             value == #copy ifTrue:[
-                self window setSelection:spec
+                self window setClipboardObject:spec
             ]
         ].
       ^ self