update menu
authorca
Tue, 24 Jun 1997 16:14:38 +0200
changeset 176 a9e5b1615761
parent 175 0b0b4d99e3e7
child 177 eefd69a52f5b
update menu
UIPainter.st
--- a/UIPainter.st	Tue Jun 24 16:14:11 1997 +0200
+++ b/UIPainter.st	Tue Jun 24 16:14:38 1997 +0200
@@ -339,81 +339,94 @@
        #(#FullSpec
           #'window:' 
            #(#WindowSpec
-              #'name:' 'uIPainterView'
+              #'name:' 'Painter'
               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
-              #'label:' 'unnamed canvas'
-              #'bounds:' #(#Rectangle 0 0 392 223)
+              #'label:' 'Painter'
+              #'bounds:' #(#Rectangle 0 0 334 158)
           )
           #'component:' 
            #(#SpecCollection
               #'collection:' 
                #(
                  #(#LabelSpec
-                    #'name:' 'label1'
-                    #'layout:' #(#LayoutFrame 10 0 50 0 110 0 70 0)
+                    #'name:' 'classLabel'
+                    #'layout:' #(#AlignmentOrigin 43 0 58 0 0 1)
                     #'label:' 'class:'
                     #'adjust:' #right
+                    #'resizeForLabel:' true
                 )
                  #(#LabelSpec
-                    #'name:' 'label2'
-                    #'layout:' #(#LayoutFrame 10 0 90 0 110 0 110 0)
+                    #'name:' 'superClassLabel'
+                    #'layout:' #(#AlignmentOrigin 12 0 84 0 0 1)
                     #'label:' 'superclass:'
                     #'adjust:' #right
+                    #'resizeForLabel:' true
                 )
                  #(#LabelSpec
-                    #'name:' 'label3'
-                    #'layout:' #(#LayoutFrame 10 0 130 0 110 0 150 0)
+                    #'name:' 'selectorLabel'
+                    #'layout:' #(#AlignmentOrigin 27 0 112 0 0 1)
                     #'label:' 'selector:'
                     #'adjust:' #right
-                )
-                 #(#InputFieldSpec
-                    #'name:' 'classNameField'
-                    #'layout:' #(#LayoutFrame 120 0 50 0 -2 1.0 72 0)
-                    #'tabable:' true
-                    #'model:' #classNameChannel
+                    #'resizeForLabel:' true
                 )
                  #(#InputFieldSpec
                     #'name:' 'methodNameField'
-                    #'layout:' #(#LayoutFrame 120 0 130 0 -2 1.0 152 0)
+                    #'layout:' #(#LayoutFrame 90 0 95 0 -5 1.0 117 0)
                     #'tabable:' true
                     #'model:' #methodNameChannel
                 )
-                 #(#ActionButtonSpec
-                    #'name:' 'button1'
-                    #'layout:' #(#AlignmentOrigin -2 0.5 195 0 1 0.5)
-                    #'label:' 'cancel'
-                    #'tabable:' true
-                    #'model:' #cancel
-                )
-                 #(#ActionButtonSpec
-                    #'name:' 'button2'
-                    #'layout:' #(#AlignmentOrigin 2 0.5 195 0 0 0.5)
-                    #'label:' 'ok'
-                    #'tabable:' true
-                    #'isDefault:' true
-                    #'model:' #accept
-                )
                  #(#LabelSpec
                     #'name:' 'boxLabel'
-                    #'layout:' #(#LayoutFrame 0 0.0 11 0 0 1.0 32 0)
+                    #'layout:' #(#Point 5 10)
                     #'label:' 'class & selector for code:'
                     #'adjust:' #left
+                    #'resizeForLabel:' true
+                )
+                 #(#InputFieldSpec
+                    #'name:' 'classNameField'
+                    #'layout:' #(#LayoutFrame 90 0 39 0 -5 1.0 61 0)
+                    #'tabable:' true
+                    #'model:' #classNameChannel
                 )
                  #(#ComboBoxSpec
                     #'name:' 'comboBox1'
-                    #'layout:' #(#LayoutFrame 120 0 90 0 -2 1.0 112 0)
+                    #'layout:' #(#LayoutFrame 90 0 67 0 -5 1.0 89 0)
                     #'tabable:' true
                     #'model:' #superclassNameChannel
-                    #'immediateAccept:' false
-                    #'acceptOnLeave:' true
-                    #'acceptOnLostFocus:' true
                     #'comboList:' #superclassNameDefaults
                 )
+                 #(#HorizontalPanelViewSpec
+                    #'name:' 'commitPanel'
+                    #'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0)
+                    #'component:' 
+                     #(#SpecCollection
+                        #'collection:' 
+                         #(
+                           #(#ActionButtonSpec
+                              #'name:' 'button1'
+                              #'label:' 'cancel'
+                              #'tabable:' true
+                              #'model:' #cancel
+                              #'extent:' #(#Point 162 24)
+                          )
+                           #(#ActionButtonSpec
+                              #'name:' 'button2'
+                              #'label:' 'ok'
+                              #'tabable:' true
+                              #'isDefault:' true
+                              #'model:' #accept
+                              #'extent:' #(#Point 163 24)
+                          )
+                        )
+                    )
+                    #'horizontalLayout:' #fitSpace
+                    #'verticalLayout:' #fit
+                    #'horizontalSpace:' 3
+                    #'verticalSpace:' 3
+                )
               )
           )
       )
-
-    "Modified: 17.6.1997 / 13:02:12 / cg"
 !
 
 windowSpec
@@ -1222,14 +1235,19 @@
 defineClassAndSelector
     "launch a dialog to define class, superclass and method"
 
-    |again|
+    |again tmp|
 
     [
         again := false.
 
-        aspects at:#classNameChannel put:specClass asValue.
-        aspects at:#methodNameChannel put:specSelector asValue.
-        aspects at:#superclassNameChannel put:specSuperclass asValue.
+        (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
+        aspects at:#classNameChannel put:tmp asValue.
+
+        (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
+        aspects at:#methodNameChannel put:tmp asValue.
+
+        (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
+        aspects at:#superclassNameChannel put:tmp asValue.
 
         (self openDialogInterface:#nameAndSelectorSpec) ifTrue:[
 
@@ -1400,7 +1418,7 @@
 !
 
 doInstallSpec
-    |code|
+    |code painter|
 
     (specClass isNil or:[specSelector isNil]) ifTrue:[
         self defineClassAndSelector
@@ -1409,12 +1427,14 @@
     self checkClassAndSelector ifFalse:[
         ^ self
     ].
+    painter := self painter.
 
-    self painter className:specClass
-            superclassName:specSuperclass
-                  selector:specSelector.
+    painter className:specClass
+       superclassName:specSuperclass
+             selector:specSelector.
 
-    code := self painter generateCode.
+    code := painter generateWindowSpecMethodSource withCRs.
+    painter resetModification.
     (ReadStream on:code) fileIn.
 
 !