DataSetBuilder.st
changeset 391 5c7fa5484d14
parent 380 42aacfc3d263
child 408 9215eb553600
--- a/DataSetBuilder.st	Mon Dec 22 21:49:38 1997 +0100
+++ b/DataSetBuilder.st	Fri Jan 02 16:57:44 1998 +0100
@@ -156,6 +156,119 @@
       )
 !
 
+cellEditSpec
+    "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:DataSetBuilder andSelector:#cellEditSpec
+     DataSetBuilder new openInterface:#cellEditSpec
+    "
+
+    <resource: #canvas>
+
+    ^
+     
+       #(#FullSpec
+          #'window:' 
+           #(#WindowSpec
+              #'name:' 'DataSet Misc'
+              #'layout:' #(#LayoutFrame 219 0 193 0 496 0 423 0)
+              #'label:' 'DataSet Misc'
+              #'min:' #(#Point 10 10)
+              #'max:' #(#Point 1280 1024)
+              #'bounds:' #(#Rectangle 219 193 497 424)
+              #'usePreferredExtent:' false
+          )
+          #'component:' 
+           #(#SpecCollection
+              #'collection:' 
+               #(
+                 #(#FramedBoxSpec
+                    #'name:' 'defaultColorsBox'
+                    #'layout:' #(#LayoutFrame 0 0.0 22 0 0 1.0 115 0)
+                    #'component:' 
+                     #(#SpecCollection
+                        #'collection:' 
+                         #(
+                           #(#ColorMenuSpec
+                              #'name:' 'fgMenu'
+                              #'layout:' #(#LayoutFrame 101 0 17 0 10 1.0 40 0)
+                              #'activeHelpKey:' #foregroundColor
+                              #'model:' #foregroundColor
+                          )
+                           #(#LabelSpec
+                              #'name:' 'fgLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 29 0 1 0.5)
+                              #'label:' 'FG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#LabelSpec
+                              #'name:' 'bgLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 63 0 1 0.5)
+                              #'label:' 'BG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#ColorMenuSpec
+                              #'name:' 'bgMenu'
+                              #'layout:' #(#LayoutFrame 101 0 52 0 10 1.0 75 0)
+                              #'activeHelpKey:' #backgroundColor
+                              #'model:' #backgroundColor
+                          )
+                        )
+                    )
+                    #'label:' 'Default Colors:'
+                    #'labelPosition:' #topLeft
+                )
+                 #(#FramedBoxSpec
+                    #'name:' 'cellColorsBox'
+                    #'layout:' #(#LayoutFrame 0 0 127 0 0 1.0 226 0)
+                    #'component:' 
+                     #(#SpecCollection
+                        #'collection:' 
+                         #(
+                           #(#LabelSpec
+                              #'name:' 'fgSelLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 32 0 1 0.5)
+                              #'label:' 'FG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#InputFieldSpec
+                              #'name:' 'fgSelField'
+                              #'layout:' #(#LayoutFrame 101 0 23 0 10 1.0 45 0)
+                              #'activeHelpKey:' #foregroundSelector
+                              #'model:' #foregroundSelector
+                              #'type:' #symbolOrNil
+                          )
+                           #(#LabelSpec
+                              #'name:' 'bgSelLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 66 0 1 0.5)
+                              #'label:' 'BG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#InputFieldSpec
+                              #'name:' 'bgSelField'
+                              #'layout:' #(#LayoutFrame 101 0 57 0 10 1.0 79 0)
+                              #'activeHelpKey:' #backgroundSelector
+                              #'model:' #backgroundSelector
+                              #'type:' #symbolOrNil
+                          )
+                        )
+                    )
+                    #'label:' 'Color Selectors (Cell):'
+                    #'labelPosition:' #topLeft
+                )
+              )
+          )
+      )
+!
+
 colorEditSpec
     "this window spec was automatically generated by the ST/X UIPainter"
 
@@ -546,6 +659,125 @@
       )
 !
 
