class: UISelectionPanel
authorClaus Gittinger <cg@exept.de>
Wed, 18 Jun 2014 18:26:22 +0200
changeset 3128 bb09c25b54dc
parent 3127 f28722d20fbb
child 3129 9a90a9d52bc6
class: UISelectionPanel changed: #paste: #standardButtons #standardGroups
UISelectionPanel.st
--- a/UISelectionPanel.st	Sat Jun 07 17:02:41 2014 +0200
+++ b/UISelectionPanel.st	Wed Jun 18 18:26:22 2014 +0200
@@ -597,7 +597,7 @@
          label: 'Buttons'
          name: 'Buttons'
          min: (Point 10 10)
-         bounds: (Rectangle 0 0 440 196)
+         bounds: (Rectangle 0 0 477 241)
        )
        component: 
       (SpecCollection
@@ -612,14 +612,14 @@
              name: 'Button - OK'
              layout: (LayoutFrame 2 0 33 0 127 0 55 0)
              translateLabel: true
-             model: doAccept
+             model: accept
            )
           (ActionButtonSpec
              label: 'Cancel'
              name: 'Button - Cancel'
              layout: (LayoutFrame 2 0 65 0 127 0 87 0)
              translateLabel: true
-             model: doCancel
+             model: cancel
            )
           (ActionButtonSpec
              label: 'Help'
@@ -708,10 +708,47 @@
           (ActionButtonSpec
              label: '...'
              name: 'Button1'
-             layout: (LayoutFrame 2 0 160 0 22 0 182 0)
+             layout: (LayoutFrame 296 0 98 0 316 0 120 0)
              translateLabel: true
              model: someAction
            )
+          (LabelSpec
+             label: 'Ok/Cancel Panel'
+             name: 'Label2'
+             layout: (LayoutFrame 3 0 -49 1 208 0 -26 1)
+             style: (FontDescription helvetica medium roman 10)
+             adjust: left
+             canUIDrag: false
+           )
+          (HorizontalPanelViewSpec
+             keepUILayout: true
+             name: 'OkCancelPanel'
+             layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
+             horizontalLayout: center
+             verticalLayout: center
+             horizontalSpace: 3
+             verticalSpace: 3
+             component: 
+            (SpecCollection
+               collection: (
+                (ActionButtonSpec
+                   label: 'Cancel'
+                   name: 'Button2'
+                   translateLabel: true
+                   model: cancel
+                   extent: (Point 125 22)
+                 )
+                (ActionButtonSpec
+                   label: 'OK'
+                   name: 'Button3'
+                   translateLabel: true
+                   model: accept
+                   extent: (Point 125 22)
+                 )
+                )
+              
+             )
+           )
           )
         
        )
@@ -917,251 +954,251 @@
     <resource: #canvas>
 
     ^ 
