UISelectionPanel.st
changeset 167 01cbd385f878
parent 150 9f88bc99e0af
child 182 5e0f65e92d95
--- a/UISelectionPanel.st	Fri Jun 20 19:33:06 1997 +0200
+++ b/UISelectionPanel.st	Fri Jun 20 19:34:01 1997 +0200
@@ -291,6 +291,11 @@
                     #'name:' 'label1'
                     #'layout:' #(#LayoutFrame 150 0 73 0 236 0 89 0)
                     #'label:' 'MenuPanel'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
@@ -614,29 +619,49 @@
                 )
                  #(#LabelSpec
                     #'name:' 'HTMLViewLabel'
-                    #'layout:' #(#LayoutFrame 93 0 179 0 158 0 193 0)
+                    #'layout:' #(#LayoutFrame 93 0 179 0 183 0 193 0)
                     #'label:' 'HTMLView'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
                  #(#LabelSpec
                     #'name:' 'label1'
-                    #'layout:' #(#LayoutFrame 93 0 83 0 155 0 97 0)
+                    #'layout:' #(#LayoutFrame 93 0 83 0 183 0 97 0)
                     #'label:' 'EditText'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
                  #(#LabelSpec
                     #'name:' 'label2'
-                    #'layout:' #(#LayoutFrame 295 0 83 0 382 0 97 0)
+                    #'layout:' #(#LayoutFrame 295 0 83 0 387 0 97 0)
                     #'label:' 'SelectionInList'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
                  #(#LabelSpec
                     #'name:' 'labelInLabel'
-                    #'layout:' #(#LayoutFrame 226 0 142 0 260 0 156 0)
+                    #'layout:' #(#LayoutFrame 226 0 142 0 275 0 156 0)
                     #'label:' 'Label'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
@@ -692,6 +717,11 @@
                     #'name:' 'subCanvasLabel'
                     #'layout:' #(#LayoutFrame 272 0 86 0 343 0 100 0)
                     #'label:' 'SubCanvas'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
@@ -709,6 +739,11 @@
                     #'name:' 'viewLabel'
                     #'layout:' #(#LayoutFrame 19 0 118 0 70 0 135 0)
                     #'label:' 'View'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
@@ -716,12 +751,17 @@
                     #'name:' 'Seperators'
                     #'layout:' #(#LayoutFrame 199 0 125 0 270 0 143 0)
                     #'label:' 'Seperators'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'adjust:' #left
                     #'canUIDrag:' false
                 )
                  #(#RegionSpec
                     #'name:' 'Region'
-                    #'layout:' #(#LayoutFrame 377 0 14 0 467 0 104 0)
+                    #'layout:' #(#LayoutFrame 373 0 14 0 473 0 104 0)
                     #'lineWidth:' 2
                     #'regionType:' #ellipse
                 )
@@ -729,6 +769,37 @@
                     #'name:' 'RegionLabel'
                     #'layout:' #(#LayoutFrame 388 0 50 0 459 0 68 0)
                     #'label:' 'Region'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
+                    #'canUIDrag:' false
+                )
+                 #(#UISubSpecification
+                    #'name:' 'UISubSpecification'
+                    #'layout:' #(#LayoutFrame 373 0 116 0 473 0 188 0)
+                )
+                 #(#LabelSpec
+                    #'name:' 'SubSpec label 1'
+                    #'layout:' #(#LayoutFrame 403 0 132 0 442 0 150 0)
+                    #'label:' 'UISub-'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
+                    #'canUIDrag:' false
+                )
+                 #(#LabelSpec
+                    #'name:' 'SubSpec label 2'
+                    #'layout:' #(#LayoutFrame 383 0 146 0 455 0 164 0)
+                    #'label:' 'Specification'
+                    #'style:' 
+                     #(#FontDescription
+                        #helvetica #medium
+                        #roman #'10'
+                    )
                     #'canUIDrag:' false
                 )
               )
@@ -1005,8 +1076,10 @@
     "handle an expose event from device; redraw selection
     "
     super exposeX:x y:y width:w height:h.
-    self showSelected.
 
+    (selection notNil and:[self sensor hasExposeEventFor:selection]) ifFalse:[
+        self showSelected.
+    ].
 
 ! !
 
@@ -1079,14 +1152,14 @@
      is a rectangle
     "
     aComponent notNil ifTrue:[
-        aOneArgBlock value:(aComponent origin       - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent corner       - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent topRight     - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent bottomLeft   - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent leftCenter   - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent rightCenter  - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent topCenter    - (4@4) extent:7@7).
-        aOneArgBlock value:(aComponent bottomCenter - (4@4) extent:7@7).
+        aOneArgBlock value:(aComponent origin       - (2@2) extent:6@6).
+        aOneArgBlock value:(aComponent corner       - (1@1) extent:6@6).
+        aOneArgBlock value:(aComponent topRight     - (1@2) extent:6@6).
+        aOneArgBlock value:(aComponent bottomLeft   - (2@1) extent:6@6).
+        aOneArgBlock value:(aComponent leftCenter   - (2@0) extent:6@6).
+        aOneArgBlock value:(aComponent rightCenter  - (1@0) extent:6@6).
+        aOneArgBlock value:(aComponent topCenter    - (0@2) extent:6@6).
+        aOneArgBlock value:(aComponent bottomCenter - (0@1) extent:6@6).
     ]
 
 !
@@ -1128,39 +1201,36 @@
 showUnselected
     "show unselected
     "
-    |r|
+    |r currSel|
 
-    selection isNil ifTrue:[
+    (currSel := selection) isNil ifTrue:[
         ^ self
     ].
-
+    selection := nil.
     self clippedByChildren:false.
 
-    self handlesOf:selection do:[:aRectangle|
+    self handlesOf:currSel do:[:aRectangle|
         self clearRectangle:aRectangle
     ].
     self clippedByChildren:true.
+    r := currSel bounds.
 
-"must redraw all components which are affected b the handles
-"
-    r := (selection originRelativeTo:self) - (4@4) extent:(selection extent + (4@4)).
-
-    self subViews do:[:aComponent |
+    subViews do:[:sv|
         |absOrg absFrame|
 
-        aComponent ~~ inputView ifTrue:[
-            absOrg   := aComponent originRelativeTo:self.
-            absFrame := absOrg extent:(aComponent extent).
+        sv ~~ inputView ifTrue:[
+            (sv bounds intersects:r) ifTrue:[
+                sv borderColor:(Color gray:5).
+                sv borderColor:(Color black).
 
-            (absFrame intersects:r) ifTrue:[
-                aComponent withAllSubViewsDo:[:aView|
-                    aView clear.
-                    aView exposeX:0 y:0 width:9999 height:9999.
+                sv withAllSubViewsDo:[:v|
+                    v fill:v viewBackground.
+                    v exposeX:0 y:0 width:9999 height:9999.
                 ]
             ]
         ]
-    ]
-
+    ].
+    selection := currSel.
 
 ! !
 
@@ -1195,6 +1265,9 @@
         DisplayObject paint:(Color colorId:1).
         DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y.
     ].
+    aSpec class == UISubSpecification ifTrue:[
+        aSpec layout:(LayoutOrigin fromPoint:0@0)
+    ].
   ^ self new theObject:aSpec