+labelEditSpec
+    "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:DataSetBuilder andSelector:#labelEditSpec
+     DataSetBuilder new openInterface:#labelEditSpec
+    "
+
+    <resource: #canvas>
+
+    ^
+     
+       #(#FullSpec
+          #'window:' 
+           #(#WindowSpec
+              #'name:' 'DataSet Misc'
+              #'layout:' #(#LayoutFrame 219 0 193 0 496 0 423 0)
+              #'label:' 'DataSet Misc'
+              #'min:' #(#Point 10 10)
+              #'max:' #(#Point 1280 1024)
+              #'bounds:' #(#Rectangle 219 193 497 424)
+              #'usePreferredExtent:' false
+          )
+          #'component:' 
+           #(#SpecCollection
+              #'collection:' 
+               #(
+                 #(#FramedBoxSpec
+                    #'name:' 'ColorsBox'
+                    #'layout:' #(#LayoutFrame 0 0.0 22 0 0 1.0 105 0)
+                    #'component:' 
+                     #(#SpecCollection
+                        #'collection:' 
+                         #(
+                           #(#ColorMenuSpec
+                              #'name:' 'fgMenu'
+                              #'layout:' #(#LayoutFrame 101 0 15 0 10 1.0 38 0)
+                              #'activeHelpKey:' #foregroundColor
+                              #'model:' #labelForegroundColor
+                          )
+                           #(#LabelSpec
+                              #'name:' 'fgLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 27 0 1 0.5)
+                              #'label:' 'FG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#LabelSpec
+                              #'name:' 'bgLabel'
+                              #'layout:' #(#AlignmentOrigin 100 0 55 0 1 0.5)
+                              #'label:' 'BG-Color:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#ColorMenuSpec
+                              #'name:' 'bgMenu'
+                              #'layout:' #(#LayoutFrame 101 0 44 0 10 1.0 67 0)
+                              #'activeHelpKey:' #backgroundColor
+                              #'model:' #labelBackgroundColor
+                          )
+                        )
+                    )
+                    #'label:' 'Colors:'
+                    #'labelPosition:' #topLeft
+                )
+                 #(#UISubSpecification
+                    #'name:' 'fontSubSpec'
+                    #'layout:' #(#LayoutFrame 67 0.0 116 0 -4 1.0 141 0)
+                    #'minorKey:' #fontSpec
+                )
+                 #(#LabelSpec
+                    #'name:' 'ActionLabel'
+                    #'layout:' #(#AlignmentOrigin 110 0 189 0 1 0.5)
+                    #'label:' 'Select Action:'
+                    #'adjust:' #left
+                    #'resizeForLabel:' true
+                )
+                 #(#LabelSpec
+                    #'name:' 'ArgumentLabel'
+                    #'layout:' #(#AlignmentOrigin 110 0 212 0 1 0.5)
+                    #'label:' 'Argument:'
+                    #'adjust:' #left
+                    #'resizeForLabel:' true
+                )
+                 #(#LabelSpec
+                    #'name:' 'AlignLabel'
+                    #'layout:' #(#AlignmentOrigin 110 0 157 0 1 0.5)
+                    #'label:' 'Align Label:'
+                    #'adjust:' #left
+                    #'resizeForLabel:' true
+                )
+                 #(#PopUpListSpec
+                    #'name:' 'Alignment'
+                    #'layout:' #(#LayoutFrame 116 0 146 0 -4 1.0 168 0)
+                    #'label:' 'Alignment'
+                    #'model:' #labelAlignment
+                    #'menu:' #alignmentList
+                    #'useIndex:' false
+                )
+                 #(#InputFieldSpec
+                    #'name:' 'ActionSelector'
+                    #'layout:' #(#LayoutFrame 116 0 179 0 -4 1.0 201 0)
+                    #'model:' #labelActionSelector
+                    #'type:' #symbolOrNil
+                )
+                 #(#InputFieldSpec
+                    #'name:' 'ArgumentValue'
+                    #'layout:' #(#LayoutFrame 116 0 202 0 -4 1.0 224 0)
+                    #'model:' #labelActionArgument
+                    #'type:' #string
+                )
+              )
+          )
+      )
+!
+
 selectorsEditSpec
     "this window spec was automatically generated by the ST/X UIPainter"
 
@@ -565,11 +797,11 @@
           #'window:' 
            #(#WindowSpec
               #'name:' 'DataSet Basic'
-              #'layout:' #(#LayoutFrame 219 0 193 0 507 0 448 0)
+              #'layout:' #(#LayoutFrame 55 0 280 0 350 0 585 0)
               #'label:' 'DataSet Basic'
               #'min:' #(#Point 10 10)
               #'max:' #(#Point 1280 1024)
-              #'bounds:' #(#Rectangle 219 193 508 449)
+              #'bounds:' #(#Rectangle 55 280 351 586)
               #'usePreferredExtent:' false
           )
           #'component:' 
