#preferredExtent cleaned
authortz
Wed, 21 Jan 1998 12:35:49 +0100
changeset 760 26cf45040420
parent 759 405baa7e92d4
child 761 cc0404f8aec6
#preferredExtent cleaned
ToolApplicationModel.st
--- a/ToolApplicationModel.st	Mon Jan 19 09:25:15 1998 +0100
+++ b/ToolApplicationModel.st	Wed Jan 21 12:35:49 1998 +0100
@@ -270,6 +270,53 @@
               )
           )
       )
+!
+
+windowSpecForCommitWithoutChannels
+    "this window spec was automatically generated by the ST/X UIPainter"
+
+    "do not manually edit this - the painter/builder may not be able to
+     handle the specification if its corrupted."
+
+    "
+     UIPainter new openOnClass:ToolApplicationModel andSelector:#windowSpecForCommitWithoutChannels
+     ToolApplicationModel new openInterface:#windowSpecForCommitWithoutChannels
+    "
+
+    <resource: #canvas>
+
+    ^
+     
+       #(#FullSpec
+          #'window:' 
+           #(#WindowSpec
+              #'name:' 'unnamed canvas'
+              #'layout:' #(#LayoutFrame 323 0 410 0 622 0 469 0)
+              #'label:' 'unnamed canvas'
+              #'min:' #(#Point 100 22)
+              #'max:' #(#Point 1152 900)
+              #'bounds:' #(#Rectangle 323 410 623 470)
+              #'usePreferredExtent:' false
+          )
+          #'component:' 
+           #(#SpecCollection
+              #'collection:' 
+               #(
+                 #(#ActionButtonSpec
+                    #'name:' 'cancelButton'
+                    #'layout:' #(#LayoutFrame 5 0 0 0 -2 0.5 0 1)
+                    #'label:' 'Cancel'
+                    #'model:' #cancel
+                )
+                 #(#ActionButtonSpec
+                    #'name:' 'okButton'
+                    #'layout:' #(#LayoutFrame 2 0.5 0 0.0 -5 1 0 1.0)
+                    #'label:' 'OK'
+                    #'model:' #accept
+                )
+              )
+          )
+      )
 ! !
 
 !ToolApplicationModel class methodsFor:'resources'!
@@ -451,12 +498,20 @@
 !
 
 preferredExtent
+    "preferred extent of my window; top menu and top toolbar (named by 'menuToolbar')
+     will be considered"
 
-    ^(self builder window width max: (self builder window subViews first preferredExtent x max:
-     (self menuToolbarView ? self builder window) preferredExtent x))
-     @ 
-     (self builder window height max: ((self menuToolbarView ? self builder window) font height) * 20)
+    |window menuPanel menuToolbarView preferredExtentOfWindow|
+
+    window          := self builder window. 
+    menuPanel       := window subViews first.
+    menuToolbarView := self menuToolbarView.
 
+    preferredExtentOfWindow := window extent.
+    menuPanel class = MenuPanel ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuPanel preferredExtent].
+    menuToolbarView notNil      ifTrue: [preferredExtentOfWindow := preferredExtentOfWindow max: menuToolbarView preferredExtent].
+
+    ^window minExtent max: (preferredExtentOfWindow min: window maxExtent)
 ! !
 
 !ToolApplicationModel methodsFor:'action - settings'!
@@ -565,11 +620,6 @@
 
 
 
-!
-
-menuHelp
-
-  ^self class menuHelp
 ! !
 
 !ToolApplicationModel methodsFor:'aspects'!
@@ -799,6 +849,14 @@
     self class open
 !
 
+removeAllTemporalViews
+
+    self builder namedComponents keys copy do: 
+    [:comp| 
+        (comp includesString: '_Temporal') ifTrue: [self builder namedComponents removeKey: comp]
+    ]
+!
+
 restarted
 
     self initialize
@@ -829,5 +887,5 @@
 !ToolApplicationModel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.7 1998-01-17 17:06:23 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ToolApplicationModel.st,v 1.8 1998-01-21 11:35:49 tz Exp $'
 ! !