allow for application to decide what type of
authorClaus Gittinger <cg@exept.de>
Wed, 23 Feb 2000 22:31:30 +0100
changeset 1359 f40bfb94f862
parent 1358 3870ff2d5ce3
child 1360 2b17ce81a790
allow for application to decide what type of applicationWindow is used (for Werner)
ApplicationModel.st
UIBuilder.st
WindowBuilder.st
--- a/ApplicationModel.st	Wed Feb 23 11:26:42 2000 +0100
+++ b/ApplicationModel.st	Wed Feb 23 22:31:30 2000 +0100
@@ -2065,6 +2065,10 @@
 
 !ApplicationModel methodsFor:'startup / release'!
 
+applicationWindowClass
+    ^ ApplicationWindow
+!
+
 close
     "this is sent by my topView when about to be closed
      by the program (not by the windowManager).
@@ -2254,6 +2258,14 @@
      Can be redefined in subclasses"
 
     self saveAndTerminateRequest
+!
+
+windowClass
+    "return the type of topWindow I would like to have created.
+     Can be redefined in subclasses to allow for specialized
+     subclass of ApplicationWindow to be returned here."
+
+    ^ ApplicationWindow
 ! !
 
 !ApplicationModel methodsFor:'window events'!
@@ -2373,6 +2385,6 @@
 !ApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.129 2000-02-23 10:26:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.130 2000-02-23 21:30:04 cg Exp $'
 ! !
 ApplicationModel initialize!
--- a/UIBuilder.st	Wed Feb 23 11:26:42 2000 +0100
+++ b/UIBuilder.st	Wed Feb 23 22:31:30 2000 +0100
@@ -255,7 +255,7 @@
 !UIBuilder methodsFor:'building - programatically'!
 
 add:aSpec
-    |collectedComponents|
+    |collectedComponents appWinClass|
 
     composite notNil ifTrue:[
         (collectedComponents := composite collection) isNil ifTrue:[
@@ -276,7 +276,12 @@
                 spec component:aSpec.
 
                 window isNil ifTrue:[
-                    window := ApplicationWindow new.
+                    application notNil ifTrue:[
+                        appWinClass := application applicationWindowClass
+                    ] ifFalse:[
+                        appWinClass := ApplicationWindow
+                    ].
+                    window := appWinClass new.
                     window extent:300@300.
                 ].
                 aSpec buildViewWithLayoutFor:self in:window.
@@ -393,6 +398,6 @@
 !UIBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.47 2000-01-31 13:53:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.48 2000-02-23 21:31:30 cg Exp $'
 ! !
 UIBuilder initialize!
--- a/WindowBuilder.st	Wed Feb 23 11:26:42 2000 +0100
+++ b/WindowBuilder.st	Wed Feb 23 22:31:30 2000 +0100
@@ -1206,6 +1206,8 @@
         as popUp (also blocking)
         or as a normal view."
 
+    |appWinClass|
+
     origin notNil ifTrue:[
         "/ kludge
         origin ~~ #center ifTrue:[
@@ -1231,7 +1233,12 @@
 
     type == #normal ifTrue:[
         window isNil ifTrue:[
-            self setupWindowFor:(ApplicationWindow new).
+            application notNil ifTrue:[
+                appWinClass := application applicationWindowClass
+            ] ifFalse:[
+                appWinClass := ApplicationWindow
+            ].
+            self setupWindowFor:(appWinClass new).
         ].
         origin == #center ifTrue:[
             window origin:(window device center - window extent // 2)
@@ -1258,5 +1265,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.88 2000-02-21 23:34:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.89 2000-02-23 21:30:45 cg Exp $'
 ! !