DataSetBuilder.st
changeset 1300 7514e12ff1b8
parent 1262 2849b1a15ec8
child 1311 84a556c31ac6
--- a/DataSetBuilder.st	Sat Jan 22 14:16:46 2000 +0100
+++ b/DataSetBuilder.st	Sat Jan 22 15:00:14 2000 +0100
@@ -16,7 +16,7 @@
 
 ResourceSpecEditor subclass:#DataSetBuilder
 	instanceVariableNames:'rowClass rowSuperClass columnView columns selectedColumnIndex
-		modalOpened noteBook listOfSpecViews'
+		modalOpened listOfSpecViews'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-UIPainter'
@@ -328,7 +328,7 @@
           #name: 'DataSet Basic'
           #min: #(#Point 10 10)
           #max: #(#Point 1280 1024)
-          #bounds: #(#Rectangle 640 340 1029 666)
+          #bounds: #(#Rectangle 10 149 399 475)
         )
         #component: 
        #(#SpecCollection
@@ -342,12 +342,38 @@
              #(#SpecCollection
                 #collection: #(
                  #(#LabelSpec
+                    #label: 'ID:'
+                    #name: 'idLabel'
+                    #layout: #(#AlignmentOrigin 94 0 14 0 1 0.5)
+                    #resizeForLabel: true
+                  )
+                 #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
+                    #name: 'idField'
+                    #layout: #(#LayoutFrame 97 0 0 0 2 1.0 22 0)
+                    #activeHelpKey: #basicsLabelId
+                    #tabable: true
+                    #model: #id
+                    #group: #inputGroup
+                    #acceptOnLostFocus: false
+                    #acceptChannel: #acceptChannel
+                    #modifiedChannel: #modifiedChannel
+                    #acceptOnPointerLeave: false
+                  )
+                 #(#LabelSpec
                     #label: 'Label:'
                     #name: 'label1'
                     #layout: #(#AlignmentOrigin 94 0 39 0 1 0.5)
                     #resizeForLabel: true
                   )
                  #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'labelField'
                     #layout: #(#LayoutFrame 97 0 28 0 2 1.0 50 0)
                     #activeHelpKey: #basicsLabel
@@ -375,15 +401,25 @@
                     #activeHelpKey: #labelFont
                     #model: #style
                   )
-                 #(#PopUpListSpec
-                    #label: 'Alignment'
-                    #name: 'Alignment'
-                    #layout: #(#LayoutFrame 248 0 97 0 2 1.0 119 0)
-                    #activeHelpKey: #basicsJustification
-                    #model: #labelAlignment
-                    #menu: 
-                   #(#left
-                      #right #center
+                 #(#LabelSpec
+                    #label: 'Type:'
+                    #name: 'Type'
+                    #layout: #(#AlignmentOrigin 52 0 105 0 1 0.5)
+                    #translateLabel: true
+                    #resizeForLabel: true
+                  )
+                 #(#ComboListSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
+                    #name: 'labelButtonType'
+                    #layout: #(#LayoutFrame 57 0 96 0 182 0 116 0)
+                    #tabable: true
+                    #model: #labelButtonType
+                    #comboList: 
+                   #(#None
+                      #Button #Group
                     )
                     #useIndex: false
                   )
@@ -394,7 +430,28 @@
                     #resizeForLabel: true
                     #adjust: #left
                   )
+                 #(#PopUpListSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
+                    #label: 'Alignment'
+                    #name: 'Alignment'
+                    #layout: #(#LayoutFrame 248 0 97 0 2 1.0 119 0)
+                    #activeHelpKey: #basicsJustification
+                    #tabable: true
+                    #model: #labelAlignment
+                    #menu: 
+                   #(#left
+                      #right #center
+                    )
+                    #useIndex: false
+                  )
                  #(#CheckBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Label Is Image'
                     #name: 'labelIsImage'
                     #layout: #(#LayoutOrigin -3 0 122 0)
@@ -403,6 +460,10 @@
                     #model: #labelIsImage
                   )
                  #(#CheckBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Translate Label'
                     #name: 'CheckBox2'
                     #layout: #(#LayoutOrigin 160 0 122 0)
@@ -410,40 +471,6 @@
                     #tabable: true
                     #model: #translateLabel
                   )
