focus handling
authorca
Wed, 07 Mar 2007 18:19:17 +0100
changeset 2160 8f6a8896f10d
parent 2159 7f02407f0bbf
child 2161 1dd6800c1bb3
focus handling
UISpecificationTool.st
--- a/UISpecificationTool.st	Wed Mar 07 18:18:44 2007 +0100
+++ b/UISpecificationTool.st	Wed Mar 07 18:19:17 2007 +0100
@@ -9,10 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
-
-
-
 "{ Package: 'stx:libtool2' }"
 
 ApplicationModel subclass:#UISpecificationTool
@@ -349,38 +345,48 @@
 
 !UISpecificationTool::BuildInView methodsFor:'accessing'!
 
+mapped
+    super mapped.
+
+    scrolledView notNil ifTrue:[
+        scrolledView beVisible.
+        scrolledView raise.
+    ].
+!
+
 scrolledView:aView
     "set the view to be scrolled"
     |wrapper y|
 
     scrolledView == aView ifTrue:[^ self].
 
-    scrolledView notNil ifTrue:[scrolledView beInvisible].
-
-    scrolledView := aView.
+    scrolledView notNil ifTrue:[
+        scrolledView unmap.
+    ].
+    (scrolledView := aView) notNil ifTrue:[
+        scrolledView superView ~~ frame ifTrue:[
+            scrolledView borderWidth:0; level:0.
 
-    (scrolledView notNil and:[scrolledView superView ~~ frame]) ifTrue:[
-        scrolledView borderWidth:0; level:0.
-
-        frame addSubView:scrolledView.
+            frame addSubView:scrolledView.
 
-        scrolledView subViews size == 1 ifTrue:[
-            wrapper := scrolledView subViews first.
-            wrapper isScrollWrapper ifTrue:[
-                "/ give it a full-relative size, and let it do
-                "/ the scrolling itself.
-                y := 1.0
-            ]
+            scrolledView subViews size == 1 ifTrue:[
+                wrapper := scrolledView subViews first.
+                wrapper isScrollWrapper ifTrue:[
+                    "/ give it a full-relative size, and let it do
+                    "/ the scrolling itself.
+                    y := 1.0
+                ]
+            ].
+            y isNil ifTrue:[
+                y := scrolledView preferredExtent y
+            ].
+            scrolledView origin:0@0 corner:1.0 @ y.
+            scrolledView allViewBackground:(self viewBackground).
         ].
-        y isNil ifTrue:[
-            y := scrolledView preferredExtent y
-        ].
-        scrolledView origin:0@0 corner:1.0 @ y.
-        scrolledView allViewBackground:(self viewBackground).
-    ].
-
-    realized ifTrue:[
-        scrolledView ifNotNil:[scrolledView beVisible].
+    ].    
+    shown ifTrue:[
+        scrolledView beVisible.
+        scrolledView raise.
         self sizeChanged:nil.
     ].
     model value:scrolledView.