@@ -578,7 +810,7 @@
                #(
                  #(#FramedBoxSpec
                     #'name:' 'valuesBox'
-                    #'layout:' #(#LayoutFrame 0 0.0 20 0 0 1.0 125 0)
+                    #'layout:' #(#LayoutFrame 0 0.0 16 0 0 1.0 117 0)
                     #'component:' 
                      #(#SpecCollection
                         #'collection:' 
@@ -606,14 +838,14 @@
                           )
                            #(#LabelSpec
                               #'name:' 'printLabel'
-                              #'layout:' #(#AlignmentOrigin 84 0 78 0 1 0.5)
+                              #'layout:' #(#AlignmentOrigin 84 0 75 0 1 0.5)
                               #'label:' 'Print:'
                               #'adjust:' #right
                               #'resizeForLabel:' true
                           )
                            #(#InputFieldSpec
                               #'name:' 'printSelector'
-                              #'layout:' #(#LayoutFrame 86 0 69 0 17 1.0 89 0)
+                              #'layout:' #(#LayoutFrame 86 0 66 0 17 1.0 86 0)
                               #'activeHelpKey:' #printSelector
                               #'model:' #printSelector
                               #'type:' #symbolOrNil
@@ -632,7 +864,7 @@
                 )
                  #(#FramedBoxSpec
                     #'name:' 'menusBox'
-                    #'layout:' #(#LayoutFrame 0 0.0 137 0 0 1.0 217 0)
+                    #'layout:' #(#LayoutFrame 0 0.0 120 0 0 1.0 200 0)
                     #'component:' 
                      #(#SpecCollection
                         #'collection:' 
@@ -670,6 +902,32 @@
                     #'label:' 'Menus:'
                     #'labelPosition:' #topLeft
                 )
+                 #(#FramedBoxSpec
+                    #'name:' 'eventBox'
+                    #'layout:' #(#LayoutFrame 0 0.0 203 0 0 1.0 252 0)
+                    #'component:' 
+                     #(#SpecCollection
+                        #'collection:' 
+                         #(
+                           #(#LabelSpec
+                              #'name:' 'doubleLabel'
+                              #'layout:' #(#AlignmentOrigin 84 0 24 0 1 0.5)
+                              #'label:' 'Double:'
+                              #'adjust:' #right
+                              #'resizeForLabel:' true
+                          )
+                           #(#InputFieldSpec
+                              #'name:' 'doubleClicked'
+                              #'layout:' #(#LayoutFrame 86 0 15 0 17 1.0 35 0)
+                              #'activeHelpKey:' #doubleClickedSelector
+                              #'model:' #doubleClickedSelector
+                              #'type:' #symbolOrNil
+                          )
+                        )
+                    )
+                    #'label:' 'Click Events:'
+                    #'labelPosition:' #topLeft
+                )
               )
           )
       )
@@ -702,6 +960,9 @@
 #editorField
 'type of visual editor (using default editors) or a selector, which will return an visual editor. If the cell is selected, a visual editor is opened in in the cell. In case of an unsupported selector (user defined editor), the row object is asked for the visual editor by performing the selector on the row. A widget instance must be returned which is opened in the cell.'
 
+#doubleClickedSelector
+'selector evaluated without arguments on selected column'
+
 #foregroundColor
 'set the foreground color of the column  if the color-checkBox is turned on. Otherwise, the column uses its default foreground color (which is specified in the styleSheet).'
 
@@ -870,7 +1131,8 @@
                 (Details        detailsEditSpec)
                 (Selectors      selectorsEditSpec)
                 (Format         formatEditSpec)
-                (Colors         colorEditSpec)
+                (Label          labelEditSpec)
+                (Cell           cellEditSpec)
                 (Dimension      dimensionEditSpec)
         )
 !
@@ -895,11 +1157,11 @@
           #'window:' 
            #(#WindowSpec
               #'name:' 'unnamed canvas'
-              #'layout:' #(#LayoutFrame 262 0 460 0 774 0 802 0)
+              #'layout:' #(#LayoutFrame 219 0 193 0 705 0 520 0)
               #'label:' 'unnamed canvas'
               #'min:' #(#Point 10 10)
               #'max:' #(#Point 1152 900)
-              #'bounds:' #(#Rectangle 262 460 775 803)
+              #'bounds:' #(#Rectangle 219 193 706 521)
               #'usePreferredExtent:' false
           )
           #'component:' 
