249 #selectionLabelClickSelector |
250 #selectionLabelClickSelector |
250 'A selector called if a cell was clicked.' |
251 'A selector called if a cell was clicked.' |
251 |
252 |
252 #selectionLabelSelectorArgument |
253 #selectionLabelSelectorArgument |
253 'An argument passed to the label selection selector.' |
254 'An argument passed to the label selection selector.' |
|
255 |
|
256 #showComboFieldSelector |
|
257 'Selector which returns true if the editor on the ComboBox/List has an input field.' |
254 |
258 |
255 #showSelectionHighLighted |
259 #showSelectionHighLighted |
256 'Show selected cell highligthened (change fg/bg color).' |
260 'Show selected cell highligthened (change fg/bg color).' |
257 |
261 |
258 #valuesChoiceSelector |
262 #valuesChoiceSelector |
1113 |
1117 |
1114 #(#FullSpec |
1118 #(#FullSpec |
1115 #window: |
1119 #window: |
1116 #(#WindowSpec |
1120 #(#WindowSpec |
1117 #name: 'DataSet Basic' |
1121 #name: 'DataSet Basic' |
1118 #layout: #(#LayoutFrame 216 0 173 0 511 0 478 0) |
1122 #layout: #(#LayoutFrame 14 0 192 0 309 0 497 0) |
1119 #label: 'DataSet Basic' |
1123 #label: 'DataSet Basic' |
1120 #min: #(#Point 10 10) |
1124 #min: #(#Point 10 10) |
1121 #max: #(#Point 1280 1024) |
1125 #max: #(#Point 1280 1024) |
1122 #bounds: #(#Rectangle 216 173 512 479) |
1126 #bounds: #(#Rectangle 14 192 310 498) |
1123 #usePreferredExtent: false |
1127 #usePreferredExtent: false |
1124 ) |
1128 ) |
1125 #component: |
1129 #component: |
1126 #(#SpecCollection |
1130 #(#SpecCollection |
1127 #collection: |
1131 #collection: |
1210 #label: 'Menu:' |
1214 #label: 'Menu:' |
1211 #labelPosition: #topLeft |
1215 #labelPosition: #topLeft |
1212 ) |
1216 ) |
1213 #(#FramedBoxSpec |
1217 #(#FramedBoxSpec |
1214 #name: 'framedBox1' |
1218 #name: 'framedBox1' |
1215 #layout: #(#LayoutFrame 1 0.0 191 0 1 1.0 249 0) |
1219 #layout: #(#LayoutFrame 1 0.0 191 0 1 1.0 279 0) |
1216 #component: |
1220 #component: |
1217 #(#SpecCollection |
1221 #(#SpecCollection |
1218 #collection: |
1222 #collection: |
1219 #( |
1223 #( |
1220 #(#LabelSpec |
1224 #(#LabelSpec |
1221 #name: 'label2' |
1225 #name: 'ChoicesLabel' |
1222 #layout: #(#AlignmentOrigin 94 0 15 0 1 0.5) |
1226 #layout: #(#AlignmentOrigin 94 0 15 0 1 0.5) |
1223 #activeHelpKey: #valuesChoiceSelector |
1227 #activeHelpKey: #valuesChoiceSelector |
1224 #label: 'Selector:' |
1228 #label: 'Choices:' |
1225 #adjust: #right |
1229 #adjust: #right |
1226 #resizeForLabel: true |
1230 #resizeForLabel: true |
1227 ) |
1231 ) |
1228 #(#InputFieldSpec |
1232 #(#InputFieldSpec |
1229 #name: 'inputField2' |
1233 #name: 'ChoicesField' |
1230 #layout: #(#LayoutFrame 97 0 4 0 2 1.0 26 0) |
1234 #layout: #(#LayoutFrame 97 0 4 0 2 1.0 26 0) |
1231 #activeHelpKey: #valuesChoiceSelector |
1235 #activeHelpKey: #valuesChoiceSelector |
1232 #tabable: true |
1236 #tabable: true |
1233 #model: #choices |
1237 #model: #choices |
1234 #type: #symbolOrNil |
1238 #type: #symbolOrNil |
|
1239 #acceptOnLeave: false |
|
1240 ) |
|
1241 #(#LabelSpec |
|
1242 #name: 'ShowInputFieldLabel' |
|
1243 #layout: #(#AlignmentOrigin 94 0 41 0 1 0.5) |
|
1244 #activeHelpKey: #showComboFieldSelector |
|
1245 #label: 'Editable:' |
|
1246 #adjust: #right |
|
1247 #resizeForLabel: true |
|
1248 ) |
|
1249 #(#InputFieldSpec |
|
1250 #name: 'ShowInputFieldField' |
|
1251 #layout: #(#LayoutFrame 97 0 30 0 2 1.0 52 0) |
|
1252 #activeHelpKey: #showComboFieldSelector |
|
1253 #tabable: true |
|
1254 #model: #showComboFieldSelector |
|
1255 #type: #symbolOrNil |
|
1256 #acceptOnLeave: false |
1235 ) |
1257 ) |
1236 ) |
1258 ) |
1237 ) |
1259 ) |
1238 #label: 'List Choice:' |
1260 #label: 'Combo List/Box Selectors:' |
1239 #labelPosition: #topLeft |
1261 #labelPosition: #topLeft |
1240 ) |
1262 ) |
1241 ) |
1263 ) |
1242 ) |
1264 ) |
1243 ) |
1265 ) |
1244 |
|
1245 "Modified: / 13.8.1998 / 19:55:07 / cg" |
|
1246 ! |
1266 ! |
1247 |
1267 |
1248 windowSpec |
1268 windowSpec |
1249 "This resource specification was automatically generated |
1269 "This resource specification was automatically generated |
1250 by the UIPainter of ST/X." |
1270 by the UIPainter of ST/X." |
2038 ! |
2058 ! |
2039 |
2059 |
2040 generateChoicesIn:aClass |
2060 generateChoicesIn:aClass |
2041 "generate code for #choices" |
2061 "generate code for #choices" |
2042 |
2062 |
2043 |sel catg code| |
2063 |sel catg code edt| |
2044 |
2064 |
2045 catg := 'accessing menu' asSymbol. |
2065 catg := 'accessing menu' asSymbol. |
2046 code := '\' |
2066 code := '\' |
2047 , ' "automatically generated by DataSetBuilder ..."\' |
2067 , ' "automatically generated by DataSetBuilder ..."\' |
2048 , '\' |
2068 , '\' |
2049 , ' "get choices for visual editor; (a list of labels)..."\' |
2069 , ' "get choices for visual editor; (a list of labels)..."\' |
2050 , '\' |
2070 , '\' |
2051 , ' ^ #( foo bar baz )' |
2071 , ' ^ #( foo bar baz )' |
2052 . |
2072 . |
2053 |
2073 |
2054 columns do: |
2074 columns do:[:aColumn| |
2055 [:aColumn| |
2075 edt := aColumn editorType. |
2056 (aColumn canSelect |
2076 |
2057 and:[aColumn rendererType ~~ #rowSelector |
2077 ( aColumn canSelect |
2058 and:[(sel := aColumn choices) notNil |
2078 and:[(sel := aColumn choices) notNil |
2059 and:[(aClass implements:sel) not]]]) |
2079 and:[(edt == #ComboBox or:[edt == #ComboList]) |
2060 ifTrue: |
2080 and:[(aClass implements:sel) not]]] |
2061 [ |
2081 ) ifTrue:[ |
2062 self compile:(sel asString, code) forClass:aClass inCategory:catg |
2082 self compile:(sel asString, code) forClass:aClass inCategory:catg |
2063 ] |
2083 ] |
2064 ] |
2084 ] |
2065 ! |
2085 ! |
2066 |
2086 |
2270 bCode := sel asString, code, ' ^true'. |
2290 bCode := sel asString, code, ' ^true'. |
2271 self compile:bCode forClass:aClass inCategory:catg |
2291 self compile:bCode forClass:aClass inCategory:catg |
2272 ] |
2292 ] |
2273 ] |
2293 ] |
2274 ] |
2294 ] |
|
2295 ! |
|
2296 |
|
2297 generateShowComboFieldSelectorIn:aClass |
|
2298 "generate code for #showComboFieldSelector |
|
2299 " |
|
2300 |sel catg code bCode edt state| |
|
2301 |
|
2302 catg := 'accessing menu' asSymbol. |
|
2303 code := '\' |
|
2304 , ' "automatically generated by DataSetBuilder ..."\' |
|
2305 , '\' |
|
2306 , ' "open an editField on a combo list or box"\' |
|
2307 , '\' |
|
2308 . |
|
2309 |
|
2310 columns do:[:aColumn| |
|
2311 edt := aColumn editorType. |
|
2312 |
|
2313 ( aColumn canSelect |
|
2314 and:[(sel := aColumn showComboFieldSelector) notNil |
|
2315 and:[(edt == #ComboBox or:[edt == #ComboList]) |
|
2316 and:[(aClass implements:sel) not]]] |
|
2317 ) ifTrue:[ |
|
2318 state := edt == #ComboBoxView. |
|
2319 |
|
2320 bCode := sel asString, code, ' ^ ', state printString. |
|
2321 self compile:bCode forClass:aClass inCategory:catg |
|
2322 ] |
|
2323 ] |
|
2324 |
|
2325 |
2275 ! |
2326 ! |
2276 |
2327 |
2277 generateWriteSelectorIn:aClass |
2328 generateWriteSelectorIn:aClass |
2278 "generate code for #writeSelector" |
2329 "generate code for #writeSelector" |
2279 |
2330 |
2363 writeSelector: #at:put:; |
2414 writeSelector: #at:put:; |
2364 backgroundSelector:nil; |
2415 backgroundSelector:nil; |
2365 foregroundSelector:nil; |
2416 foregroundSelector:nil; |
2366 rowSeparatorSelector:nil; |
2417 rowSeparatorSelector:nil; |
2367 selectSelector: nil; |
2418 selectSelector: nil; |
|
2419 showComboFieldSelector: nil; |
2368 doubleClickedSelector: nil; |
2420 doubleClickedSelector: nil; |
2369 printSelector: nil; |
2421 printSelector: nil; |
2370 menu: nil; |
2422 menu: nil; |
2371 labelActionSelector:#labelInPreviewPressed:; |
2423 labelActionSelector:#labelInPreviewPressed:; |
2372 labelActionArgument:anIndex; |
2424 labelActionArgument:anIndex; |
2496 |
2548 |
2497 type := (aspects at:#rendererType) value. |
2549 type := (aspects at:#rendererType) value. |
2498 |
2550 |
2499 type == #rowSelector ifTrue:[ |
2551 type == #rowSelector ifTrue:[ |
2500 #(label width minWidth editorType choices readSelector writeSelector printSelector |
2552 #(label width minWidth editorType choices readSelector writeSelector printSelector |
2501 formatString type size height canSelect selectSelector |
2553 formatString type size height canSelect selectSelector showComboFieldSelector |
2502 ) do:[:aKey| |
2554 ) do:[:aKey| |
2503 (aspects at:aKey) value:nil |
2555 (aspects at:aKey) value:nil |
2504 ] |
2556 ] |
2505 ]. |
2557 ]. |
2506 aspects keysAndValuesDo:[:aKey :aModel| column perform:(aKey , ':') asSymbol with: aModel value]. |
2558 aspects keysAndValuesDo:[:aKey :aModel| column perform:(aKey , ':') asSymbol with: aModel value]. |
2708 self generateForegroundSelectorIn:cls. |
2760 self generateForegroundSelectorIn:cls. |
2709 self generateSelectSelectorIn:cls. |
2761 self generateSelectSelectorIn:cls. |
2710 self generateWriteSelectorIn:cls. |
2762 self generateWriteSelectorIn:cls. |
2711 self generateDoubleClickSelectorIn:cls. |
2763 self generateDoubleClickSelectorIn:cls. |
2712 self generateRowSeparatorSelectorIn:cls. |
2764 self generateRowSeparatorSelectorIn:cls. |
|
2765 self generateShowComboFieldSelectorIn:cls. |
|
2766 |
2713 ! |
2767 ! |
2714 |
2768 |
2715 doMoveColumn:upOrDown |
2769 doMoveColumn:upOrDown |
2716 "move selected column up or down" |
2770 "move selected column up or down" |
2717 |
2771 |