-                 #(#LabelSpec
-                    #label: 'ID:'
-                    #name: 'idLabel'
-                    #layout: #(#AlignmentOrigin 94 0 14 0 1 0.5)
-                    #resizeForLabel: true
-                  )
-                 #(#InputFieldSpec
-                    #name: 'idField'
-                    #layout: #(#LayoutFrame 97 0 0 0 2 1.0 22 0)
-                    #activeHelpKey: #basicsLabelId
-                    #tabable: true
-                    #model: #id
-                    #group: #inputGroup
-                    #acceptOnLostFocus: false
-                    #acceptChannel: #acceptChannel
-                    #modifiedChannel: #modifiedChannel
-                    #acceptOnPointerLeave: false
-                  )
-                 #(#LabelSpec
-                    #label: 'Type:'
-                    #name: 'Type'
-                    #layout: #(#AlignmentOrigin 52 0 105 0 1 0.5)
-                    #translateLabel: true
-                    #resizeForLabel: true
-                  )
-                 #(#ComboListSpec
-                    #name: 'labelButtonType'
-                    #layout: #(#LayoutFrame 57 0 96 0 182 0 116 0)
-                    #model: #labelButtonType
-                    #comboList: 
-                   #( #None #Button #Group
-                    )
-                    #useIndex: false
-                  )
                  )
                
               )
@@ -463,6 +490,10 @@
                     #resizeForLabel: true
                   )
                  #(#ComboListSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'rendererField'
                     #layout: #(#LayoutFrame 97 0 5 0 2 1.0 27 0)
                     #activeHelpKey: #basicsRenderer
@@ -478,6 +509,10 @@
                     #resizeForLabel: true
                   )
                  #(#ComboBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'editorField'
                     #layout: #(#LayoutFrame 97 0 31 0 2 1.0 53 0)
                     #activeHelpKey: #basicsEditor
@@ -499,10 +534,15 @@
                     #adjust: #left
                   )
                  #(#PopUpListSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Alignment'
                     #name: 'AlignmentC'
                     #layout: #(#LayoutFrame 248 0 58 0 2 1.0 80 0)
                     #activeHelpKey: #basicsJustificationEditor
+                    #tabable: true
                     #model: #columnAlignment
                     #menu: 
                    #(#left
@@ -888,7 +928,7 @@
           #name: 'DataSet Dimension'
           #min: #(#Point 10 10)
           #max: #(#Point 1280 1024)
-          #bounds: #(#Rectangle 96 97 421 445)
+          #bounds: #(#Rectangle 132 132 457 480)
         )
         #component: 
        #(#SpecCollection
@@ -902,6 +942,10 @@
              #(#SpecCollection
                 #collection: #(
                  #(#CheckBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Show Row-Separator'
                     #name: 'showRowSeparator'
                     #layout: #(#LayoutFrame 5 0 15 0 293 0 38 0)
@@ -910,6 +954,10 @@
                     #model: #showRowSeparator
                   )
                  #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'rowSeparatorSelector'
                     #layout: #(#LayoutFrame 29 0 41 0 2 1.0 63 0)
                     #activeHelpKey: #frameShowRowSeparatorSelector
@@ -923,6 +971,10 @@
                     #acceptOnPointerLeave: false
                   )
                  #(#CheckBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Show Column-Separator'
                     #name: 'showColSeparator'
                     #layout: #(#LayoutFrame 5 0 70 0 294 0 93 0)
@@ -950,6 +1002,10 @@
                     #adjust: #right
                   )
                  #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'widthField'
                     #layout: #(#LayoutFrame 142 0 12 0 2 1.0 34 0)
                     #activeHelpKey: #frameColumnWidth
@@ -970,6 +1026,10 @@
                     #adjust: #right
                   )
                  #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'minWidthField'
                     #layout: #(#LayoutFrame 142 0 40 0 2 1.0 62 0)
                     #activeHelpKey: #frameMinWidth
@@ -990,6 +1050,10 @@
                     #adjust: #right
                   )
                  #(#InputFieldSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #name: 'heightField'
                     #layout: #(#LayoutFrame 142 0 68 0 2 1.0 90 0)
                     #activeHelpKey: #frameRowHeight
@@ -1003,9 +1067,14 @@
                     #acceptOnPointerLeave: false
                   )
                  #(#CheckBoxSpec
+                    #attributes: 
+                   #(#tabable
+                      true
+                    )
                     #label: 'Use Preferred Width'
                     #name: 'usePreferredWidth'
                     #layout: #(#LayoutFrame 5 0 96 0 141 0 118 0)
+                    #tabable: true
                     #model: #usePreferredWidth
                   )
                  )
@@ -1431,15 +1500,10 @@
        #(#WindowSpec
           #label: 'Data Set Builder'
           #name: 'Data Set Builder'
-          #layout: #(#LayoutFrame 93 0 74 0 725 0 640 0)
-          #level: 0
           #min: #(#Point 10 10)
           #max: #(#Point 1152 900)
