286 'Opens a dialog to save the menu spec (and the help spec, if modified).' |
286 'Opens a dialog to save the menu spec (and the help spec, if modified).' |
287 |
287 |
288 #hideMenuOnActivated |
288 #hideMenuOnActivated |
289 'If on, the menu hides itself after an item was activated' |
289 'If on, the menu hides itself after an item was activated' |
290 |
290 |
|
291 #imageImageAndLabel |
|
292 'Toggles display of both image and textual label.' |
|
293 |
|
294 #imageImageEditor |
|
295 'Opens an Image Editor on the resource method defined by retriever and selector.' |
|
296 |
|
297 #imageImageList |
|
298 'Currently existing image resources.' |
|
299 |
|
300 #imageRetriever |
|
301 'Class implementing the image resource method. If no class is given, the current application class will be taken.' |
|
302 |
|
303 #imageSelector |
|
304 'Selector returning an image (sent to above or the application).' |
|
305 |
|
306 #keepLinkedMenu |
|
307 'Keep the linked menu after activation (do not destroy)' |
|
308 |
|
309 #showBusyCursorWhilePerforming |
|
310 'If on, a busy cursor is shown while an items action is performed' |
|
311 |
291 #triggerOnDown |
312 #triggerOnDown |
292 'If on, the items action is performed on mouse-button press (default is on button-release)' |
313 'If on, the items action is performed on mouse-button press (default is on button-release)' |
293 |
|
294 #showBusyCursorWhilePerforming |
|
295 'If on, a busy cursor is shown while an items action is performed' |
|
296 |
|
297 #imageImageAndLabel |
|
298 'Toggles display of both image and textual label.' |
|
299 |
|
300 #imageImageEditor |
|
301 'Opens an Image Editor on the resource method defined by retriever and selector.' |
|
302 |
|
303 #imageImageList |
|
304 'Currently existing image resources.' |
|
305 |
|
306 #imageRetriever |
|
307 'Class implementing the image resource method. If no class is given, the current application class will be taken.' |
|
308 |
|
309 #imageSelector |
|
310 'Selector returning an image (sent to above or the application).' |
|
311 |
|
312 #keepLinkedMenu |
|
313 'Keep the linked menu after activation (do not destroy)' |
|
314 |
314 |
315 ) |
315 ) |
316 ! ! |
316 ! ! |
317 |
317 |
318 !MenuEditor class methodsFor:'image specs'! |
318 !MenuEditor class methodsFor:'image specs'! |
1245 #layout: #(#LayoutFrame -40 1 40 0 -20 1 62 0) |
1245 #layout: #(#LayoutFrame -40 1 40 0 -20 1 62 0) |
1246 #activeHelpKey: #browseResource |
1246 #activeHelpKey: #browseResource |
1247 #tabable: true |
1247 #tabable: true |
1248 #model: #doBrowseForImageResource |
1248 #model: #doBrowseForImageResource |
1249 ) |
1249 ) |
1250 #(#SequenceViewSpec |
1250 #(#SelectionInListModelViewSpec |
1251 #name: 'systemOrUserImagesList' |
1251 #name: 'selectionOfImage' |
1252 #layout: #(#LayoutFrame 20 0.0 67 0 -20 1.0 -30 1.0) |
1252 #layout: #(#LayoutFrame 20 0.0 67 0 -20 1.0 -30 1.0) |
1253 #activeHelpKey: #imageImageList |
1253 #activeHelpKey: #imageImageList |
1254 #tabable: true |
1254 #tabable: true |
1255 #model: #selectionOfImage |
1255 #model: #selectionOfImage |
1256 #menu: #menuEditImage |
1256 #menu: #menuEditImage |
1257 #hasHorizontalScrollBar: true |
1257 #hasHorizontalScrollBar: true |
1258 #hasVerticalScrollBar: true |
1258 #hasVerticalScrollBar: true |
1259 #miniScrollerHorizontal: true |
1259 #miniScrollerHorizontal: true |
|
1260 #listModel: #listOfImages |
|
1261 #useIndex: false |
|
1262 #highlightMode: #line |
1260 #doubleClickSelector: #doEditImage |
1263 #doubleClickSelector: #doEditImage |
1261 #valueChangeSelector: #imageSelected |
1264 #valueChangeSelector: #imageSelected |
1262 #useIndex: false |
|
1263 #sequenceList: #listOfImages |
|
1264 ) |
1265 ) |
1265 #(#ViewSpec |
1266 #(#ViewSpec |
1266 #name: 'Box1' |
1267 #name: 'Box1' |
1267 #layout: #(#LayoutFrame 20 0.0 -30 1.0 -20 1.0 0 1.0) |
1268 #layout: #(#LayoutFrame 20 0.0 -30 1.0 -20 1.0 0 1.0) |
1268 #level: 0 |
1269 #level: 0 |
2227 lastImageRetriever := cls. |
2228 lastImageRetriever := cls. |
2228 |
2229 |
2229 newList := self class getAllImageSelectorsFrom:cls. |
2230 newList := self class getAllImageSelectorsFrom:cls. |
2230 newList := newList collect: [:sel| |img| |
2231 newList := newList collect: [:sel| |img| |
2231 img := cls perform: sel. |
2232 img := cls perform: sel. |
2232 img height > 22 ifTrue:[ |
2233 img height > 32 ifTrue:[ |
2233 img := img magnifiedBy: 22 / img extent y |
2234 img := img magnifiedBy: 32 / img extent y |
2234 ]. |
2235 ]. |
2235 LabelAndIcon icon:img string:sel |
2236 LabelAndIcon icon:img string:sel |
2236 ]. |
2237 ]. |
2237 ]. |
2238 ]. |
2238 ] ifFalse:[ |
2239 ] ifFalse:[ |