@@ -974,14 +1236,14 @@
                                                   #'label:' 'cancel'
                                                   #'model:' #cancel
                                                   #'enableChannel:' #modifiedChannel
-                                                  #'extent:' #(#Point 171 24)
+                                                  #'extent:' #(#Point 173 24)
                                               )
                                                #(#ActionButtonSpec
                                                   #'name:' 'acceptButton'
                                                   #'label:' 'ok'
                                                   #'model:' #accept
                                                   #'enableChannel:' #modifiedChannel
-                                                  #'extent:' #(#Point 172 24)
+                                                  #'extent:' #(#Point 173 24)
                                               )
                                             )
                                         )
@@ -996,7 +1258,7 @@
                           )
                         )
                     )
-                    #'handles:' #(#Any 0.307992 1.0)
+                    #'handles:' #(#Any 0.265905 1.0)
                 )
               )
           )
@@ -1351,6 +1613,7 @@
     self generateForegroundSelectorIn:cls.
     self generateSelectSelectorIn:cls.
     self generateWriteSelectorIn:cls.
+    self generateDoubleClickSelectorIn:cls.
 !
 
 doMoveColumn:upOrDown
@@ -1456,6 +1719,12 @@
 
 !DataSetBuilder methodsFor:'aspects'!
 
+alignmentList
+    ^ #( #left #right #center )
+
+
+!
+
 aspectFor:aKey
     "returns aspect for a key or nil
     "
@@ -1552,6 +1821,10 @@
     ^ holder
 !
 
+style
+    ^ self aspectFor:#labelFont
+!
+
 tabList
     "automatically generated by UIPainter ..."
 
@@ -1602,7 +1875,7 @@
     "
     |sel catg code bCode|
 
-    catg := 'accessing colors' asSymbol.
+    catg := 'accessing look' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1625,7 +1898,7 @@
     "
     |sel catg code|
 
-    catg := 'accessing choices' asSymbol.
+    catg := 'accessing menu' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1645,12 +1918,35 @@
     ]
 !
 
+generateDoubleClickSelectorIn:aClass
+    "generate code for #foregroundSelector
+    "
+    |sel catg code bCode|
+
+    catg := 'accessing action' asSymbol.
+    code :=   '\'
+            , '    "automatically generated by DataSetBuilder ..."\'
+            , '\'
+            , '    "specific selector to be called on double click"\'
+            , '\'
+            .
+
+    columns do:[:aCol|
+        ((sel := aCol doubleClickedSelector) notNil and:[(aClass implements:sel) not]) ifTrue:[
+            bCode := sel asString, code.
+            self compile:bCode forClass:aClass inCategory:catg
+        ]
+    ]
+
+
+!
+
 generateForegroundSelectorIn:aClass
     "generate code for #foregroundSelector
     "
     |sel catg code bCode|
 
-    catg := 'accessing colors' asSymbol.
+    catg := 'accessing look' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1673,7 +1969,7 @@
     "
     |sel catg code|
 
-    catg := 'accessing menus' asSymbol.
+    catg := 'accessing menu' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1697,7 +1993,7 @@
     "
     |sel catg code|
 
-    catg := 'accessing printSelector' asSymbol.
+    catg := 'accessing' asSymbol.
     code :=   'aGC\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1721,7 +2017,7 @@
     "
     |sel catg code bCode|
 
-    catg := 'accessing readSelector' asSymbol.
+    catg := 'accessing' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1756,7 +2052,7 @@
     "
     |sel catg code bCode|
 
-    catg := 'accessing selectSelector' asSymbol.
+    catg := 'accessing selection' asSymbol.
     code :=   '\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1782,7 +2078,7 @@
     "
     |sel catg code bCode sz|
 
-    catg := 'accessing writeSelector' asSymbol.
+    catg := 'accessing' asSymbol.
     code :=   'aValue\'
             , '    "automatically generated by DataSetBuilder ..."\'
             , '\'
@@ -1836,6 +2132,7 @@
         menu
         foregroundSelector
         backgroundSelector
+        doubleClickedSelector
         selectSelector
         printSelector
         readSelector
@@ -1845,6 +2142,12 @@
         showRowSeparator
         backgroundColor
         foregroundColor
+        labelForegroundColor
+        labelBackgroundColor
+        labelFont
+        labelActionSelector
+        labelActionArgument
+        labelAlignment
      ) do:[:aKey|
         aspects at:aKey put:(holder := ValueHolder new).
         holder addDependent:self.