UIObjectView.st
changeset 78 a0a00603a8b6
parent 76 c9c4254a9ee5
child 79 33212fbe9766
--- a/UIObjectView.st	Mon Mar 03 11:08:15 1997 +0100
+++ b/UIObjectView.st	Tue Mar 04 11:21:16 1997 +0100
@@ -272,16 +272,15 @@
 keyPress:key x:x y:y
     "any key pressed
     "
-    <resource: #keyboard ( #InspectIt #Delete #BackSpace #Cut) >
-
-    key == #InspectIt ifTrue:[
-        ^ self inspectSelection
-    ].
+    <resource: #keyboard ( #Delete #BackSpace #Cut #Copy #Paste ) >
 
     (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [
         ^ self deleteSelection
     ].
 
+    key == #Copy  ifTrue:[ ^ self copySelection].
+    key == #Paste ifTrue:[ ^ self pasteBuffer].
+
     super keyPress:key x:x y:y
 
 
@@ -392,25 +391,16 @@
 
 !
 
-minSetOfSuperViews:aCollectionOfViews
-    |setOfViews setOfSuperViews|
-
-    aCollectionOfViews isCollection ifFalse:[
-        ^ aCollectionOfViews
+minSetOfSuperViews:setOfViews
+
+    setOfViews isCollection ifFalse:[
+        setOfViews notNil ifTrue:[^ Array with:setOfViews]
+                         ifFalse:[^ nil]
     ].
 
-    setOfViews := aCollectionOfViews asIdentitySet.
-
-    setOfSuperViews := setOfViews select:[:aView|
-                            (setOfViews detect:[:v|aView isComponentOf:v]
-                                     ifNone:nil
-                            ) isNil
-                        ].
-
-    setOfSuperViews size == 1 ifTrue:[
-        ^ setOfSuperViews first
-    ].
-    ^ setOfSuperViews asOrderedCollection
+  ^ setOfViews select:[:aView|
+        (setOfViews detect:[:v|aView isComponentOf:v] ifNone:nil) isNil
+    ]
 !
 
 setDefaultActions
@@ -523,7 +513,7 @@
 
 !
 
-setupCreatedObject:anObject
+initializeCreatedObject:anObject
     self subclassResponsibility
 !
 
@@ -566,7 +556,7 @@
     frame := Rectangle origin:(start - delta) corner:start.
 
     object origin:(frame origin).
-    self setupCreatedObject:object.
+    self initializeCreatedObject:object.
     object realize.
 
     self actionCreate:object frame:frame delta:delta.
@@ -1044,7 +1034,7 @@
             ^ aView geometryLayout:layout
         ].
 
-        layout := aView geometryLayout.
+        layout := aView geometryLayout copy.
 
         layout isLayout ifTrue:[
             layout leftOffset:(layout leftOffset + l)
@@ -1166,14 +1156,6 @@
     ]
 !
 
-inspectSelection
-    "inspect selection
-    "
-    self singleSelectionDo:[:aView |
-        aView inspect
-    ]
-!
-
 numberOfSelections
     "return the number of selected entries
     "
@@ -1250,6 +1232,8 @@
 withSelectionHiddenDo:aBlock
     "apply block with selection hidden (no handles)
     "
+    |coll|
+
     selectionHiddenLevel := selectionHiddenLevel + 1.
 
     selectionHiddenLevel == 1 ifTrue:[
@@ -1260,14 +1244,8 @@
     aBlock valueNowOrOnUnwindDo:[
         selectionHiddenLevel == 1 ifTrue:[
             setOfSuperViewsSizeChanged notEmpty ifTrue:[
-                |s|
-                s := self minSetOfSuperViews:setOfSuperViewsSizeChanged.
-
-                s isCollection ifTrue:[
-                    s do:[:aSuperView|aSuperView sizeChanged:nil]
-                ] ifFalse:[
-                    s sizeChanged:nil
-                ].
+                coll := self minSetOfSuperViews:setOfSuperViewsSizeChanged.
+                coll do:[:aView| aView sizeChanged:nil].
                 setOfSuperViewsSizeChanged := IdentitySet new
             ].
             self selectionDo:[:aView| self showSelected:aView].