-     #(FullSpec
-        name: standardGroups
-        window: 
-       (WindowSpec
-          label: 'Groups'
-          name: 'Groups'
-          min: (Point 10 10)
-          bounds: (Rectangle 0 0 443 222)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (ViewSpec
-              name: 'Box'
-              layout: (LayoutFrame 3 0 3 0 95 0 95 0)
-            )
-           (TransparentBoxSpec
-              name: 'TBox1'
-              layout: (LayoutFrame 113 0 3 0 204 0 95 0)
-            )
-           (LabelSpec
-              label: 'TransparentBox'
-              name: 'Label1'
-              layout: (AlignmentOrigin 106 0 5 0 0 0)
-              style: (FontDescription helvetica medium roman 10)
-              resizeForLabel: true
-              adjust: left
-              canUIDrag: false
-            )
-           (LabelSpec
-              label: 'Box'
-              name: 'ViewLabel'
-              layout: (AlignmentOrigin 6 0 5 0 0 0)
-              style: (FontDescription helvetica medium roman 10)
-              resizeForLabel: true
-              adjust: left
-              canUIDrag: false
-            )
-           (LabelSpec
-              label: 'Variable Panels'
-              name: 'VPanelLabel'
-              layout: (LayoutFrame 3 0 104 0 208 0 127 0)
-              style: (FontDescription helvetica medium roman 10)
-              adjust: left
-              canUIDrag: false
-            )
-           (VariableHorizontalPanelSpec
-              name: 'Variable Horizontal Panel'
-              layout: (LayoutFrame 3 0 128 0 98 0 218 0)
-              component: 
-             (SpecCollection
-                collection: (
-                 (LabelSpec
-                    label: 'A'
-                    name: 'label4'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'B'
-                    name: 'label5'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    canUIDrag: false
-                  )
+    #(FullSpec
+       name: standardGroups
+       window: 
+      (WindowSpec
+         label: 'Groups'
+         name: 'Groups'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 450 267)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (ViewSpec
+             name: 'Box'
+             layout: (LayoutFrame 3 0 3 0 95 0 95 0)
+           )
+          (TransparentBoxSpec
+             name: 'TBox1'
+             layout: (LayoutFrame 113 0 3 0 204 0 95 0)
+           )
+          (LabelSpec
+             label: 'TransparentBox'
+             name: 'Label1'
+             layout: (AlignmentOrigin 106 0 5 0 0 0)
+             style: (FontDescription helvetica medium roman 10)
+             resizeForLabel: true
+             adjust: left
+             canUIDrag: false
+           )
+          (LabelSpec
+             label: 'Box'
+             name: 'ViewLabel'
+             layout: (AlignmentOrigin 6 0 5 0 0 0)
+             style: (FontDescription helvetica medium roman 10)
+             resizeForLabel: true
+             adjust: left
+             canUIDrag: false
+           )
+          (LabelSpec
+             label: 'Variable Panels'
+             name: 'VPanelLabel'
+             layout: (LayoutFrame 3 0 104 0 208 0 127 0)
+             style: (FontDescription helvetica medium roman 10)
+             adjust: left
+             canUIDrag: false
+           )
+          (VariableHorizontalPanelSpec
+             name: 'Variable Horizontal Panel'
+             layout: (LayoutFrame 3 0 128 0 98 0 218 0)
+             component: 
+            (SpecCollection
+               collection: (
+                (LabelSpec
+                   label: 'A'
+                   name: 'label4'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   canUIDrag: false
                  )
-               
-              )
-              handles: (Any 0.5 1.0)
-            )
-           (VariableVerticalPanelSpec
-              name: 'Variable Vertical Panel'
-              layout: (LayoutFrame 113 0 128 0 208 0 218 0)
-              component: 
-             (SpecCollection
-                collection: (
-                 (LabelSpec
-                    label: 'A'
-                    name: 'label9'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'B'
-                    name: 'label10'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    canUIDrag: false
-                  )
+                (LabelSpec
+                   label: 'B'
+                   name: 'label5'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   canUIDrag: false
+                 )
+                )
+              
+             )
+             handles: (Any 0.5 1.0)
+           )
+          (VariableVerticalPanelSpec
+             name: 'Variable Vertical Panel'
+             layout: (LayoutFrame 113 0 128 0 208 0 218 0)
+             component: 
+            (SpecCollection
+               collection: (
+                (LabelSpec
+                   label: 'A'
+                   name: 'label9'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'B'
+                   name: 'label10'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   canUIDrag: false
                  )
-               
-              )
-              handles: (Any 0.5 1.0)
-            )
-           (FramedBoxSpec
-              label: 'Framed Box'
-              name: 'Framed Box'
-              layout: (LayoutFrame 228 0 3 0 433 0 98 0)
-              labelPosition: topLeft
-              translateLabel: true
-            )
-           (LabelSpec
-              label: 'Panels'
-              name: 'PanelLabel'
-              layout: (LayoutFrame 228 0 104 0 433 0 127 0)
-              style: (FontDescription helvetica medium roman 10)
-              adjust: left
-              canUIDrag: false
-            )
-           (HorizontalPanelViewSpec
-              name: 'Horizontal Panel'
-              layout: (LayoutFrame 228 0 128 0 312 0 218 0)
-              horizontalLayout: center
-              verticalLayout: center
-              horizontalSpace: 3
-              verticalSpace: 3
-              component: 
-             (SpecCollection
-                collection: (
-                 (LabelSpec
-                    label: 'A'
-                    name: 'label1'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'B'
-                    name: 'label2'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'C'
-                    name: 'label3'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
+                )
+              
+             )
+             handles: (Any 0.5 1.0)
+           )
+          (FramedBoxSpec
+             label: 'Framed Box'
+             name: 'Framed Box'
+             layout: (LayoutFrame 228 0 3 0 433 0 98 0)
+             labelPosition: topLeft
+             translateLabel: true
+           )
+          (LabelSpec
+             label: 'Panels'
+             name: 'PanelLabel'
+             layout: (LayoutFrame 228 0 104 0 433 0 127 0)
+             style: (FontDescription helvetica medium roman 10)
+             adjust: left
+             canUIDrag: false
+           )
+          (HorizontalPanelViewSpec
+             name: 'Horizontal Panel'
+             layout: (LayoutFrame 228 0 128 0 312 0 218 0)
+             horizontalLayout: center
+             verticalLayout: center
+             horizontalSpace: 3
+             verticalSpace: 3
+             component: 
+            (SpecCollection
+               collection: (
+                (LabelSpec
+                   label: 'A'
+                   name: 'label1'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'B'
+                   name: 'label2'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'C'
+                   name: 'label3'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                )
+              
+             )
+           )
+          (VerticalPanelViewSpec
+             name: 'Vertical Panel'
+             layout: (LayoutFrame 320 0 128 0 367 0 218 0)
+             horizontalLayout: center
+             verticalLayout: center
+             horizontalSpace: 3
+             verticalSpace: 3
+             component: 
+            (SpecCollection
+               collection: (
+                (LabelSpec
+                   label: 'A'
+                   name: 'label6'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
                  )
-               
-              )
-            )
-           (VerticalPanelViewSpec
-              name: 'Vertical Panel'
-              layout: (LayoutFrame 320 0 128 0 367 0 218 0)
-              horizontalLayout: center
-              verticalLayout: center
-              horizontalSpace: 3
-              verticalSpace: 3
-              component: 
-             (SpecCollection
-                collection: (
-                 (LabelSpec
-                    label: 'A'
-                    name: 'label6'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'B'
-                    name: 'label7'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'C'
-                    name: 'label8'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
+                (LabelSpec
+                   label: 'B'
+                   name: 'label7'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'C'
+                   name: 'label8'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                )
+              
+             )
+           )
+          (PanelViewSpec
+             name: 'Panel'
+             layout: (LayoutFrame 375 0 128 0 433 0 218 0)
+             horizontalLayout: fitSpace
+             verticalLayout: fitSpace
+             horizontalSpace: 3
+             verticalSpace: 3
+             component: 
+            (SpecCollection
+               collection: (
+                (LabelSpec
+                   label: 'A'
+                   name: 'label11'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
                  )
-               
-              )
-            )
-           (PanelViewSpec
-              name: 'Panel'
-              layout: (LayoutFrame 375 0 128 0 433 0 218 0)
-              horizontalLayout: fitSpace
-              verticalLayout: fitSpace
-              horizontalSpace: 3
-              verticalSpace: 3
-              component: 
-             (SpecCollection
-                collection: (
-                 (LabelSpec
-                    label: 'A'
-                    name: 'label11'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'B'
-                    name: 'label12'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'C'
-                    name: 'label13'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'D'
-                    name: 'label14'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
-                 (LabelSpec
-                    label: 'E'
-                    name: 'label15'
-                    style: (FontDescription helvetica medium roman 12)
-                    level: 2
-                    extent: (Point 23 23)
-                    canUIDrag: false
-                  )
+                (LabelSpec
+                   label: 'B'
+                   name: 'label12'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'C'
+                   name: 'label13'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
                  )
-               
-              )
-            )
+                (LabelSpec
+                   label: 'D'
+                   name: 'label14'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                (LabelSpec
+                   label: 'E'
+                   name: 'label15'
+                   style: (FontDescription helvetica medium roman 12)
+                   level: 2
+                   extent: (Point 23 23)
+                   canUIDrag: false
+                 )
+                )
+              
+             )
            )
-         
-        )
-      )
+          )
+        
+       )
+     )
 !
 
 standardLists
@@ -1901,7 +1938,9 @@
         point y > ext y ifTrue:[point y:1].
 
         spec := aSpec copy.
-        spec layout:(LayoutOrigin fromPoint:point).
+        spec keepUILayout ifFalse:[
+            spec layout:(LayoutOrigin fromPoint:point).
+        ].
         coll add:spec.
         point := point + (20@20).
     ].