reuse functionality of changed ViewScroller
authorca
Fri, 12 Jul 2002 09:09:43 +0200
changeset 1573 bf9c5ca8e48a
parent 1572 03046a9c70b1
child 1574 e4897b61395c
reuse functionality of changed ViewScroller
UISpecificationTool.st
--- a/UISpecificationTool.st	Thu Jul 11 23:12:30 2002 +0200
+++ b/UISpecificationTool.st	Fri Jul 12 09:09:43 2002 +0200
@@ -24,7 +24,7 @@
 !
 
 ViewScroller subclass:#BuildInView
-	instanceVariableNames:'outerFrame'
+	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:UISpecificationTool
@@ -794,7 +794,7 @@
     specChannel release.
     aspects     release.
     selection := listOfSpecViews := nil.
-    buildInView destroyAllSubSpecs.
+    buildInView destroyAllClientViews.
 
     (specification := aSpec) isNil ifTrue:[
         aspects := specChannel := nil.
@@ -815,7 +815,6 @@
 
     "/ arrange for being notified, if any aspect changes
     aspects do:[:el| el addDependent:self ].
-
 ! !
 
 !UISpecificationTool methodsFor:'actions'!
@@ -910,6 +909,7 @@
 initialize
     super initialize.
     buildInView := BuildInView new.
+    buildInView keepViews:true.
 ! !
 
 !UISpecificationTool methodsFor:'selection'!
@@ -946,38 +946,24 @@
 
 !UISpecificationTool::BuildInView methodsFor:'accessing'!
 
-destroyAllSubSpecs
-    "destroy all subViews which represents a specification
-    "
-    outerFrame destroySubViews.
-
-    scrolledView notNil ifTrue:[
-        scrolledView := nil.
-        self sizeChanged:nil.
-    ]
-
-
-!
-
 scrolledView:aView
     "set the view to be scrolled"
-    |scr theOneComponent y|
+    |wrapper y|
 
     scrolledView == aView ifTrue:[^ self].
 
-    scrolledView notNil ifTrue:[scrolledView unmap].
+    scrolledView notNil ifTrue:[scrolledView beInvisible].
 
-    (scrolledView := aView) isNil ifTrue:[
-        ^ self
-    ].
+    scrolledView := aView.
 
-    scrolledView superView == outerFrame ifFalse:[
+    (scrolledView notNil and:[scrolledView superView ~~ frame]) ifTrue:[
         scrolledView borderWidth:0; level:0.
 
-        outerFrame addSubView:scrolledView.
+        frame addSubView:scrolledView.
+
         scrolledView subViews size == 1 ifTrue:[
-            theOneComponent := scrolledView subViews first.
-            theOneComponent isScrollWrapper ifTrue:[
+            wrapper := scrolledView subViews first.
+            wrapper isScrollWrapper ifTrue:[
                 "/ give it a full-relative size, and let it do
                 "/ the scrolling itself.
                 y := 1.0
@@ -987,31 +973,18 @@
             y := scrolledView preferredExtent y
         ].
         scrolledView origin:0@0 corner:1.0 @ y.
-        scrolledView := scrolledView.
         scrolledView allViewBackground:(self viewBackground).
     ].
 
     realized ifTrue:[
-        scrolledView realize.
+        scrolledView ifNotNil:[scrolledView beVisible].
         self sizeChanged:nil.
     ].
-
-
-
-
-
+    model value:scrolledView.
 ! !
 
 !UISpecificationTool::BuildInView methodsFor:'initialization'!
 
-initialize
-    super initialize.
-    outerFrame := SimpleView origin:0.0@0.0 corner:1.0@1.0 in:self.
-    outerFrame borderWidth:0; level:0.
-
-
-!
-
 level:aLevel
     super level:0
 !