UIObjectView.st
changeset 967 c3f483120cd7
parent 897 43f9bdc12ae4
child 993 88a214788277
--- a/UIObjectView.st	Mon Aug 24 12:57:57 1998 +0200
+++ b/UIObjectView.st	Mon Aug 24 13:05:14 1998 +0200
@@ -939,45 +939,73 @@
 showUnselected:aComponent addAffectedViewsTo:aSet
     "show object unselected. If the set, an IdentitySet, is not nil, the
      affected subviews are added into the set, otherwise an expose event
-     to each affected cpomponent is raised.
+     to each affected component is raised.
     "
-    |wasClipped r|
+    |wasClipped r v|
 
     selectionHiddenLevel ~~ 0 ifTrue:[^ self].
 
-    (wasClipped := clipChildren) ifTrue:[
-        self clippedByChildren:(clipChildren := false). 
+    "/ new: simply create a little view ontop,
+    "/ and move it over the handles. This will generate
+    "/ the required expose events automatically.
+
+    v := SimpleView in:self.
+    self handlesOf:aComponent do:[:rec :wht | 
+        r isNil 
+            ifTrue:[r := rec]
+            ifFalse:[r := r merge:rec].
     ].
 
-    self handlesOf:aComponent do:[:rec :wht| self clearRectangle:rec ].
-
-    wasClipped ifTrue:[
-        self clippedByChildren:(clipChildren := true). 
+    "/ if the area is small, make one big rectangle-expose
+    r area < 10000 ifTrue:[
+        v origin:r origin extent:r extent.
+        v map.
+        v unmap.
+    ] ifFalse:[
+        self handlesOf:aComponent do:[:rec :wht | 
+            v origin:rec origin extent:rec extent.
+            v map.
+            v unmap.
+        ].
     ].
-
-    "/ must redraw all components which are affected b the handles
-    r := (aComponent originRelativeTo:self) - (3@3) extent:(aComponent extent + (6@6)).
-
-    subViews do:[:anotherComponent |
-        |absOrg absFrame|
-
-        anotherComponent ~~ inputView ifTrue:[
-            absOrg := anotherComponent originRelativeTo:self.
-            absFrame := absOrg extent:(anotherComponent extent).
-            (absFrame intersects:r) ifTrue:[
-                anotherComponent withAllSubViewsDo:[:v |
-                    v shown ifTrue:[
-                        aSet notNil ifTrue:[
-                            aSet add:v
-                        ] ifFalse:[
-                            self handleAffectedViews:v
-                        ]
-                    ]
-                ]
-            ]
-        ]
-    ].
-
+    v destroy.
+    ^ self.
+
+"/ OLD code:
+"/    (wasClipped := clipChildren) ifTrue:[
+"/        self clippedByChildren:(clipChildren := false). 
+"/    ].
+"/
+"/    self handlesOf:aComponent do:[:rec :wht| self clearRectangle:rec ].
+"/
+"/    wasClipped ifTrue:[
+"/        self clippedByChildren:(clipChildren := true). 
+"/    ].
+"/
+"/    "/ must redraw all components which are affected b the handles
+"/    r := (aComponent originRelativeTo:self) - (3@3) extent:(aComponent extent + (6@6)).
+"/
+"/    subViews do:[:anotherComponent |
+"/        |absOrg absFrame|
+"/
+"/        anotherComponent ~~ inputView ifTrue:[
+"/            absOrg := anotherComponent originRelativeTo:self.
+"/            absFrame := absOrg extent:(anotherComponent extent).
+"/            (absFrame intersects:r) ifTrue:[
+"/                anotherComponent withAllSubViewsDo:[:v |
+"/                    v shown ifTrue:[
+"/                        aSet notNil ifTrue:[
+"/                            aSet add:v
+"/                        ] ifFalse:[
+"/                            self handleAffectedViews:v
+"/                        ]
+"/                    ]
+"/                ]
+"/            ]
+"/        ]
+"/    ].
+
+    "Modified: / 24.8.1998 / 12:19:38 / cg"
 !
 
 whichHandleOf:aComponent isHitBy:aPoint