202 ^ super helpSpec addPairsFrom:#( |
202 ^ super helpSpec addPairsFrom:#( |
203 |
203 |
204 #align |
204 #align |
205 'Widget alignment functions' |
205 'Widget alignment functions' |
206 |
206 |
|
207 #alignResizeSelectionBottom |
|
208 'Resize the selected widgets'' bottom edges to align them with the bottom of the dominant widget' |
|
209 |
|
210 #alignResizeSelectionLeft |
|
211 'Resize the selected widgets'' left edges to align them with the left edge of the dominant widget' |
|
212 |
|
213 #alignResizeSelectionRight |
|
214 'Resize the selected widgets'' right edges to align them with the right edge of the dominant widget' |
|
215 |
|
216 #alignResizeSelectionTop |
|
217 'Resize the selected widgets'' top edges to align them with the top edge of the dominant widget' |
|
218 |
207 #alignSelectionBottom |
219 #alignSelectionBottom |
208 'Aligns the selected widgets'' bottom edges with the bottom of the dominant widget' |
220 'Aligns the selected widgets'' bottom edges with the bottom of the dominant widget' |
209 |
221 |
210 #alignResizeSelectionBottom |
|
211 'Resize the selected widgets'' bottom edges to align them with the bottom of the dominant widget' |
|
212 |
|
213 #alignSelectionCenterHor |
222 #alignSelectionCenterHor |
214 'Aligns the selected widgets'' centers vertically with the center of the dominant widget' |
223 'Aligns the selected widgets'' centers vertically with the center of the dominant widget' |
215 |
224 |
216 #alignSelectionCenterVer |
225 #alignSelectionCenterVer |
217 'Aligns the selected widgets'' centers horizontally with the center of the dominant widget' |
226 'Aligns the selected widgets'' centers horizontally with the center of the dominant widget' |
218 |
227 |
219 #alignSelectionLeft |
228 #alignSelectionLeft |
220 'Aligns the selected widgets'' left edges with the left edge of the dominant widget' |
229 'Aligns the selected widgets'' left edges with the left edge of the dominant widget' |
221 |
230 |
222 #alignResizeSelectionLeft |
|
223 'Resize the selected widgets'' left edges to align them with the left edge of the dominant widget' |
|
224 |
|
225 #alignSelectionLeftAndRight |
231 #alignSelectionLeftAndRight |
226 'Aligns the selected widgets'' left & right edges with the dominant widget' |
232 'Aligns the selected widgets'' left & right edges with the dominant widget' |
227 |
233 |
228 #alignSelectionRight |
234 #alignSelectionRight |
229 'Aligns the selected widgets'' right edges with the right edge of the dominant widget' |
235 'Aligns the selected widgets'' right edges with the right edge of the dominant widget' |
230 |
236 |
231 #alignResizeSelectionRight |
|
232 'Resize the selected widgets'' right edges to align them with the right edge of the dominant widget' |
|
233 |
|
234 #alignSelectionTop |
237 #alignSelectionTop |
235 'Aligns the selected widgets'' top edges with the top edge of the dominant widget' |
238 'Aligns the selected widgets'' top edges with the top edge of the dominant widget' |
236 |
239 |
237 #alignResizeSelectionTop |
|
238 'Resize the selected widgets'' top edges to align them with the top edge of the dominant widget' |
|
239 |
|
240 #alignSelectionTopAndBottom |
240 #alignSelectionTopAndBottom |
241 'Aligns the selected widgets'' top and bottom edges with the dominant widget' |
241 'Aligns the selected widgets'' top and bottom edges with the dominant widget' |
242 |
242 |
|
243 #alignToGrid |
|
244 'Am Raster ausrichten' |
|
245 |
243 #centerSelectionHor |
246 #centerSelectionHor |
244 'Centers the selected widgets horizontally within their containing widget' |
247 'Centers the selected widgets horizontally within their containing widget' |
245 |
248 |
246 #centerSelectionVer |
249 #centerSelectionVer |
247 'Centers the selected widgets vertically within their containing widget' |
250 'Centers the selected widgets vertically within their containing widget' |
2166 activeHelpKey: editUndo |
2168 activeHelpKey: editUndo |
2167 enabled: hasUndoHistory |
2169 enabled: hasUndoHistory |
2168 label: 'Undo' |
2170 label: 'Undo' |
2169 itemValue: undoLast |
2171 itemValue: undoLast |
2170 nameKey: undo |
2172 nameKey: undo |
2171 translateLabel: true |
|
2172 ) |
2173 ) |
2173 (MenuItem |
2174 (MenuItem |
2174 label: '-' |
2175 label: '-' |
2175 ) |
2176 ) |
2176 (MenuItem |
2177 (MenuItem |
2177 activeHelpKey: editCut |
2178 activeHelpKey: editCut |
2178 enabled: canCutHolder |
2179 enabled: canCutHolder |
2179 label: 'Cut' |
2180 label: 'Cut' |
2180 itemValue: deleteSelection |
2181 itemValue: deleteSelection |
2181 translateLabel: true |
|
2182 ) |
2182 ) |
2183 (MenuItem |
2183 (MenuItem |
2184 activeHelpKey: editCopy |
2184 activeHelpKey: editCopy |
2185 enabled: canCopyHolder |
2185 enabled: canCopyHolder |
2186 label: 'Copy' |
2186 label: 'Copy' |
2187 itemValue: copySelection |
2187 itemValue: copySelection |
2188 translateLabel: true |
|
2189 ) |
2188 ) |
2190 (MenuItem |
2189 (MenuItem |
2191 activeHelpKey: editPaste |
2190 activeHelpKey: editPaste |
2192 enabled: canPasteHolder |
2191 enabled: canPasteHolder |
2193 label: 'Paste' |
2192 label: 'Paste' |
2194 itemValue: pasteBuffer |
2193 itemValue: pasteBuffer |
2195 translateLabel: true |
|
2196 ) |
2194 ) |
2197 (MenuItem |
2195 (MenuItem |
2198 activeHelpKey: pasteWithLayout |
2196 activeHelpKey: pasteWithLayout |
2199 enabled: canPasteKeepingLayoutHolder |
2197 enabled: canPasteKeepingLayoutHolder |
2200 label: 'Paste with Layout' |
2198 label: 'Paste with Layout' |
2201 itemValue: pasteWithLayout |
2199 itemValue: pasteWithLayout |
2202 translateLabel: true |
|
2203 ) |
2200 ) |
2204 (MenuItem |
2201 (MenuItem |
2205 activeHelpKey: editPaste |
2202 activeHelpKey: editPaste |
2206 enabled: canPasteKeepingLayoutHolder |
2203 enabled: canPasteKeepingLayoutHolder |
2207 label: 'Paste Keeping Absolute Position' |
2204 label: 'Paste Keeping Absolute Position' |
2208 itemValue: pasteKeepingPosition |
2205 itemValue: pasteKeepingPosition |
2209 translateLabel: true |
|
2210 ) |
2206 ) |
2211 (MenuItem |
2207 (MenuItem |
2212 activeHelpKey: editDelete |
2208 activeHelpKey: editDelete |
2213 enabled: canCutHolder |
2209 enabled: canCutHolder |
2214 label: 'Delete' |
2210 label: 'Delete' |
2215 itemValue: deleteTotalSelection |
2211 itemValue: deleteTotalSelection |
2216 translateLabel: true |
|
2217 ) |
2212 ) |
2218 (MenuItem |
2213 (MenuItem |
2219 activeHelpKey: replaceBy |
2214 activeHelpKey: replaceBy |
2220 enabled: canReplaceSelection |
2215 enabled: canReplaceSelection |
2221 label: 'Replace By...' |
2216 label: 'Replace By...' |
2222 itemValue: doAskAndReplaceWidgetBy |
2217 itemValue: doAskAndReplaceWidgetBy |
2223 translateLabel: true |
|
2224 ) |
2218 ) |
2225 (MenuItem |
2219 (MenuItem |
2226 label: '-' |
2220 label: '-' |
2227 ) |
2221 ) |
2228 (MenuItem |
2222 (MenuItem |
2229 enabled: canMoveSelection |
2223 enabled: canMoveSelection |
2230 label: 'Move' |
2224 label: 'Move' |
2231 translateLabel: true |
|
2232 submenuChannel: menuMove |
2225 submenuChannel: menuMove |
2233 ) |
2226 ) |
2234 (MenuItem |
2227 (MenuItem |
2235 enabled: canMoveOrAlignSelection |
2228 enabled: canMoveOrAlignSelection |
2236 label: 'Align' |
2229 label: 'Align' |
2237 translateLabel: true |
|
2238 submenuChannel: menuAlign |
2230 submenuChannel: menuAlign |
2239 ) |
2231 ) |
2240 (MenuItem |
2232 (MenuItem |
2241 enabled: hasSelection |
2233 enabled: hasSelection |
2242 label: 'Dimension' |
2234 label: 'Dimension' |
2243 translateLabel: true |
|
2244 submenu: |
2235 submenu: |
2245 (Menu |
2236 (Menu |
2246 ( |
2237 ( |
2247 (MenuItem |
2238 (MenuItem |
2248 activeHelpKey: editDimensionCopyLayout |
2239 activeHelpKey: editDimensionCopyLayout |
2249 enabled: hasSingleSelection |
2240 enabled: hasSingleSelection |
2250 label: 'Copy Layout' |
2241 label: 'Copy Layout' |
2251 itemValue: copyLayout |
2242 itemValue: copyLayout |
2252 translateLabel: true |
|
2253 ) |
2243 ) |
2254 (MenuItem |
2244 (MenuItem |
2255 activeHelpKey: editDimensionPasteLayout |
2245 activeHelpKey: editDimensionPasteLayout |
2256 enabled: canMoveOrAlignSelection |
2246 enabled: canMoveOrAlignSelection |
2257 label: 'Paste Layout' |
2247 label: 'Paste Layout' |
2258 itemValue: pasteLayout |
2248 itemValue: pasteLayout |
2259 translateLabel: true |
|
2260 ) |
2249 ) |
2261 (MenuItem |
2250 (MenuItem |
2262 activeHelpKey: editDimensionExchangeLayouts |
2251 activeHelpKey: editDimensionExchangeLayouts |
2263 enabled: canExchangeSelectionLayouts |
2252 enabled: canExchangeSelectionLayouts |
2264 label: 'Exchange Layouts' |
2253 label: 'Exchange Layouts' |
2265 itemValue: exchangeLayouts |
2254 itemValue: exchangeLayouts |
2266 translateLabel: true |
|
2267 ) |
2255 ) |
2268 (MenuItem |
2256 (MenuItem |
2269 label: '-' |
2257 label: '-' |
2270 ) |
2258 ) |
2271 (MenuItem |
2259 (MenuItem |
2272 activeHelpKey: editDimensionCopyExtent |
2260 activeHelpKey: editDimensionCopyExtent |
2273 enabled: hasSingleSelection |
2261 enabled: hasSingleSelection |
2274 label: 'Copy Extent' |
2262 label: 'Copy Extent' |
2275 itemValue: copyExtent |
2263 itemValue: copyExtent |
2276 translateLabel: true |
|
2277 ) |
2264 ) |
2278 (MenuItem |
2265 (MenuItem |
2279 activeHelpKey: editDimensionPasteExtent |
2266 activeHelpKey: editDimensionPasteExtent |
2280 enabled: canMoveOrAlignSelection |
2267 enabled: canMoveOrAlignSelection |
2281 label: 'Paste Extent' |
2268 label: 'Paste Extent' |
2282 itemValue: pasteExtent |
2269 itemValue: pasteExtent |
2283 translateLabel: true |
|
2284 ) |
2270 ) |
2285 (MenuItem |
2271 (MenuItem |
2286 activeHelpKey: editDimensionPasteWidth |
2272 activeHelpKey: editDimensionPasteWidth |
2287 enabled: canMoveOrAlignSelection |
2273 enabled: canMoveOrAlignSelection |
2288 label: 'Paste Width' |
2274 label: 'Paste Width' |
2289 itemValue: pasteWidth |
2275 itemValue: pasteWidth |
2290 translateLabel: true |
|
2291 ) |
2276 ) |
2292 (MenuItem |
2277 (MenuItem |
2293 activeHelpKey: editDimensionPasteHeight |
2278 activeHelpKey: editDimensionPasteHeight |
2294 enabled: canMoveOrAlignSelection |
2279 enabled: canMoveOrAlignSelection |
2295 label: 'Paste Height' |
2280 label: 'Paste Height' |
2296 itemValue: pasteHeight |
2281 itemValue: pasteHeight |
2297 translateLabel: true |
|
2298 ) |
2282 ) |
2299 (MenuItem |
2283 (MenuItem |
2300 label: '-' |
2284 label: '-' |
2301 ) |
2285 ) |
2302 (MenuItem |
2286 (MenuItem |
2303 activeHelpKey: editDimensionDefaultExtent |
2287 activeHelpKey: editDimensionDefaultExtent |
2304 enabled: canMoveOrAlignSelection |
2288 enabled: canMoveOrAlignSelection |
2305 label: 'Set Default Extent' |
2289 label: 'Set Default Extent' |
2306 itemValue: setToDefaultExtent |
2290 itemValue: setToDefaultExtent |
2307 translateLabel: true |
|
2308 ) |
2291 ) |
2309 (MenuItem |
2292 (MenuItem |
2310 activeHelpKey: editDimensionDefaultWidth |
2293 activeHelpKey: editDimensionDefaultWidth |
2311 enabled: canMoveOrAlignSelection |
2294 enabled: canMoveOrAlignSelection |
2312 label: 'Set Default Width' |
2295 label: 'Set Default Width' |
2313 itemValue: setToDefaultWidth |
2296 itemValue: setToDefaultWidth |
2314 translateLabel: true |
|
2315 ) |
2297 ) |
2316 (MenuItem |
2298 (MenuItem |
2317 activeHelpKey: editDimensionDefaultHeight |
2299 activeHelpKey: editDimensionDefaultHeight |
2318 enabled: canMoveOrAlignSelection |
2300 enabled: canMoveOrAlignSelection |
2319 label: 'Set Default Height' |
2301 label: 'Set Default Height' |
2320 itemValue: setToDefaultHeight |
2302 itemValue: setToDefaultHeight |
2321 translateLabel: true |
|
2322 ) |
2303 ) |
2323 ) |
2304 ) |
2324 nil |
2305 nil |
2325 nil |
2306 nil |
2326 ) |
2307 ) |
2330 ) |
2311 ) |
2331 (MenuItem |
2312 (MenuItem |
2332 activeHelpKey: editOpenSpecDocumentation |
2313 activeHelpKey: editOpenSpecDocumentation |
2333 label: 'Open Widget Documentation' |
2314 label: 'Open Widget Documentation' |
2334 itemValue: doOpenWidgetDocumentation |
2315 itemValue: doOpenWidgetDocumentation |
2335 translateLabel: true |
2316 ) |
2336 ) |
2317 (MenuItem |
2337 (MenuItem |
2318 activeHelpKey: referToConfigDatabase |
2338 activeHelpKey: referToCOnfigDatabase |
|
2339 label: 'Refer to Config Database' |
2319 label: 'Refer to Config Database' |
2340 itemValue: configSelection |
2320 itemValue: configSelection |
2341 translateLabel: true |
|
2342 isVisible: false |
2321 isVisible: false |
2343 ) |
2322 ) |
2344 (MenuItem |
2323 (MenuItem |
2345 label: '-' |
2324 label: '-' |
2346 isVisible: false |
2325 isVisible: false |
2347 ) |
2326 ) |
2348 (MenuItem |
2327 (MenuItem |
2349 activeHelpKey: drawEdit |
2328 activeHelpKey: drawEdit |
2350 label: 'Draw Edit' |
2329 label: 'Draw Edit' |
2351 itemValue: shapeEdit |
2330 itemValue: shapeEdit |
2352 translateLabel: true |
|
2353 isVisible: false |
2331 isVisible: false |
2354 ) |
2332 ) |
2355 (MenuItem |
2333 (MenuItem |
2356 label: '-' |
2334 label: '-' |
2357 ) |
2335 ) |
2358 (MenuItem |
2336 (MenuItem |
2359 activeHelpKey: sortItems |
2337 activeHelpKey: sortItems |
2360 label: 'Sort Selected Items by Position' |
2338 label: 'Sort Selected Items by Position' |
2361 itemValue: doSortItems |
2339 itemValue: doSortItems |
2362 translateLabel: true |
2340 ) |
2363 ) |
|
2364 "/ (MenuItem |
|
2365 "/ label: 'Action' |
|
2366 "/ translateLabel: true |
|
2367 "/ ) |
|
2368 (MenuItem |
2341 (MenuItem |
2369 activeHelpKey: groupWithLayout |
2342 activeHelpKey: groupWithLayout |
2370 enabled: canGroup |
2343 enabled: canGroup |
2371 label: 'Group with Layout' |
2344 label: 'Group with Layout' |
2372 itemValue: groupWithLayout |
2345 itemValue: groupWithLayout |
2373 translateLabel: true |
|
2374 ) |
2346 ) |
2375 (MenuItem |
2347 (MenuItem |
2376 activeHelpKey: ungroup |
2348 activeHelpKey: ungroup |
2377 enabled: canUngroup |
2349 enabled: canUngroup |
2378 label: 'Ungroup' |
2350 label: 'Ungroup' |
2379 itemValue: ungroup |
2351 itemValue: ungroup |
2380 translateLabel: true |
|
2381 ) |
2352 ) |
2382 (MenuItem |
2353 (MenuItem |
2383 activeHelpKey: ungroupWithLayout |
2354 activeHelpKey: ungroupWithLayout |
2384 enabled: canGroup |
2355 enabled: canGroup |
2385 label: 'Ungroup with Layout' |
2356 label: 'Ungroup with Layout' |
2386 itemValue: ungroupWithLayout |
2357 itemValue: ungroupWithLayout |
2387 translateLabel: true |
|
2388 ) |
2358 ) |
2389 (MenuItem |
2359 (MenuItem |
2390 label: '-' |
2360 label: '-' |
2391 ) |
2361 ) |
2392 (MenuItem |
2362 (MenuItem |
2393 activeHelpKey: editBrowseViewClass |
2363 activeHelpKey: editBrowseViewClass |
2394 enabled: hasOneSelectionOtherThanCanvas |
2364 enabled: hasOneSelectionOtherThanCanvas |
2395 label: 'Browse Widget Class' |
2365 label: 'Browse Widget Class' |
2396 itemValue: doBrowseViewClass |
2366 itemValue: doBrowseViewClass |
2397 translateLabel: true |
|
2398 ) |
2367 ) |
2399 (MenuItem |
2368 (MenuItem |
2400 activeHelpKey: editInspectView |
2369 activeHelpKey: editInspectView |
2401 enabled: hasOneSelectionOtherThanCanvas |
2370 enabled: hasOneSelectionOtherThanCanvas |
2402 label: 'Inspect Widget' |
2371 label: 'Inspect Widget' |
2403 itemValue: doInspectView |
2372 itemValue: doInspectView |
2404 translateLabel: true |
|
2405 ) |
2373 ) |
2406 (MenuItem |
2374 (MenuItem |
2407 activeHelpKey: editBrowseViewClass |
2375 activeHelpKey: editBrowseViewClass |
2408 label: 'Browse Specification Class' |
2376 label: 'Browse Specification Class' |
2409 itemValue: doBrowseSpecificationClass |
2377 itemValue: doBrowseSpecificationClass |
2410 translateLabel: true |
|
2411 ) |
2378 ) |
2412 (MenuItem |
2379 (MenuItem |
2413 activeHelpKey: editInspectSpec |
2380 activeHelpKey: editInspectSpec |
2414 label: 'Inspect Spec' |
2381 label: 'Inspect Spec' |
2415 itemValue: doInspectSpec |
2382 itemValue: doInspectSpec |
2416 translateLabel: true |
2383 ) |
|
2384 (MenuItem |
|
2385 label: '-' |
|
2386 ) |
|
2387 (MenuItem |
|
2388 activeHelpKey: editSaveSpecForSelection |
|
2389 enabled: hasOneSelectionOtherThanCanvas |
|
2390 label: 'Save Spec of Selection...' |
|
2391 itemValue: doSaveElementSpecAs |
2417 ) |
2392 ) |
2418 ) |
2393 ) |
2419 nil |
2394 nil |
2420 nil |
2395 nil |
2421 ) |
2396 ) |
5688 specClass := classAndSelector methodClass. |
5663 specClass := classAndSelector methodClass. |
5689 specClassName := classAndSelector methodClass name. |
5664 specClassName := classAndSelector methodClass name. |
5690 specSelector := classAndSelector methodSelector. |
5665 specSelector := classAndSelector methodSelector. |
5691 specSuperclassName := specClass superclass name. |
5666 specSuperclassName := specClass superclass name. |
5692 self doSave. |
5667 self doSave. |
|
5668 ^ true |
|
5669 ! |
|
5670 |
|
5671 doSaveElementSpecAs |
|
5672 "opens a ResourceSelectionBrowser for saving a spec for the selected |
|
5673 elements on a class. |
|
5674 Useful to save parts for refactoring a spec into |
|
5675 subSpecifications, for example when putting parts into a tab" |
|
5676 |
|
5677 |spec fullSpec classAndSelector subSpecClass subSpecClassName subSpecSelector code| |
|
5678 |
|
5679 self askForSectionModification. |
|
5680 |
|
5681 (spec := self painter specForSelection) isNil ifTrue:[ |
|
5682 self warn:('Select a single item first'). |
|
5683 ^ false |
|
5684 ]. |
|
5685 |
|
5686 classAndSelector := ResourceSelectionBrowser |
|
5687 request: 'Save Subspec in Class' |
|
5688 onSuperclass: #Object |
|
5689 andClass: specClassName |
|
5690 andSelector: #subSpec |
|
5691 withResourceTypes: #(canvas). |
|
5692 |
|
5693 classAndSelector isNil ifTrue:[^ false]. |
|
5694 |
|
5695 self clearModified. |
|
5696 self painter resetModification. |
|
5697 |
|
5698 subSpecClass := classAndSelector methodClass. |
|
5699 subSpecClassName := classAndSelector methodClass name. |
|
5700 subSpecSelector := classAndSelector methodSelector. |
|
5701 |
|
5702 subSpecClass := self resolveName:subSpecClassName. |
|
5703 (subSpecClass notNil and:[ subSpecClass isClass ]) ifFalse:[ |
|
5704 self warn:('Oops - cannot save - class not found: ' , subSpecClassName). |
|
5705 ^ false |
|
5706 ]. |
|
5707 |
|
5708 spec := painter fullSpecFor:(painter singleSelection). |
|
5709 |
|
5710 fullSpec := treeView generateFullSpecForComponents:(Array with:spec) named:subSpecSelector asUppercaseFirst. |
|
5711 code := painter generateWindowSpecMethodSourceFor:fullSpec class:subSpecClassName selector:subSpecSelector. |
|
5712 (ReadStream on:code) fileIn. |
5693 ^ true |
5713 ^ true |
5694 ! |
5714 ! |
5695 |
5715 |
5696 doSelectAspectMethod:aspectSelector |
5716 doSelectAspectMethod:aspectSelector |
5697 "open a dialog to select an existing aspect method and enter in the field" |
5717 "open a dialog to select an existing aspect method and enter in the field" |