-          #bounds: #(#Rectangle 93 74 726 641)
+          #bounds: #(#Rectangle 531 329 1164 896)
           #menu: #menu
-          #usePreferredExtent: false
-          #returnIsOKInDialog: true
-          #escapeIsCancelInDialog: true
         )
         #component: 
        #(#SpecCollection
@@ -1452,7 +1516,6 @@
            #(#VariableVerticalPanelSpec
               #name: 'VariableVerticalPanel1'
               #layout: #(#LayoutFrame 0 0.0 38 0.0 0 1.0 -26 1.0)
-              #handles: #(#Any 0.25 1.0)
               #component: 
              #(#SpecCollection
                 #collection: #(
@@ -1480,7 +1543,6 @@
                  #(#VariableHorizontalPanelSpec
                     #name: 'VariablePanel'
                     #level: -1
-                    #handles: #(#Any 0.235387 1.0)
                     #component: 
                    #(#SpecCollection
                       #collection: #(
@@ -1516,7 +1578,8 @@
                                 #model: #tabModel
                                 #menu: #tabList
                                 #useIndex: true
-                                #canvas: #noteBook
+                                #canvas: #canvasHolder
+                                #keepCanvasAlive: true
                               )
                              #(#UISubSpecification
                                 #name: 'SubSpecification'
@@ -1531,10 +1594,12 @@
                        )
                      
                     )
+                    #handles: #(#Any 0.235387 1.0)
                   )
                  )
                
               )
+              #handles: #(#Any 0.25 1.0)
             )
            #(#UISubSpecification
               #name: 'infoBarSubSpec'
@@ -1984,6 +2049,17 @@
 
 !DataSetBuilder methodsFor:'aspects'!
 
+canvasHolder
+    "returns a value holder which keeps selected column"
+
+    |holder|
+
+    (holder := builder bindingAt:#canvasHolder) isNil ifTrue:[
+        builder aspectAt:#canvasHolder put:(holder := ValueHolder new).
+    ].
+    ^ holder
+!
+
 columnIsNotEditing
     "returns a boolean value holder which is set to true if column is not editing"
 
@@ -2495,6 +2571,7 @@
     selectedColumnIndex := 0.
     columns     := OrderedCollection new.
     modalOpened := false.
+    listOfSpecViews := Array new:(self class slices size).
 
 ! !
 
@@ -2609,28 +2686,35 @@
 tabSelection:something
     "changes selected tab and set corresponding specification"
 
-    |specSelector view spec|
-
-    (noteBook isNil or:[something == tabSelection]) ifTrue:[^self].
+    |view spec|
+
+    something == tabSelection ifTrue:[^self].
+
+    (tabSelection := something) isNil ifTrue:[
+        tabSelection == 0 ifTrue:[^ self].
+        tabSelection := 0.
+    ].
 
     self selectedColumn isNil ifTrue:[
-        tabSelection == 0 ifTrue:[^self].
-        tabSelection := 0
-    ] ifFalse:[
-        tabSelection := something.
+        tabSelection ~~ 0 ifTrue:[
+            self tabModel value:0
+        ] ifFalse:[
+            self canvasHolder value:nil
+        ].
+        ^ self
     ].
-    view := listOfSpecViews at:(tabSelection + 1).
-
-    view isNil ifTrue:[
-        view := View origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
-        view client:self spec:(self class slices at:tabSelection) last.
-
-        noteBook realized ifTrue:[
-            noteBook realizeAllSubViews
-        ].
-        listOfSpecViews at:(tabSelection + 1) put:view.
+
+    tabSelection == 0 ifTrue:[
+        ^ self tabModel value:1.
     ].
-    view raise.
+
+    (view := listOfSpecViews at:tabSelection) isNil ifTrue:[
+        view := SimpleView new.
+        spec := (self class slices at:tabSelection) last.
+        view client:self spec:spec builder:(self builder).
+        listOfSpecViews at:tabSelection put:view.
+    ].
+    self canvasHolder value:view
 ! !
 
 !DataSetBuilder methodsFor:'startup / release'!
@@ -3037,19 +3121,6 @@
 
 ! !
 
-!DataSetBuilder methodsFor:'values'!
-
-noteBook
-    "returns the noteBook widget
-    "
-    noteBook isNil ifTrue:[
-        noteBook := View new.
-        listOfSpecViews := Array new:(1 + self class slices size).
-        listOfSpecViews at:1 put:(View origin:0.0@0.0 corner:1.0@1.0 in:noteBook).
-    ].
-    ^ noteBook
-! !
-
 !DataSetBuilder::Row methodsFor:'accessing'!
 
 choices