# HG changeset patch # User ca # Date 878909398 -3600 # Node ID 5cbb117efc19d3e7a5ece1808ef206878a95283d # Parent 3023fc08ee357a5fb01e2f5f022789c22bab6171 refine selection on row base: add a selector diff -r 3023fc08ee35 -r 5cbb117efc19 DataSetBuilder.st --- a/DataSetBuilder.st Sun Nov 02 19:40:38 1997 +0100 +++ b/DataSetBuilder.st Fri Nov 07 14:29:58 1997 +0100 @@ -79,11 +79,11 @@ #'window:' #(#WindowSpec #'name:' 'DataSet Basic' - #'layout:' #(#LayoutFrame 350 0 22 0 638 0 277 0) + #'layout:' #(#LayoutFrame 219 0 193 0 507 0 448 0) #'label:' 'DataSet Basic' #'min:' #(#Point 10 10) #'max:' #(#Point 1280 1024) - #'bounds:' #(#Rectangle 350 22 639 278) + #'bounds:' #(#Rectangle 219 193 508 449) #'usePreferredExtent:' false ) #'component:' @@ -105,7 +105,7 @@ ) #(#FramedBoxSpec #'name:' 'typesFrame' - #'layout:' #(#LayoutFrame 8 0.0 51 0 0 1.0 131 0) + #'layout:' #(#LayoutFrame 8 0.0 69 0 0 1.0 149 0) #'component:' #(#SpecCollection #'collection:' @@ -145,15 +145,8 @@ #'labelPosition:' #topLeft ) #(#CheckBoxSpec - #'name:' 'canSelect' - #'layout:' #(#LayoutOrigin 9 0 145 0) - #'activeHelpKey:' #canSelect - #'model:' #canSelect - #'label:' 'Is Selectable' - ) - #(#CheckBoxSpec #'name:' 'labelIsImage' - #'layout:' #(#LayoutOrigin 9 0 169 0) + #'layout:' #(#LayoutOrigin 9 0 189 0) #'activeHelpKey:' #labelIsImage #'model:' #labelIsImage #'label:' 'Label Is Image' @@ -231,6 +224,74 @@ #'label:' 'Colors:' #'labelPosition:' #topLeft ) + ) + ) + ) +! + +detailsEditSpec + "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:#detailsEditSpec + DataSetBuilder new openInterface:#detailsEditSpec + " + + + + ^ + + #(#FullSpec + #'window:' + #(#WindowSpec + #'name:' 'DataSet Basic' + #'layout:' #(#LayoutFrame 219 0 193 0 507 0 448 0) + #'label:' 'DataSet Basic' + #'min:' #(#Point 10 10) + #'max:' #(#Point 1280 1024) + #'bounds:' #(#Rectangle 219 193 508 449) + #'usePreferredExtent:' false + ) + #'component:' + #(#SpecCollection + #'collection:' + #( + #(#FramedBoxSpec + #'name:' 'selectionBox' + #'layout:' #(#LayoutFrame 0 0.0 20 0 0 1.0 101 0) + #'component:' + #(#SpecCollection + #'collection:' + #( + #(#CheckBoxSpec + #'name:' 'canSelect' + #'layout:' #(#Point 83 15) + #'activeHelpKey:' #canSelect + #'model:' #canSelect + #'label:' 'Is Selectable' + ) + #(#LabelSpec + #'name:' 'selectorLabel' + #'layout:' #(#AlignmentOrigin 84 0 51 0 1 0.5) + #'label:' 'Selector:' + #'adjust:' #right + #'resizeForLabel:' true + ) + #(#InputFieldSpec + #'name:' 'selectSelector' + #'layout:' #(#LayoutFrame 86 0 42 0 17 1.0 62 0) + #'activeHelpKey:' #selectSelector + #'model:' #selectSelector + #'type:' #symbolOrNil + ) + ) + ) + #'label:' 'Selection:' + #'labelPosition:' #topLeft + ) #(#FramedBoxSpec #'name:' 'separatorBox' #'layout:' #(#LayoutFrame 0 0.0 131 0 0 1.0 217 0) @@ -378,11 +439,12 @@ #'window:' #(#WindowSpec #'name:' 'DataSet Details' - #'layout:' #(#LayoutFrame 327 0 282 0 617 0 495 0) + #'layout:' #(#LayoutFrame 219 0 193 0 509 0 406 0) #'label:' 'DataSet Details' #'min:' #(#Point 10 10) #'max:' #(#Point 1280 1024) - #'bounds:' #(#Rectangle 327 282 618 496) + #'bounds:' #(#Rectangle 219 193 510 407) + #'usePreferredExtent:' false ) #'component:' #(#SpecCollection @@ -402,7 +464,7 @@ ) #(#InputFieldSpec #'name:' 'formatField' - #'layout:' #(#LayoutFrame 87 0 37 0 -19 1.0 59 0) + #'layout:' #(#LayoutFrame 87 0 37 0 -2 1.0 59 0) #'activeHelpKey:' #formatString #'model:' #formatString ) @@ -420,7 +482,7 @@ ) #(#ComboListSpec #'name:' 'typeCombo' - #'layout:' #(#LayoutFrame 87 0 102 0 289 0 122 0) + #'layout:' #(#LayoutFrame 87 0 102 0 -2 1.0 122 0) #'activeHelpKey:' #type #'model:' #type #'comboList:' #typeList @@ -434,7 +496,7 @@ ) #(#InputFieldSpec #'name:' 'sizeField' - #'layout:' #(#LayoutFrame 87 0 126 0 -19 1.0 148 0) + #'layout:' #(#LayoutFrame 87 0 126 0 -2 1.0 148 0) #'activeHelpKey:' #size #'model:' #size #'type:' #numberOrNil @@ -474,19 +536,6 @@ #(#SpecCollection #'collection:' #( - #(#LabelSpec - #'name:' 'labelLabel' - #'layout:' #(#AlignmentOrigin 84 0 29 0 1 0.5) - #'label:' 'Label:' - #'adjust:' #right - #'resizeForLabel:' true - ) - #(#InputFieldSpec - #'name:' 'labelField' - #'layout:' #(#LayoutFrame 86 0 20 0 -12 1.0 40 0) - #'activeHelpKey:' #label - #'model:' #label - ) #(#FramedBoxSpec #'name:' 'valuesBox' #'layout:' #(#LayoutFrame 0 0.0 20 0 0 1.0 101 0) @@ -626,6 +675,9 @@ #rendererType 'This type specifies, how the text of an unselected cell should be shown. As Text, CheckToggle, ComboBox, ComboList or as a RowSelector.' +#selectSelector +'an optional selector, which is used to test whether the cell in the column is selectable; the ''Is Selectable'' flag must be enabled.' + #showColumnSeparator 'show or hide the column separator (right vertical separator).' @@ -752,6 +804,7 @@ slices ^ #( (Basics basicsEditSpec) + (Details detailsEditSpec) (Selectors selectorsEditSpec) (Format formatEditSpec) (Colors colorEditSpec) @@ -779,11 +832,11 @@ #'window:' #(#WindowSpec #'name:' 'unnamed canvas' - #'layout:' #(#LayoutFrame 219 0 193 0 690 0 533 0) + #'layout:' #(#LayoutFrame 262 0 460 0 774 0 802 0) #'label:' 'unnamed canvas' #'min:' #(#Point 10 10) #'max:' #(#Point 1152 900) - #'bounds:' #(#Rectangle 219 193 691 534) + #'bounds:' #(#Rectangle 262 460 775 803) #'usePreferredExtent:' false ) #'component:' @@ -858,14 +911,14 @@ #'label:' 'cancel' #'model:' #cancel #'enableChannel:' #modifiedChannel - #'extent:' #(#Point 150 24) + #'extent:' #(#Point 171 24) ) #(#ActionButtonSpec #'name:' 'acceptButton' #'label:' 'ok' #'model:' #accept #'enableChannel:' #modifiedChannel - #'extent:' #(#Point 151 24) + #'extent:' #(#Point 172 24) ) ) ) @@ -880,7 +933,7 @@ ) ) ) - #'handles:' #(#Any 0.334746 1.0) + #'handles:' #(#Any 0.307992 1.0) ) ) ) @@ -1231,6 +1284,7 @@ self generateMenuIn:cls. self generatePrintSelectorIn:cls. self generateReadSelectorIn:cls. + self generateSelectSelectorIn:cls. self generateWriteSelectorIn:cls. ! @@ -1304,7 +1358,7 @@ type == #rowSelector ifTrue:[ #( label width minWidth editorType choices readSelector printSelector - formatString type size height canSelect + formatString type size height canSelect selectSelector ) do:[:aKey| (aspects at:aKey) value:nil ]. ]. @@ -1582,6 +1636,32 @@ ] ! +generateSelectSelectorIn:aClass + "generate code for #selectSelector + " + |sel catg code bCode| + + catg := 'accessing selectSelector' asSymbol. + code := '\' + , ' "automatically generated by DataSetBuilder ..."\' + , '\' + , ' "can select cell in column"\' + , '\' + . + + columns do:[:aColumn| + ( aColumn rendererType ~~ #rowSelector + and:[(sel := aColumn selectSelector) notNil + and:[(aClass implements:sel) not]] + ) ifTrue:[ + aColumn canSelect ifTrue:[ + bCode := sel asString, code, ' ^ true'. + self compile:bCode forClass:aClass inCategory:catg + ] + ] + ] +! + generateWriteSelectorIn:aClass "generate code for #writeSelector " @@ -1631,6 +1711,7 @@ minWidth height menu + selectSelector printSelector readSelector rendererType