author | Stefan Vogel <sv@exept.de> |
Mon, 25 Feb 2008 17:47:27 +0100 | |
changeset 2281 | e6cc565bff35 |
parent 2275 | b0f6890e73cf |
child 2297 | ee43ce83094d |
permissions | -rw-r--r-- |
199 | 1 |
" |
738 | 2 |
COPYRIGHT (c) 1997 by eXept Software AG |
1606 | 3 |
All Rights Reserved |
199 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
738 | 7 |
inclusion of the above copyright notice. This software may not |
199 | 8 |
be provided or otherwise made available to, or used by, any |
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1372 | 12 |
"{ Package: 'stx:libtool2' }" |
13 |
||
738 | 14 |
ResourceSpecEditor subclass:#MenuEditor |
1606 | 15 |
instanceVariableNames:'selectionHolder tabHolder listOfItems listOfTabs |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
16 |
selectedSuperItems notifyDisabledCounter wizards listOfItemsView |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
17 |
dropOverLine' |
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
18 |
classVariableNames:'ImageRetrieverClasses' |
220 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-UIPainter' |
|
199 | 21 |
! |
22 |
||
1606 | 23 |
HierarchicalItem subclass:#Item |
24 |
instanceVariableNames:'menuItem' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:MenuEditor |
|
28 |
! |
|
29 |
||
1631 | 30 |
MenuEditor::Item subclass:#ActionItem |
1606 | 31 |
instanceVariableNames:'' |
1407 | 32 |
classVariableNames:'' |
33 |
poolDictionaries:'' |
|
34 |
privateIn:MenuEditor |
|
35 |
! |
|
36 |
||
1631 | 37 |
MenuEditor::Item subclass:#LinkedMenuItem |
1606 | 38 |
instanceVariableNames:'' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:MenuEditor |
|
42 |
! |
|
43 |
||
1844 | 44 |
MenuEditor::Item subclass:#MenuSliceItem |
45 |
instanceVariableNames:'' |
|
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
privateIn:MenuEditor |
|
49 |
! |
|
50 |
||
1633 | 51 |
MenuEditor::Item subclass:#RegularMenuItem |
1454 | 52 |
instanceVariableNames:'' |
53 |
classVariableNames:'' |
|
54 |
poolDictionaries:'' |
|
55 |
privateIn:MenuEditor |
|
56 |
! |
|
57 |
||
1606 | 58 |
ApplicationModel subclass:#ResourceEditor |
59 |
instanceVariableNames:'selectorHolder iconAndLabelHolder retrieverHolder imageHolder |
|
60 |
imageList imageViewer' |
|
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:MenuEditor |
|
64 |
! |
|
65 |
||
66 |
HierarchicalItem subclass:#ResourceEditorItem |
|
67 |
instanceVariableNames:'selector icon' |
|
68 |
classVariableNames:'' |
|
69 |
poolDictionaries:'' |
|
70 |
privateIn:MenuEditor |
|
71 |
! |
|
72 |
||
1633 | 73 |
MenuEditor::RegularMenuItem subclass:#RootItem |
1631 | 74 |
instanceVariableNames:'' |
75 |
classVariableNames:'' |
|
76 |
poolDictionaries:'' |
|
77 |
privateIn:MenuEditor |
|
78 |
! |
|
79 |
||
80 |
MenuEditor::Item subclass:#SeparatorItem |
|
81 |
instanceVariableNames:'' |
|
82 |
classVariableNames:'' |
|
83 |
poolDictionaries:'' |
|
84 |
privateIn:MenuEditor |
|
85 |
! |
|
86 |
||
199 | 87 |
!MenuEditor class methodsFor:'documentation'! |
88 |
||
89 |
copyright |
|
90 |
" |
|
738 | 91 |
COPYRIGHT (c) 1997 by eXept Software AG |
1606 | 92 |
All Rights Reserved |
199 | 93 |
|
94 |
This software is furnished under a license and may be used |
|
95 |
only in accordance with the terms of that license and with the |
|
738 | 96 |
inclusion of the above copyright notice. This software may not |
199 | 97 |
be provided or otherwise made available to, or used by, any |
98 |
other person. No title to or ownership of the software is |
|
99 |
hereby transferred. |
|
100 |
" |
|
101 |
! |
|
102 |
||
103 |
documentation |
|
104 |
" |
|
728 | 105 |
The MenuEditor allows you to create, modify or just inspect |
1606 | 106 |
menus. |
107 |
||
108 |
||
109 |
[Instance variables:] |
|
110 |
||
2188 | 111 |
listOfItemsView <HierarcicalListView> the view which shows the list of items |
112 |
listOfItems <HierarchicalList> hierarchical list of menu items |
|
113 |
listOfTabs <List> list of current shown tab-labels |
|
114 |
||
115 |
selectionHolder <ValueHolder> collection of current selected items |
|
116 |
selectedSuperItems <Collection> collection of superItems derived from selection |
|
117 |
||
118 |
tabHolder <ValueHolder> selected tab label holder |
|
119 |
notifyDisabledCounter <SmallInteger> ~~ 0 than change notifications are discard |
|
120 |
wizards <IdentityDictionary> keeps all created wizard dialogs |
|
121 |
||
122 |
dropOverLine <nil or SmallInteger> nil: drop context not dropabel. |
|
123 |
= 0: drop context dropable but no item specified |
|
124 |
~ 0: drop context dropable for item at lineNumber |
|
125 |
used t6o restore drop indication drawings |
|
126 |
||
1606 | 127 |
[Class variables:] |
2188 | 128 |
ImageRetrieverClasses <Collection> sorted collection of image receivers |
199 | 129 |
|
130 |
[start with:] |
|
2188 | 131 |
MenuEditor open |
132 |
MenuEditor openOnClass:MenuEditor andSelector:#menu |
|
199 | 133 |
|
134 |
[author:] |
|
2188 | 135 |
Claus Atzkern, eXept Software AG |
136 |
Thomas Zwick, eXept Software AG |
|
199 | 137 |
" |
138 |
! ! |
|
139 |
||
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
140 |
!MenuEditor class methodsFor:'initialization'! |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
141 |
|
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
142 |
initialize |
2188 | 143 |
ImageRetrieverClasses := #( |
1606 | 144 |
Icon |
2188 | 145 |
SystemBrowser |
1606 | 146 |
ToolbarIconLibrary |
2188 | 147 |
). |
1546
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
148 |
|
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
149 |
" |
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
150 |
self initialize |
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
151 |
" |
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
152 |
! ! |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
153 |
|
508 | 154 |
!MenuEditor class methodsFor:'instance creation'! |
155 |
||
728 | 156 |
openModalOnMenu: aMenu |
1606 | 157 |
"Open a MenuEditor modal on aMenu |
158 |
self openModalOnMenu: (self perform: #menu) decodeAsLiteralArray |
|
734 | 159 |
" |
1606 | 160 |
^self new openModalOnMenu:aMenu |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
161 |
! ! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
162 |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
163 |
!MenuEditor class methodsFor:'accessing image retriever'! |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
164 |
|
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
165 |
addNewImageRetriever:aSymbolOrClass |
1546
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
166 |
"add a class to the imageRetriever list" |
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
167 |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
168 |
|key| |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
169 |
|
1546
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
170 |
aSymbolOrClass isBehavior ifTrue:[ |
1606 | 171 |
key := aSymbolOrClass nameWithNameSpacePrefix |
1546
4485d0c37aae
another default image retriever
Claus Gittinger <cg@exept.de>
parents:
1545
diff
changeset
|
172 |
] ifFalse:[ |
1606 | 173 |
key := aSymbolOrClass |
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
174 |
]. |
1463 | 175 |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
176 |
key size ~~ 0 ifTrue:[ |
1606 | 177 |
key := key asSymbol. |
178 |
||
179 |
(ImageRetrieverClasses includes:key) ifFalse:[ |
|
180 |
ImageRetrieverClasses := ImageRetrieverClasses asOrderedCollection. |
|
181 |
ImageRetrieverClasses add:key. |
|
182 |
ImageRetrieverClasses sort. |
|
183 |
] |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
184 |
]. |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
185 |
! |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
186 |
|
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
187 |
imageRetrieverClasses |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
188 |
"returns a collection of image retrievers |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
189 |
" |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
190 |
^ ImageRetrieverClasses |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
191 |
! ! |
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
192 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
193 |
!MenuEditor class methodsFor:'aspects'! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
194 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
195 |
aspects |
728 | 196 |
"get the aspects for the attributes of the menu components" |
197 |
||
198 |
^#( |
|
2188 | 199 |
rawLabel |
200 |
accessCharacterPosition |
|
201 |
showBusyCursorWhilePerforming |
|
202 |
horizontalLayout |
|
203 |
triggerOnDown |
|
204 |
font |
|
205 |
argument |
|
206 |
submenuChannel |
|
207 |
keepLinkedMenu |
|
208 |
enabled |
|
209 |
itemValue |
|
210 |
nameKey |
|
211 |
indication |
|
212 |
choice |
|
213 |
choiceValue |
|
214 |
translateLabel |
|
215 |
isButton |
|
216 |
shortcutKeyCharacter |
|
217 |
startGroup |
|
218 |
isVisible |
|
219 |
hideMenuOnActivated |
|
220 |
auxValue |
|
221 |
activeHelpKey |
|
222 |
resourceRetriever |
|
223 |
sendToOriginator |
|
224 |
ignoreMnemonicKeys |
|
225 |
ignoreShortcutKeys |
|
226 |
isMenuSlice |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
227 |
) |
1606 | 228 |
! ! |
229 |
||
230 |
!MenuEditor class methodsFor:'defaults'! |
|
231 |
||
232 |
aboutImage |
|
233 |
"the image to be displayed in my about-box; |
|
234 |
If nil is returned, the ST/X default image is used. |
|
235 |
" |
|
236 |
^ Image fromFile:'bitmaps/xpmBitmaps/misc_tools/setup_menus.xpm' |
|
237 |
! |
|
238 |
||
239 |
resourceType |
|
240 |
"get the type of the resource of the method generated by the MenuEditor |
|
241 |
" |
|
242 |
^ #menu |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
243 |
! ! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
244 |
|
371 | 245 |
!MenuEditor class methodsFor:'help specs'! |
246 |
||
1545 | 247 |
flyByHelpSpec |
1629 | 248 |
^super flyByHelpSpec addPairsFrom:(self localFlyHelpSpecStrings) |
1545 | 249 |
! |
250 |
||
371 | 251 |
helpSpec |
1690 | 252 |
"This resource specification was automatically generated |
253 |
by the UIHelpTool of ST/X." |
|
254 |
||
255 |
"Do not manually edit this!! If it is corrupted, |
|
256 |
the UIHelpTool may not be able to read the specification." |
|
257 |
||
258 |
" |
|
2188 | 259 |
UIHelpTool openOnClass:MenuEditor |
1690 | 260 |
" |
261 |
||
262 |
<resource: #help> |
|
263 |
||
264 |
^ super helpSpec addPairsFrom:#( |
|
265 |
||
266 |
#addDelayedMenu |
|
267 |
'Add a new delayed menu to item.' |
|
268 |
||
269 |
#addDelayedSubMenuLink |
|
270 |
'Add a new linked delayed menu to item.' |
|
271 |
||
272 |
#addMenuItem |
|
273 |
'Add a new menu item.' |
|
274 |
||
275 |
#addMenuSeparator |
|
276 |
'Add a new menu separator.' |
|
277 |
||
1844 | 278 |
#addMenuSliceItem |
279 |
'Add a new menu slice.' |
|
280 |
||
1690 | 281 |
#addSubMenu |
282 |
'Add a new sub menu.' |
|
283 |
||
284 |
#addSubMenuLink |
|
285 |
'Add a new linked sub menu.' |
|
286 |
||
287 |
#basicsAction |
|
288 |
'An action selector with 0, 1 (the argument field), or 2 (the selected item) arguments.' |
|
289 |
||
290 |
#basicsArgument |
|
291 |
'An optional arg passed with above selector, if it is a 1 or 2 arg selector (enter a Smalltalk literal).' |
|
292 |
||
293 |
#basicsChoice |
|
294 |
'Aspect for a boolean holder, block or method, specifying the choices state (RadioButton behavior).' |
|
295 |
||
296 |
#basicsChoiceValue |
|
297 |
'That choices value (typically number or symbol).' |
|
298 |
||
299 |
#basicsIndication |
|
300 |
'Aspect for boolean holder, block, or method, specifying the indication state (CheckToggle behavior).' |
|
301 |
||
302 |
#basicsIsButton |
|
303 |
'Button-like look and behavior.' |
|
304 |
||
305 |
#basicsKey |
|
306 |
'Internal key of the item (optional, for programmed accesses).' |
|
307 |
||
308 |
#basicsLabel |
|
309 |
'Label of the item.' |
|
310 |
||
311 |
#basicsMenu |
|
312 |
'Aspect providing the sub menu to be opened if item is selected (provide spec or valueHolder).' |
|
313 |
||
314 |
#basicsMenuArgument |
|
315 |
'An argument passed with the menu selector.' |
|
316 |
||
317 |
#basicsNameKey |
|
318 |
'Unique identifier of the item (optional).' |
|
319 |
||
320 |
#basicsSelector |
|
321 |
'Selector under which the generated menu spec is saved.' |
|
322 |
||
323 |
#basicsSeparatorType |
|
324 |
'List of valid separators.' |
|
325 |
||
326 |
#basicsTranslateLabel |
|
327 |
'Translate the label via the classes resource file (internationalization).' |
|
328 |
||
329 |
#browseResource |
|
330 |
'Search for methods with image resource.' |
|
331 |
||
332 |
#detailsAccelerator |
|
333 |
'Accelerator key to select the menu item from the keyboard (Cmdx or Ctrlx).' |
|
334 |
||
335 |
#detailsAccessCharaterPosition |
|
336 |
'Index of the access character position of the textual label (obsolete, VW compatibility).' |
|
337 |
||
338 |
#detailsAuxValue |
|
339 |
'Some additional value - for arbitrary use by the program.' |
|
340 |
||
341 |
#detailsEnabled |
|
1702 | 342 |
'Aspect or binding providing a boolean value holder to enable/disable the menu item.' |
1690 | 343 |
|
1844 | 344 |
#detailsIgnoreAcceleratorKeys |
345 |
'Ignore accelerator keys in submenu(s).' |
|
346 |
||
347 |
#detailsIgnoreMnemonicKeys |
|
348 |
'Ignore mnemonic keys (access characters) in submenu(s).' |
|
349 |
||
1690 | 350 |
#detailsStartGroup |
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
351 |
'Specify start of a specially aligned group.' |
1690 | 352 |
|
353 |
#detailsVisibility |
|
354 |
'Boolean, or aspect or binding for a boolean holder controlling the visibility of the menu item.' |
|
355 |
||
356 |
#fileLoad |
|
357 |
'Load a menu spec from a class.' |
|
358 |
||
359 |
#fileNew |
|
360 |
'Create a new menu spec.' |
|
361 |
||
362 |
#filePickAMenu |
|
363 |
'Select a menu from an open view and read its specification' |
|
364 |
||
365 |
#fileSave |
|
366 |
'Save the menu spec (and the help spec, if modified).' |
|
367 |
||
368 |
#fileSaveAs |
|
369 |
'Open a dialog to save the menu spec (and the help spec, if modified).' |
|
370 |
||
371 |
#fileShowMenuSpec |
|
372 |
'Opens a Workspace showing the current menu spec.' |
|
373 |
||
374 |
#generateAspectMethods |
|
375 |
'Generates aspect methods for defined aspect selectors of the menu.' |
|
376 |
||
377 |
#hideMenuOnActivated |
|
1702 | 378 |
'If on, the menu hides itself after the item was activated (PopUp/PullDown-Menus only).' |
1690 | 379 |
|
380 |
#horizontalLayout |
|
381 |
'If on, the submenu organizes its items horizontal insteat of vertical (default).' |
|
382 |
||
383 |
#imageImageAndLabel |
|
384 |
'Toggle display of both image and textual label.' |
|
385 |
||
386 |
#imageImageEditor |
|
387 |
'Open an Image Editor on the resource method defined by retriever and selector.' |
|
388 |
||
389 |
#imageImageList |
|
390 |
'Currently existing image resources.' |
|
391 |
||
392 |
#imageRetriever |
|
1702 | 393 |
'Class implementing the image resource method. If unspecified, the application class is taken.' |
1690 | 394 |
|
395 |
#imageSelector |
|
396 |
'Selector returning an image (sent to above or the application).' |
|
397 |
||
398 |
#keepLinkedMenu |
|
2055 | 399 |
'Keep the linked menu after activation (do not destroy; if off, menu is rebuild for every activation).' |
1690 | 400 |
|
401 |
#sendToOriginator |
|
1702 | 402 |
'Send action-Message to widget (instead of application); only valid for PopUpMenus.' |
1690 | 403 |
|
404 |
#settingsRedefineAspectMethods |
|
405 |
'Toggles the permission to overwrite existing aspect methods.' |
|
406 |
||
407 |
#showBusyCursorWhilePerforming |
|
408 |
'If on, a busy cursor is shown while the items action is performing.' |
|
409 |
||
410 |
#triggerOnDown |
|
1702 | 411 |
'If on, the items action is performed on mouse-button press (default is: on button-release).' |
1690 | 412 |
|
413 |
) |
|
2055 | 414 |
|
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
415 |
"Modified: / 16-10-2006 / 13:20:38 / cg" |
1606 | 416 |
! |
417 |
||
1629 | 418 |
localFlyHelpSpecStrings |
419 |
"This resource specification was automatically generated |
|
420 |
by the UIHelpTool of ST/X." |
|
421 |
||
422 |
"Do not manually edit this!! If it is corrupted, |
|
423 |
the UIHelpTool may not be able to read the specification." |
|
424 |
||
425 |
" |
|
2188 | 426 |
UIHelpTool openOnClass:MenuEditor |
1629 | 427 |
" |
428 |
||
429 |
<resource: #help> |
|
430 |
||
431 |
^ #( |
|
432 |
||
1820 | 433 |
#editCut |
434 |
'Cut Item' |
|
435 |
||
436 |
#editCopy |
|
437 |
'Copy Item' |
|
438 |
||
439 |
#editPaste |
|
440 |
'Paste Item' |
|
441 |
||
1629 | 442 |
#fileLoad |
1886 | 443 |
'Load Menuspec from Method' |
1629 | 444 |
|
445 |
#fileSave |
|
1886 | 446 |
'Save Menuspec as Method' |
1629 | 447 |
|
448 |
#fileSaveAs |
|
1886 | 449 |
'Save Menuspec as Method...' |
1629 | 450 |
|
451 |
#addMenuSeparator |
|
452 |
'Add Separator' |
|
453 |
||
454 |
#addMenuItem |
|
455 |
'Add Item' |
|
456 |
||
1891 | 457 |
#addMenuSlice |
458 |
'Add Menuslice' |
|
459 |
||
1629 | 460 |
#addSubMenu |
461 |
'Add Submenu' |
|
462 |
||
463 |
#addDelayedMenu |
|
464 |
'Add Delayed Menu' |
|
465 |
||
466 |
#addDelayedSubMenuLink |
|
1891 | 467 |
'Add Delayed Linked Menu' |
1629 | 468 |
|
469 |
#addSubMenuLink |
|
1656 | 470 |
'Add Linked Submenu' |
1629 | 471 |
|
472 |
#fileNew |
|
1886 | 473 |
'New Menuspec' |
1629 | 474 |
) |
371 | 475 |
! ! |
476 |
||
734 | 477 |
!MenuEditor class methodsFor:'image specs'! |
478 |
||
2156 | 479 |
defaultIcon |
480 |
<resource: #programImage> |
|
481 |
||
482 |
^ ToolbarIconLibrary startMenuEditorIcon |
|
483 |
! |
|
484 |
||
1606 | 485 |
iconUnknown |
486 |
"returns an image used for picked items containing an image |
|
734 | 487 |
" |
2271 | 488 |
<resource: #programImage> |
1606 | 489 |
|
490 |
^ MenuPanelSpec icon |
|
1425 | 491 |
! ! |
734 | 492 |
|
199 | 493 |
!MenuEditor class methodsFor:'interface specs'! |
494 |
||
525 | 495 |
windowSpec |
738 | 496 |
"This resource specification was automatically generated |
497 |
by the UIPainter of ST/X." |
|
498 |
||
499 |
"Do not manually edit this!! If it is corrupted, |
|
500 |
the UIPainter may not be able to read the specification." |
|
525 | 501 |
|
502 |
" |
|
503 |
UIPainter new openOnClass:MenuEditor andSelector:#windowSpec |
|
504 |
MenuEditor new openInterface:#windowSpec |
|
738 | 505 |
MenuEditor open |
525 | 506 |
" |
507 |
||
508 |
<resource: #canvas> |
|
509 |
||
2188 | 510 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
511 |
#(FullSpec |
2188 | 512 |
name: windowSpec |
513 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
514 |
(WindowSpec |
2188 | 515 |
label: 'Menu Editor' |
516 |
name: 'Menu Editor' |
|
517 |
min: (Point 550 385) |
|
518 |
bounds: (Rectangle 0 0 574 473) |
|
519 |
menu: menu |
|
520 |
icon: defaultIcon |
|
521 |
returnIsOKInDialog: false |
|
522 |
escapeIsCancelInDialog: false |
|
523 |
) |
|
524 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
525 |
(SpecCollection |
2188 | 526 |
collection: ( |
527 |
(MenuPanelSpec |
|
528 |
name: 'toolbar' |
|
529 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
530 |
tabable: true |
|
531 |
menu: toolbar |
|
532 |
showSeparatingLines: true |
|
533 |
) |
|
534 |
(VariableHorizontalPanelSpec |
|
535 |
name: 'mainPanel' |
|
536 |
layout: (LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
537 |
component: |
|
538 |
(SpecCollection |
|
539 |
collection: ( |
|
540 |
(HierarchicalListViewSpec |
|
541 |
name: 'ListOfItemsView' |
|
542 |
model: selectionHolder |
|
543 |
menu: editMenu |
|
544 |
hasHorizontalScrollBar: true |
|
545 |
hasVerticalScrollBar: true |
|
546 |
miniScrollerHorizontal: true |
|
547 |
miniScrollerVertical: true |
|
548 |
listModel: listOfItems |
|
549 |
multipleSelectOk: true |
|
550 |
useIndex: false |
|
551 |
highlightMode: label |
|
552 |
doubleClickSelector: indicatorClickedAt: |
|
553 |
selectConditionSelector: canSelect: |
|
554 |
showLeftIndicators: false |
|
555 |
indicatorSelector: indicatorClickedAt: |
|
556 |
properties: |
|
557 |
(PropertyListDictionary |
|
558 |
dropSelector: doDrop: |
|
559 |
dragArgument: nil |
|
560 |
dropObjectSelector: dropObjects |
|
561 |
overSelector: dropOver: |
|
562 |
dropArgument: nil |
|
563 |
leaveSelector: dropLeave: |
|
564 |
canDropSelector: canDrop: |
|
565 |
enterSelector: dropEnter: |
|
566 |
) |
|
567 |
postBuildCallback: postBuildListOfItemsView: |
|
568 |
) |
|
569 |
(ViewSpec |
|
570 |
name: 'Box' |
|
571 |
level: -1 |
|
572 |
component: |
|
573 |
(SpecCollection |
|
574 |
collection: ( |
|
575 |
(NoteBookViewSpec |
|
576 |
name: 'NoteBook' |
|
577 |
layout: (LayoutFrame 1 0.0 0 0.0 1 1.0 -30 1.0) |
|
578 |
enableChannel: hasSingleSelectionChannel |
|
579 |
tabable: true |
|
580 |
model: tabHolder |
|
581 |
menu: listOfTabs |
|
582 |
fitLastRow: false |
|
583 |
translateLabel: true |
|
584 |
canvas: wizardHolder |
|
585 |
keepCanvasAlive: true |
|
586 |
postBuildCallback: postBuildNoteBook: |
|
587 |
) |
|
588 |
(UISubSpecification |
|
589 |
name: 'SubSpecification' |
|
590 |
layout: (LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
|
591 |
majorKey: ToolApplicationModel |
|
592 |
minorKey: windowSpecForCommit |
|
593 |
) |
|
594 |
) |
|
595 |
||
596 |
) |
|
597 |
) |
|
598 |
) |
|
599 |
||
600 |
) |
|
601 |
handles: (Any 0.300493 1.0) |
|
602 |
) |
|
603 |
(UISubSpecification |
|
604 |
name: 'infoBarSubSpec' |
|
605 |
layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
606 |
majorKey: ToolApplicationModel |
|
607 |
minorKey: windowSpecForInfoBar |
|
608 |
) |
|
609 |
) |
|
610 |
||
611 |
) |
|
525 | 612 |
) |
613 |
! ! |
|
614 |
||
615 |
!MenuEditor class methodsFor:'menu specs'! |
|
616 |
||
1606 | 617 |
addMenu |
618 |
"This resource specification was automatically generated |
|
619 |
by the MenuEditor of ST/X." |
|
620 |
||
621 |
"Do not manually edit this!! If it is corrupted, |
|
622 |
the MenuEditor may not be able to read the specification." |
|
623 |
||
624 |
" |
|
625 |
MenuEditor new openOnClass:MenuEditor andSelector:#addMenu |
|
626 |
(Menu new fromLiteralArrayEncoding:(MenuEditor addMenu)) startUp |
|
627 |
" |
|
628 |
||
629 |
<resource: #menu> |
|
630 |
||
2188 | 631 |
^ |
1844 | 632 |
#(Menu |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
633 |
( |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
634 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
635 |
activeHelpKey: addMenuSeparator |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
636 |
label: 'Separator' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
637 |
itemValue: doCreateSep |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
638 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
639 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
640 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
641 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
642 |
activeHelpKey: addMenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
643 |
label: 'Item' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
644 |
itemValue: doCreateItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
645 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
646 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
647 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
648 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
649 |
activeHelpKey: addMenuSliceItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
650 |
label: 'Menu Slice' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
651 |
itemValue: doCreateMenuSliceItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
652 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
653 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
654 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
655 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
656 |
activeHelpKey: addMenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
657 |
label: 'Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
658 |
itemValue: doCreateMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
659 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
660 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
661 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
662 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
663 |
activeHelpKey: addSubMenuLink |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
664 |
label: 'Linked Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
665 |
itemValue: doCreateLinkedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
666 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
667 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
668 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
669 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
670 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
671 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
672 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
673 |
activeHelpKey: addDelayedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
674 |
enabled: canCreateDelayedMenuChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
675 |
label: 'Delayed Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
676 |
itemValue: doCreateDelayedMenu: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
677 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
678 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
679 |
argument: menu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
680 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
681 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
682 |
activeHelpKey: addDelayedSubMenuLink |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
683 |
enabled: canCreateDelayedMenuChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
684 |
label: 'Delayed Linked Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
685 |
itemValue: doCreateDelayedMenu: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
686 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
687 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
688 |
argument: linkedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
689 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
690 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
691 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
692 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
693 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
694 |
label: 'Standard Menus' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
695 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
696 |
submenuChannel: standardMenus |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
697 |
keepLinkedMenu: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
698 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
699 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
700 |
"/ nil |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
701 |
"/ nil |
1606 | 702 |
) |
703 |
! |
|
704 |
||
705 |
editMenu |
|
706 |
"This resource specification was automatically generated |
|
707 |
by the MenuEditor of ST/X." |
|
708 |
||
709 |
"Do not manually edit this!! If it is corrupted, |
|
710 |
the MenuEditor may not be able to read the specification." |
|
711 |
||
712 |
" |
|
713 |
MenuEditor new openOnClass:MenuEditor andSelector:#editMenu |
|
714 |
(Menu new fromLiteralArrayEncoding:(MenuEditor editMenu)) startUp |
|
715 |
" |
|
716 |
||
717 |
<resource: #menu> |
|
718 |
||
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
719 |
^ |
2186 | 720 |
#(Menu |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
721 |
( |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
722 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
723 |
activeHelpKey: editCut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
724 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
725 |
label: 'Cut' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
726 |
itemValue: doCut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
727 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
728 |
shortcutKey: Cut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
729 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
730 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
731 |
activeHelpKey: editCopy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
732 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
733 |
label: 'Copy' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
734 |
itemValue: doCopy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
735 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
736 |
shortcutKey: Copy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
737 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
738 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
739 |
activeHelpKey: editPaste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
740 |
enabled: canPasteHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
741 |
label: 'Paste' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
742 |
itemValue: doPaste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
743 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
744 |
shortcutKey: Paste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
745 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
746 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
747 |
activeHelpKey: editDelete |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
748 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
749 |
label: 'Delete' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
750 |
itemValue: doDelete |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
751 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
752 |
isVisible: false |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
753 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
754 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
755 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
756 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
757 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
758 |
activeHelpKey: editMoveUp |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
759 |
enabled: enableMovingUpOrDownHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
760 |
label: 'Move Up' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
761 |
itemValue: doMoveUpOrDown: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
762 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
763 |
startGroup: right |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
764 |
shortcutKey: CtrlCursorUp |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
765 |
labelImage: (ResourceRetriever Icon upIcon 'Move Up') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
766 |
argument: up |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
767 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
768 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
769 |
activeHelpKey: editMoveDown |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
770 |
enabled: enableMovingUpOrDownHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
771 |
label: 'Move Down' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
772 |
itemValue: doMoveUpOrDown: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
773 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
774 |
shortcutKey: CtrlCursorDown |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
775 |
labelImage: (ResourceRetriever Icon downIcon 'Move Down') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
776 |
argument: down |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
777 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
778 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
779 |
activeHelpKey: editMoveIn |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
780 |
enabled: enableMovingInHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
781 |
label: 'Move Into Next' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
782 |
itemValue: doMoveIn: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
783 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
784 |
shortcutKey: CtrlCursorRight |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
785 |
labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
786 |
argument: inNext |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
787 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
788 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
789 |
activeHelpKey: editMoveInAbove |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
790 |
enabled: enableMovingInAboveHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
791 |
label: 'Move Into Previous' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
792 |
itemValue: doMoveIn: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
793 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
794 |
labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous' ) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
795 |
argument: inPrev |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
796 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
797 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
798 |
activeHelpKey: editMoveOut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
799 |
enabled: enableMovingOutHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
800 |
label: 'Move Out' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
801 |
itemValue: doMoveOut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
802 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
803 |
shortcutKey: CtrlCursorLeft |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
804 |
labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out' ) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
805 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
806 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
807 |
nil |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
808 |
nil |
1606 | 809 |
) |
810 |
! |
|
811 |
||
2187 | 812 |
editMenuForMainMenuWithoutAccelerators |
813 |
"This resource specification was automatically generated |
|
814 |
by the MenuEditor of ST/X." |
|
815 |
||
816 |
"Do not manually edit this!! If it is corrupted, |
|
817 |
the MenuEditor may not be able to read the specification." |
|
818 |
||
819 |
" |
|
820 |
MenuEditor new openOnClass:MenuEditor andSelector:#editMenuForMainMenuWithoutAccelerators |
|
821 |
(Menu new fromLiteralArrayEncoding:(MenuEditor editMenuForMainMenuWithoutAccelerators)) startUp |
|
822 |
" |
|
823 |
||
824 |
<resource: #menu> |
|
825 |
||
2188 | 826 |
^ |
2187 | 827 |
#(Menu |
2188 | 828 |
( |
829 |
(MenuItem |
|
830 |
activeHelpKey: editCut |
|
831 |
enabled: hasSelectionChannel |
|
832 |
label: 'Cut' |
|
833 |
itemValue: doCut |
|
834 |
translateLabel: true |
|
835 |
) |
|
836 |
(MenuItem |
|
837 |
activeHelpKey: editCopy |
|
838 |
enabled: hasSelectionChannel |
|
839 |
label: 'Copy' |
|
840 |
itemValue: doCopy |
|
841 |
translateLabel: true |
|
842 |
) |
|
843 |
(MenuItem |
|
844 |
activeHelpKey: editPaste |
|
845 |
enabled: canPasteHolder |
|
846 |
label: 'Paste' |
|
847 |
itemValue: doPaste |
|
848 |
translateLabel: true |
|
849 |
) |
|
850 |
(MenuItem |
|
851 |
activeHelpKey: editDelete |
|
852 |
enabled: hasSelectionChannel |
|
853 |
label: 'Delete' |
|
854 |
itemValue: doDelete |
|
855 |
translateLabel: true |
|
856 |
isVisible: false |
|
857 |
) |
|
858 |
(MenuItem |
|
859 |
label: '-' |
|
860 |
) |
|
861 |
(MenuItem |
|
862 |
activeHelpKey: editMoveUp |
|
863 |
enabled: enableMovingUpOrDownHolder |
|
864 |
label: 'Move Up' |
|
865 |
itemValue: doMoveUpOrDown: |
|
866 |
translateLabel: true |
|
867 |
startGroup: right |
|
868 |
labelImage: (ResourceRetriever Icon upIcon 'Move Up') |
|
869 |
argument: up |
|
870 |
) |
|
871 |
(MenuItem |
|
872 |
activeHelpKey: editMoveDown |
|
873 |
enabled: enableMovingUpOrDownHolder |
|
874 |
label: 'Move Down' |
|
875 |
itemValue: doMoveUpOrDown: |
|
876 |
translateLabel: true |
|
877 |
labelImage: (ResourceRetriever Icon downIcon 'Move Down') |
|
878 |
argument: down |
|
879 |
) |
|
880 |
(MenuItem |
|
881 |
activeHelpKey: editMoveIn |
|
882 |
enabled: enableMovingInHolder |
|
883 |
label: 'Move Into Next' |
|
884 |
itemValue: doMoveIn: |
|
885 |
translateLabel: true |
|
886 |
labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next') |
|
887 |
argument: inNext |
|
888 |
) |
|
889 |
(MenuItem |
|
890 |
activeHelpKey: editMoveInAbove |
|
891 |
enabled: enableMovingInAboveHolder |
|
892 |
label: 'Move Into Previous' |
|
893 |
itemValue: doMoveIn: |
|
894 |
translateLabel: true |
|
895 |
labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous') |
|
896 |
argument: inPrev |
|
897 |
) |
|
898 |
(MenuItem |
|
899 |
activeHelpKey: editMoveOut |
|
900 |
enabled: enableMovingOutHolder |
|
901 |
label: 'Move Out' |
|
902 |
itemValue: doMoveOut |
|
903 |
translateLabel: true |
|
904 |
labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out') |
|
905 |
) |
|
906 |
) |
|
907 |
nil |
|
908 |
nil |
|
2187 | 909 |
) |
910 |
! |
|
911 |
||
1606 | 912 |
fileMenu |
913 |
"This resource specification was automatically generated |
|
914 |
by the MenuEditor of ST/X." |
|
915 |
||
916 |
"Do not manually edit this!! If it is corrupted, |
|
917 |
the MenuEditor may not be able to read the specification." |
|
918 |
||
919 |
" |
|
920 |
MenuEditor new openOnClass:MenuEditor andSelector:#fileMenu |
|
921 |
(Menu new fromLiteralArrayEncoding:(MenuEditor fileMenu)) startUp |
|
922 |
" |
|
923 |
||
924 |
<resource: #menu> |
|
925 |
||
2188 | 926 |
^ |
1971 | 927 |
#(Menu |
2188 | 928 |
( |
929 |
(MenuItem |
|
930 |
activeHelpKey: fileNew |
|
931 |
label: 'New' |
|
932 |
itemValue: doNew |
|
933 |
translateLabel: true |
|
934 |
) |
|
935 |
(MenuItem |
|
936 |
label: '-' |
|
937 |
) |
|
938 |
(MenuItem |
|
939 |
activeHelpKey: fileLoad |
|
940 |
label: 'Load...' |
|
941 |
itemValue: doLoad |
|
942 |
translateLabel: true |
|
943 |
) |
|
944 |
(MenuItem |
|
945 |
label: '-' |
|
946 |
) |
|
947 |
(MenuItem |
|
948 |
activeHelpKey: fileSave |
|
949 |
label: 'Save' |
|
950 |
itemValue: doSave |
|
951 |
translateLabel: true |
|
952 |
) |
|
953 |
(MenuItem |
|
954 |
activeHelpKey: fileSaveAs |
|
955 |
label: 'Save As...' |
|
956 |
itemValue: doSaveAs |
|
957 |
translateLabel: true |
|
958 |
) |
|
959 |
(MenuItem |
|
960 |
label: '-' |
|
961 |
) |
|
962 |
(MenuItem |
|
963 |
activeHelpKey: filePickAMenu |
|
964 |
label: 'Pick a Menu...' |
|
965 |
itemValue: doPickAMenu |
|
966 |
translateLabel: true |
|
967 |
) |
|
968 |
(MenuItem |
|
969 |
label: '-' |
|
970 |
isVisible: isStandAlone |
|
971 |
) |
|
972 |
(MenuItem |
|
973 |
activeHelpKey: fileBrowseClass |
|
974 |
enabled: hasValidSpecClass |
|
975 |
label: 'Browse Class' |
|
976 |
itemValue: doBrowseClass |
|
977 |
translateLabel: true |
|
978 |
isVisible: isStandAlone |
|
979 |
) |
|
980 |
(MenuItem |
|
981 |
activeHelpKey: fileShowMenuSpec |
|
982 |
label: 'Show Menu Spec' |
|
983 |
itemValue: doShowMenuSpec |
|
984 |
translateLabel: true |
|
985 |
isVisible: isStandAlone |
|
986 |
) |
|
987 |
(MenuItem |
|
988 |
label: '-' |
|
989 |
isVisible: isStandAlone |
|
990 |
) |
|
991 |
(MenuItem |
|
992 |
activeHelpKey: fileExit |
|
993 |
label: 'Exit' |
|
994 |
itemValue: closeRequest |
|
995 |
translateLabel: true |
|
996 |
isVisible: isStandAlone |
|
997 |
) |
|
998 |
) |
|
999 |
nil |
|
1000 |
nil |
|
1606 | 1001 |
) |
1002 |
! |
|
1003 |
||
1614 | 1004 |
generateMenu |
1005 |
"This resource specification was automatically generated |
|
1006 |
by the MenuEditor of ST/X." |
|
1007 |
||
1008 |
"Do not manually edit this!! If it is corrupted, |
|
1009 |
the MenuEditor may not be able to read the specification." |
|
1010 |
||
1011 |
" |
|
1012 |
MenuEditor new openOnClass:MenuEditor andSelector:#generateMenu |
|
1013 |
(Menu new fromLiteralArrayEncoding:(MenuEditor generateMenu)) startUp |
|
1014 |
" |
|
1015 |
||
1016 |
<resource: #menu> |
|
1017 |
||
2188 | 1018 |
^ |
1614 | 1019 |
#(#Menu |
2188 | 1020 |
#( |
1021 |
#(#MenuItem |
|
1022 |
#activeHelpKey: #generateAspectMethods |
|
1023 |
#enabled: #hasValidSpecClass |
|
1024 |
#label: 'Aspect Methods' |
|
1025 |
#itemValue: #doGenerateAspectMethods |
|
1026 |
#translateLabel: true |
|
1027 |
) |
|
1028 |
) |
|
1029 |
nil |
|
1030 |
nil |
|
1614 | 1031 |
) |
1032 |
! |
|
1033 |
||
1606 | 1034 |
helpMenu |
1035 |
"This resource specification was automatically generated |
|
1036 |
by the MenuEditor of ST/X." |
|
1037 |
||
1038 |
"Do not manually edit this!! If it is corrupted, |
|
1039 |
the MenuEditor may not be able to read the specification." |
|
1040 |
||
1041 |
" |
|
1042 |
MenuEditor new openOnClass:MenuEditor andSelector:#helpMenu |
|
1043 |
(Menu new fromLiteralArrayEncoding:(MenuEditor helpMenu)) startUp |
|
1044 |
" |
|
1045 |
||
1046 |
<resource: #menu> |
|
1047 |
||
2188 | 1048 |
^ |
1606 | 1049 |
#(#Menu |
2188 | 1050 |
#( |
1051 |
#(#MenuItem |
|
1052 |
#activeHelpKey: #helpTutorial |
|
1053 |
#label: 'Documentation' |
|
1054 |
#itemValue: #openHTMLDocument: |
|
1055 |
#translateLabel: true |
|
1056 |
#argument: 'tools/uipainter/MenuEditor.html' |
|
1057 |
) |
|
1058 |
#(#MenuItem |
|
1059 |
#label: '-' |
|
1060 |
) |
|
1061 |
#(#MenuItem |
|
1062 |
#activeHelpKey: #helpHelpTool |
|
1063 |
#label: 'Help Tool' |
|
1064 |
#itemValue: #openHTMLDocument: |
|
1065 |
#translateLabel: true |
|
1066 |
#argument: 'tools/uipainter/HelpTool.html' |
|
1067 |
) |
|
1068 |
#(#MenuItem |
|
1069 |
#label: '-' |
|
1070 |
) |
|
1071 |
#(#MenuItem |
|
1072 |
#activeHelpKey: #helpShowHelp |
|
1073 |
#label: 'Show Help Texts' |
|
1074 |
#translateLabel: true |
|
1075 |
#indication: #showingHelp: |
|
1076 |
) |
|
1077 |
#(#MenuItem |
|
1078 |
#label: '-' |
|
1079 |
) |
|
1080 |
#(#MenuItem |
|
1081 |
#activeHelpKey: #aboutThisAppliaction |
|
1082 |
#label: 'About MenuEditor...' |
|
1083 |
#itemValue: #openAboutThisApplication |
|
1084 |
#translateLabel: true |
|
1085 |
) |
|
1086 |
) |
|
1087 |
nil |
|
1088 |
nil |
|
1606 | 1089 |
) |
1090 |
! |
|
1091 |
||
525 | 1092 |
menu |
738 | 1093 |
"This resource specification was automatically generated |
1094 |
by the MenuEditor of ST/X." |
|
1095 |
||
1096 |
"Do not manually edit this!! If it is corrupted, |
|
1097 |
the MenuEditor may not be able to read the specification." |
|
525 | 1098 |
|
1099 |
" |
|
1100 |
MenuEditor new openOnClass:MenuEditor andSelector:#menu |
|
1101 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menu)) startUp |
|
1102 |
" |
|
1103 |
||
1104 |
<resource: #menu> |
|
1105 |
||
2188 | 1106 |
^ |
1775 | 1107 |
#(Menu |
2188 | 1108 |
( |
1109 |
(MenuItem |
|
1110 |
label: '&File' |
|
1111 |
translateLabel: true |
|
1112 |
submenuChannel: fileMenu |
|
1113 |
keepLinkedMenu: true |
|
1114 |
) |
|
1115 |
(MenuItem |
|
1116 |
label: '&Edit' |
|
1117 |
translateLabel: true |
|
1118 |
submenuChannel: editMenuForMainMenuWithoutAccelerators |
|
1119 |
keepLinkedMenu: true |
|
1120 |
) |
|
1121 |
(MenuItem |
|
1122 |
enabled: hasSingleSelectionChannel |
|
1123 |
label: 'Item' |
|
1124 |
translateLabel: true |
|
1125 |
submenuChannel: addMenu |
|
1126 |
keepLinkedMenu: true |
|
1127 |
) |
|
1128 |
(MenuItem |
|
1129 |
label: 'Generate' |
|
1130 |
translateLabel: true |
|
1131 |
submenuChannel: generateMenu |
|
1132 |
keepLinkedMenu: true |
|
1133 |
) |
|
1134 |
(MenuItem |
|
1135 |
label: 'Test' |
|
1136 |
translateLabel: true |
|
1137 |
submenuChannel: submenuTest |
|
1138 |
) |
|
1139 |
(MenuItem |
|
1140 |
label: 'Settings' |
|
1141 |
translateLabel: true |
|
1142 |
submenuChannel: settingsMenu |
|
1143 |
keepLinkedMenu: true |
|
1144 |
) |
|
1145 |
(MenuItem |
|
1146 |
label: 'History' |
|
1147 |
translateLabel: true |
|
1148 |
isVisible: isStandAlone |
|
1149 |
submenuChannel: menuHistory |
|
1150 |
) |
|
1151 |
(MenuItem |
|
1152 |
label: 'MENU_Help' |
|
1153 |
translateLabel: true |
|
1154 |
startGroup: conditionalRight |
|
1155 |
submenuChannel: helpMenu |
|
1156 |
keepLinkedMenu: true |
|
1157 |
) |
|
1158 |
) |
|
1159 |
nil |
|
1160 |
nil |
|
525 | 1161 |
) |
1162 |
! |
|
1163 |
||
1631 | 1164 |
settingsMenu |
1165 |
"This resource specification was automatically generated |
|
1166 |
by the MenuEditor of ST/X." |
|
1167 |
||
1168 |
"Do not manually edit this!! If it is corrupted, |
|
1169 |
the MenuEditor may not be able to read the specification." |
|
1170 |
||
1171 |
" |
|
1632 | 1172 |
MenuEditor new openOnClass:MenuEditor andSelector:#settingsMenu |
1173 |
(Menu new fromLiteralArrayEncoding:(MenuEditor settingsMenu)) startUp |
|
1631 | 1174 |
" |
1175 |
||
1176 |
<resource: #menu> |
|
1177 |
||
2188 | 1178 |
^ |
1631 | 1179 |
#(#Menu |
2188 | 1180 |
#( |
1181 |
#(#MenuItem |
|
1182 |
#activeHelpKey: #settingsRedefineAspectMethods |
|
1183 |
#enabled: #hasValidSpecClass |
|
1184 |
#label: 'Redefine Aspect Methods' |
|
1185 |
#translateLabel: true |
|
1186 |
#hideMenuOnActivated: false |
|
1187 |
#indication: #redefineAspectMethodsChannel |
|
1188 |
) |
|
1189 |
#(#MenuItem |
|
1190 |
#activeHelpKey: #settingsRedefineAspectMethods |
|
1191 |
#label: 'AutoAccept on Selection-Change' |
|
1192 |
#translateLabel: true |
|
1193 |
#hideMenuOnActivated: false |
|
1194 |
#indication: #autoAcceptOnSelectionChange |
|
1195 |
) |
|
1196 |
) |
|
1197 |
nil |
|
1198 |
nil |
|
1631 | 1199 |
) |
1200 |
! |
|
1201 |
||
1606 | 1202 |
standardMenus |
738 | 1203 |
"This resource specification was automatically generated |
1204 |
by the MenuEditor of ST/X." |
|
1205 |
||
1206 |
"Do not manually edit this!! If it is corrupted, |
|
1207 |
the MenuEditor may not be able to read the specification." |
|
525 | 1208 |
|
1209 |
" |
|
1606 | 1210 |
MenuEditor new openOnClass:MenuEditor andSelector:#standardMenus |
1211 |
(Menu new fromLiteralArrayEncoding:(MenuEditor standardMenus)) startUp |
|
525 | 1212 |
" |
1213 |
||
1214 |
<resource: #menu> |
|
1215 |
||
2188 | 1216 |
^ |
1606 | 1217 |
#(#Menu |
2188 | 1218 |
#( |
1219 |
#(#MenuItem |
|
1220 |
#label: 'Standard Menu: File' |
|
1221 |
#itemValue: #doCreateStandardFileMenu |
|
1222 |
#translateLabel: true |
|
1223 |
) |
|
1224 |
#(#MenuItem |
|
1225 |
#label: 'Standard Menu: Edit' |
|
1226 |
#itemValue: #doCreateStandardEditMenu |
|
1227 |
#translateLabel: true |
|
1228 |
) |
|
1229 |
#(#MenuItem |
|
1230 |
#label: 'Standard Menu: Help' |
|
1231 |
#itemValue: #doCreateStandardHelpMenu |
|
1232 |
#translateLabel: true |
|
1233 |
) |
|
1234 |
) |
|
1235 |
nil |
|
1236 |
nil |
|
525 | 1237 |
) |
1238 |
! |
|
1239 |
||
1606 | 1240 |
toolbar |
738 | 1241 |
"This resource specification was automatically generated |
1242 |
by the MenuEditor of ST/X." |
|
1243 |
||
1244 |
"Do not manually edit this!! If it is corrupted, |
|
1245 |
the MenuEditor may not be able to read the specification." |
|
525 | 1246 |
|
1247 |
" |
|
1606 | 1248 |
MenuEditor new openOnClass:MenuEditor andSelector:#toolbar |
1249 |
(Menu new fromLiteralArrayEncoding:(MenuEditor toolbar)) startUp |
|
525 | 1250 |
" |
1251 |
||
1252 |
<resource: #menu> |
|
1253 |
||
2188 | 1254 |
^ |
1749 | 1255 |
#(Menu |
2188 | 1256 |
( |
1257 |
(MenuItem |
|
1258 |
activeHelpKey: fileNew |
|
1259 |
label: 'New' |
|
1260 |
itemValue: doNew |
|
1261 |
translateLabel: true |
|
1262 |
isButton: true |
|
1263 |
labelImage: (ResourceRetriever ToolbarIconLibrary newMenuIcon) |
|
1264 |
) |
|
1265 |
(MenuItem |
|
1266 |
label: '-' |
|
1267 |
) |
|
1268 |
(MenuItem |
|
1269 |
activeHelpKey: fileLoad |
|
1270 |
label: 'Load' |
|
1271 |
itemValue: doLoad |
|
1272 |
translateLabel: true |
|
1273 |
isButton: true |
|
1274 |
submenuChannel: menuHistory |
|
1275 |
labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon) |
|
1276 |
keepLinkedMenu: true |
|
1277 |
) |
|
1278 |
(MenuItem |
|
1279 |
activeHelpKey: fileSave |
|
1280 |
label: 'Save' |
|
1281 |
itemValue: doSave |
|
1282 |
translateLabel: true |
|
1283 |
isButton: true |
|
1284 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon) |
|
1285 |
) |
|
1286 |
(MenuItem |
|
1287 |
label: '-' |
|
1288 |
) |
|
1289 |
(MenuItem |
|
1290 |
activeHelpKey: editCut |
|
1291 |
enabled: hasSelectionChannel |
|
1292 |
label: 'Cut' |
|
1293 |
itemValue: doCut |
|
1294 |
translateLabel: true |
|
1295 |
isButton: true |
|
1296 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutMenuItemIcon) |
|
1297 |
) |
|
1298 |
(MenuItem |
|
1299 |
activeHelpKey: editCopy |
|
1300 |
enabled: hasSelectionChannel |
|
1301 |
label: 'Copy' |
|
1302 |
itemValue: doCopy |
|
1303 |
translateLabel: true |
|
1304 |
isButton: true |
|
1305 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyMenuItemIcon) |
|
1306 |
) |
|
1307 |
(MenuItem |
|
1308 |
activeHelpKey: editPaste |
|
1309 |
enabled: canPasteHolder |
|
1310 |
label: 'Paste' |
|
1311 |
itemValue: doPaste |
|
1312 |
translateLabel: true |
|
1313 |
isButton: true |
|
1314 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteMenuItemIcon) |
|
1315 |
) |
|
1316 |
(MenuItem |
|
1317 |
label: '-' |
|
1318 |
) |
|
1319 |
(MenuItem |
|
1320 |
activeHelpKey: addMenuItem |
|
1321 |
enabled: hasSingleSelectionChannel |
|
1322 |
label: 'Add Item' |
|
1323 |
itemValue: doCreateItem |
|
1324 |
translateLabel: true |
|
1325 |
isButton: true |
|
1326 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem) |
|
1327 |
) |
|
1328 |
(MenuItem |
|
1329 |
activeHelpKey: addMenuSeparator |
|
1330 |
enabled: hasSingleSelectionChannel |
|
1331 |
label: 'Add Separator' |
|
1332 |
itemValue: doCreateSep |
|
1333 |
translateLabel: true |
|
1334 |
isButton: true |
|
1335 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator) |
|
1336 |
) |
|
1337 |
(MenuItem |
|
1338 |
activeHelpKey: addMenuSlice |
|
1339 |
enabled: hasSingleSelectionChannel |
|
1340 |
label: 'Menu Slice' |
|
1341 |
itemValue: doCreateMenuSliceItem |
|
1342 |
translateLabel: true |
|
1343 |
isButton: true |
|
1344 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu) |
|
1345 |
) |
|
1346 |
(MenuItem |
|
1347 |
activeHelpKey: addSubMenu |
|
1348 |
enabled: hasSingleSelectionChannel |
|
1349 |
label: 'Add Menu' |
|
1350 |
itemValue: doCreateMenu |
|
1351 |
translateLabel: true |
|
1352 |
isButton: true |
|
1353 |
submenuChannel: standardMenus |
|
1354 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu) |
|
1355 |
keepLinkedMenu: true |
|
1356 |
) |
|
1357 |
(MenuItem |
|
1358 |
activeHelpKey: addSubMenuLink |
|
1359 |
enabled: hasSingleSelectionChannel |
|
1360 |
label: 'Add Linked Menu' |
|
1361 |
itemValue: doCreateLinkedMenu |
|
1362 |
translateLabel: true |
|
1363 |
isButton: true |
|
1364 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu) |
|
1365 |
) |
|
1366 |
(MenuItem |
|
1367 |
activeHelpKey: addDelayedMenu |
|
1368 |
enabled: canCreateDelayedMenuChannel |
|
1369 |
label: 'Add Delayed Menu' |
|
1370 |
itemValue: doCreateDelayedMenu: |
|
1371 |
translateLabel: true |
|
1372 |
isButton: true |
|
1373 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu) |
|
1374 |
argument: menu |
|
1375 |
) |
|
1376 |
(MenuItem |
|
1377 |
activeHelpKey: addDelayedSubMenuLink |
|
1378 |
enabled: canCreateDelayedMenuChannel |
|
1379 |
label: 'Add Delayed Linked Menu' |
|
1380 |
itemValue: doCreateDelayedMenu: |
|
1381 |
translateLabel: true |
|
1382 |
isButton: true |
|
1383 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu) |
|
1384 |
argument: linkedMenu |
|
1385 |
) |
|
1386 |
(MenuItem |
|
1387 |
label: '' |
|
1388 |
) |
|
1389 |
(MenuItem |
|
1390 |
activeHelpKey: editMoveUp |
|
1391 |
enabled: enableMovingUpOrDownHolder |
|
1392 |
label: 'Move Up' |
|
1393 |
itemValue: doMoveUp |
|
1394 |
translateLabel: true |
|
1395 |
isButton: true |
|
1396 |
startGroup: right |
|
1397 |
labelImage: (ResourceRetriever Icon upIcon) |
|
1398 |
) |
|
1399 |
(MenuItem |
|
1400 |
activeHelpKey: editMoveDown |
|
1401 |
enabled: enableMovingUpOrDownHolder |
|
1402 |
label: 'Move Down' |
|
1403 |
itemValue: doMoveDown |
|
1404 |
translateLabel: true |
|
1405 |
isButton: true |
|
1406 |
labelImage: (ResourceRetriever Icon downIcon) |
|
1407 |
) |
|
1408 |
(MenuItem |
|
1409 |
activeHelpKey: editMoveIn |
|
1410 |
enabled: enableMovingInHolder |
|
1411 |
label: 'Move Into Next' |
|
1412 |
itemValue: doMoveInNext |
|
1413 |
translateLabel: true |
|
1414 |
isButton: true |
|
1415 |
labelImage: (ResourceRetriever Icon downRightIcon) |
|
1416 |
) |
|
1417 |
(MenuItem |
|
1418 |
activeHelpKey: editMoveInAbove |
|
1419 |
enabled: enableMovingInAboveHolder |
|
1420 |
label: 'Move Into Previous' |
|
1421 |
itemValue: doMoveInPrevious |
|
1422 |
translateLabel: true |
|
1423 |
isButton: true |
|
1424 |
labelImage: (ResourceRetriever Icon upRightIcon) |
|
1425 |
) |
|
1426 |
(MenuItem |
|
1427 |
activeHelpKey: editMoveOut |
|
1428 |
enabled: enableMovingOutHolder |
|
1429 |
label: 'Move Out' |
|
1430 |
itemValue: doMoveOut |
|
1431 |
translateLabel: true |
|
1432 |
isButton: true |
|
1433 |
labelImage: (ResourceRetriever Icon leftDownIcon) |
|
1434 |
) |
|
1435 |
) |
|
1436 |
nil |
|
1437 |
nil |
|
525 | 1438 |
) |
1439 |
! ! |
|
1440 |
||
1725 | 1441 |
!MenuEditor class methodsFor:'menu specs-standard'! |
1606 | 1442 |
|
1443 |
standardEditMenu |
|
1444 |
"This resource specification was automatically generated |
|
1445 |
by the MenuEditor of ST/X." |
|
1446 |
||
1447 |
"Do not manually edit this!! If it is corrupted, |
|
1448 |
the MenuEditor may not be able to read the specification." |
|
1449 |
||
1450 |
" |
|
1451 |
MenuEditor new openOnClass:MenuEditor andSelector:#standardEditMenu |
|
1452 |
(Menu new fromLiteralArrayEncoding:(MenuEditor standardEditMenu)) startUp |
|
1453 |
" |
|
1454 |
||
1455 |
<resource: #menu> |
|
1456 |
||
2188 | 1457 |
^ |
1606 | 1458 |
#(#Menu |
2188 | 1459 |
#( |
1460 |
#(#MenuItem |
|
1461 |
#label: 'Cut' |
|
1462 |
#translateLabel: true |
|
1463 |
#value: #cutSelection |
|
1464 |
) |
|
1465 |
#(#MenuItem |
|
1466 |
#label: 'Copy' |
|
1467 |
#translateLabel: true |
|
1468 |
#value: #copySelection |
|
1469 |
) |
|
1470 |
#(#MenuItem |
|
1471 |
#label: 'Paste' |
|
1472 |
#translateLabel: true |
|
1473 |
#value: #paste |
|
1474 |
) |
|
1475 |
) |
|
1476 |
nil |
|
1477 |
nil |
|
525 | 1478 |
) |
1479 |
! |
|
1480 |
||
1606 | 1481 |
standardFileMenu |
1482 |
"This resource specification was automatically generated |
|
1483 |
by the MenuEditor of ST/X." |
|
1484 |
||
1485 |
"Do not manually edit this!! If it is corrupted, |
|
1486 |
the MenuEditor may not be able to read the specification." |
|
1487 |
||
1488 |
" |
|
1489 |
MenuEditor new openOnClass:MenuEditor andSelector:#standardFileMenu |
|
1490 |
(Menu new fromLiteralArrayEncoding:(MenuEditor standardFileMenu)) startUp |
|
1491 |
" |
|
1492 |
||
1493 |
<resource: #menu> |
|
1494 |
||
2188 | 1495 |
^ |
1606 | 1496 |
#(#Menu |
1497 |
#( |
|
1498 |
#(#MenuItem |
|
1499 |
#label: 'New' |
|
1500 |
#translateLabel: true |
|
1501 |
#value: #menuNew |
|
1502 |
) |
|
1503 |
#(#MenuItem |
|
1504 |
#label: '-' |
|
1505 |
) |
|
1506 |
#(#MenuItem |
|
1507 |
#label: 'Open...' |
|
1508 |
#translateLabel: true |
|
1509 |
#value: #menuOpen |
|
1510 |
) |
|
1511 |
#(#MenuItem |
|
1512 |
#label: '-' |
|
1513 |
) |
|
1514 |
#(#MenuItem |
|
1515 |
#label: 'Save' |
|
1516 |
#translateLabel: true |
|
1517 |
#value: #menuSave |
|
1518 |
) |
|
1519 |
#(#MenuItem |
|
1520 |
#label: 'Save As...' |
|
1521 |
#translateLabel: true |
|
1522 |
#value: #menuSaveAs |
|
1523 |
) |
|
1524 |
#(#MenuItem |
|
1525 |
#label: '-' |
|
1526 |
) |
|
1527 |
#(#MenuItem |
|
1528 |
#label: 'Exit' |
|
1529 |
#translateLabel: true |
|
1530 |
#value: #closeRequest |
|
1531 |
) |
|
1532 |
) |
|
1533 |
nil |
|
1534 |
nil |
|
525 | 1535 |
) |
1536 |
! |
|
1537 |
||
1606 | 1538 |
standardHelpMenu |
1539 |
"This resource specification was automatically generated |
|
1540 |
by the MenuEditor of ST/X." |
|
1541 |
||
1542 |
"Do not manually edit this!! If it is corrupted, |
|
1543 |
the MenuEditor may not be able to read the specification." |
|
1544 |
||
1545 |
" |
|
1546 |
MenuEditor new openOnClass:MenuEditor andSelector:#standardHelpMenu |
|
1547 |
(Menu new fromLiteralArrayEncoding:(MenuEditor standardHelpMenu)) startUp |
|
1548 |
" |
|
1549 |
||
1550 |
<resource: #menu> |
|
1551 |
||
2188 | 1552 |
^ |
1606 | 1553 |
#(#Menu |
2188 | 1554 |
#( |
1555 |
#(#MenuItem |
|
1556 |
#label: 'Documentation' |
|
1557 |
#translateLabel: true |
|
1558 |
#value: #openDocumentation |
|
1559 |
) |
|
1560 |
#(#MenuItem |
|
1561 |
#label: '-' |
|
1562 |
) |
|
1563 |
#(#MenuItem |
|
1564 |
#label: 'About this Application...' |
|
1565 |
#translateLabel: true |
|
1566 |
#value: #openAboutThisApplication |
|
1567 |
) |
|
1568 |
) |
|
1569 |
nil |
|
1570 |
nil |
|
525 | 1571 |
) |
199 | 1572 |
! ! |
1573 |
||
1574 |
!MenuEditor methodsFor:'accessing'! |
|
1575 |
||
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1576 |
helpSpec |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1577 |
|spec sel t g| |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1578 |
|
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1579 |
spec := super helpSpec. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1580 |
t := spec at:#detailsStartGroup. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1581 |
g := (aspects at:#startGroup ifAbsent:nil) value. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1582 |
g == #conditionalRight ifTrue:[ |
2188 | 1583 |
t := t , ' #conditionalRight means: "right on non-win32 systems"' |
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1584 |
]. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1585 |
g == #right ifTrue:[ |
2188 | 1586 |
t := t , ' #right means: "right align from here"' |
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1587 |
]. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1588 |
g == #left ifTrue:[ |
2188 | 1589 |
t := t , ' #left means: "left align group"' |
2123
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1590 |
]. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1591 |
spec at:#detailsStartGroup put:t. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1592 |
|
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1593 |
^ spec. |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1594 |
"/ #detailsStartGroup |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1595 |
"/ 'Specify start of a right-aligned item group.' |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1596 |
|
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1597 |
"Created: / 16-10-2006 / 13:19:14 / cg" |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1598 |
! |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1599 |
|
1606 | 1600 |
helpTool |
1601 |
"get the help tool application |
|
1602 |
" |
|
1669 | 1603 |
^ wizards at:#help ifAbsentPut:[ |tool| |
2188 | 1604 |
tool := UIHelpTool new. |
1605 |
tool masterApplication:self. |
|
1606 |
tool modifiedHolder: self enablingCommitButtonsHolder. |
|
1607 |
tool builder window:(ApplicationSubView new client:tool spec:#innerSpec). |
|
1608 |
tool masterApplication:self. |
|
1609 |
tool |
|
1606 | 1610 |
] |
1611 |
! |
|
1612 |
||
1613 |
imageTool |
|
1614 |
"get the image tool application |
|
1615 |
" |
|
1616 |
^ wizards at:#image ifAbsentPut:[ |tool| |
|
2188 | 1617 |
tool := ResourceEditor new createBuilder. |
1618 |
tool masterApplication:self. |
|
1619 |
tool modifiedChannel: self enablingCommitButtonsHolder. |
|
1620 |
tool builder window:(ApplicationSubView new client:tool). |
|
1621 |
tool |
|
1606 | 1622 |
] |
1623 |
! |
|
1624 |
||
1625 |
useHelpTool:aHelpTool |
|
1626 |
"take the help dictionaries from aHelpTool into my helpTool |
|
1627 |
" |
|
1971 | 1628 |
self helpTool loadFromHelpTool:aHelpTool. |
1606 | 1629 |
! ! |
1630 |
||
1631 |
!MenuEditor methodsFor:'actions'! |
|
1632 |
||
1633 |
accept |
|
1634 |
"accept modifications |
|
1635 |
" |
|
1636 |
self accept:true. |
|
1637 |
! |
|
1638 |
||
1639 |
accept:ok |
|
1640 |
"ok if true the modifications are accepted |
|
1641 |
than reload from item |
|
1642 |
" |
|
1643 |
|selectedItem rscRetrHolder helpKeyHolder helpTool imageTool acceptChannel| |
|
1644 |
||
1645 |
selectedItem := self selectedItem. |
|
1646 |
||
1647 |
selectedItem ifNotNil:[ |
|
2188 | 1648 |
self withoutNotifyDo:[ |
1649 |
rscRetrHolder := aspects at:#resourceRetriever. |
|
1650 |
helpKeyHolder := aspects at:#activeHelpKey. |
|
1651 |
imageTool := self imageTool. |
|
1652 |
helpTool := self helpTool. |
|
1653 |
acceptChannel := self acceptChannel. |
|
1654 |
||
1655 |
acceptChannel triggerValue:true. |
|
1656 |
acceptChannel setValue:false. |
|
1657 |
||
1658 |
ok ifTrue:[ |
|
1659 |
helpTool accept. |
|
1660 |
rscRetrHolder value:(imageTool resourceRetriever). |
|
1661 |
helpKeyHolder value:(helpTool helpKey). |
|
1662 |
selectedItem fromAspects:aspects. |
|
1663 |
self setModified. |
|
1664 |
||
1665 |
selectedItem isRootItem ifTrue:[ |
|
1666 |
"/ update specSelector |
|
1667 |
specSelector := selectedItem rawLabel. |
|
1668 |
]. |
|
1669 |
]. |
|
1670 |
selectedItem toAspects:aspects. |
|
1671 |
helpTool helpKey:(helpKeyHolder value). |
|
1672 |
imageTool resourceRetriever:(rscRetrHolder value). |
|
1673 |
] |
|
218 | 1674 |
]. |
1606 | 1675 |
self updateChannels. |
2075 | 1676 |
"/ self clearModified. |
1677 |
self clearModifiedFlag. |
|
1678 |
||
1679 |
self enablingCommitButtonsHolder value:false. |
|
1680 |
||
1681 |
"Modified: / 05-09-2006 / 18:43:30 / cg" |
|
1606 | 1682 |
! |
1683 |
||
1684 |
cancel |
|
2070 | 1685 |
"reload aspects from current selected item; reset modification flag" |
1686 |
||
1606 | 1687 |
self accept:false. |
2070 | 1688 |
|
1689 |
"Modified: / 29-08-2006 / 10:20:46 / cg" |
|
287 | 1690 |
! |
1691 |
||
1606 | 1692 |
indicatorClickedAt:atLine |
1693 |
"indicator clicked at line number; toggle expand of item at line |
|
1694 |
" |
|
1695 |
|item| |
|
1696 |
||
1697 |
item := listOfItems at:atLine ifAbsent:nil. |
|
1610
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
1698 |
item ifNotNil:[ |
2188 | 1699 |
item toggleExpand. |
1700 |
self hasSelection ifFalse:[ |
|
1701 |
self selectedItem:item |
|
1702 |
] |
|
1610
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
1703 |
]. |
199 | 1704 |
! ! |
1705 |
||
1706 |
!MenuEditor methodsFor:'aspects'! |
|
1707 |
||
1606 | 1708 |
canCreateDelayedMenuChannel |
1709 |
"boolean holder, true if the current selected item accepts a delayed menu |
|
1710 |
" |
|
1711 |
^ builder booleanValueAspectFor:#canCreateDelayedMenuChannel |
|
220 | 1712 |
! |
1713 |
||
1636 | 1714 |
hasItemValue |
1715 |
"boolean holder, true if any item is selected |
|
1716 |
" |
|
2188 | 1717 |
^ BlockValue |
1718 |
with:[:holder | holder size > 0] |
|
1719 |
argument:(self aspectFor:#itemValue) |
|
2161 | 1720 |
|
1721 |
"Modified: / 08-03-2007 / 22:59:42 / cg" |
|
1636 | 1722 |
! |
1723 |
||
1606 | 1724 |
hasSelectionChannel |
1725 |
"boolean holder, true if any item is selected |
|
1726 |
" |
|
1727 |
^ builder booleanValueAspectFor:#hasSelectionChannel |
|
220 | 1728 |
! |
1729 |
||
1606 | 1730 |
hasSingleSelectionChannel |
1731 |
"boolean holder, true if one item is selected |
|
1732 |
" |
|
1733 |
^ builder booleanValueAspectFor:#hasSingleSelectionChannel |
|
1734 |
! |
|
1735 |
||
1736 |
listOfItems |
|
1737 |
"returns the hierarchical list of menuItems |
|
1244 | 1738 |
" |
1606 | 1739 |
^ listOfItems |
1740 |
! |
|
1741 |
||
1742 |
listOfTabs |
|
1743 |
"returns the list of current shown tab-labels retrieved |
|
1744 |
from the current selected item. |
|
1745 |
" |
|
1746 |
^ listOfTabs |
|
1747 |
! |
|
1748 |
||
1617 | 1749 |
redefineAspectMethodsChannel |
2188 | 1750 |
"boolean holder, true if aspects should be generated in only implemented |
1617 | 1751 |
in superClass by calling #super ... |
1752 |
" |
|
1753 |
^ builder booleanValueAspectFor:#redefineAspectMethodsChannel |
|
1754 |
! |
|
1755 |
||
1606 | 1756 |
selectionHolder |
1757 |
"value holder, which keeps the current selected items |
|
1758 |
" |
|
1759 |
^ selectionHolder |
|
199 | 1760 |
! |
1761 |
||
1606 | 1762 |
tabHolder |
1763 |
"value holder, which keeps the current selected tab label or nil |
|
1764 |
" |
|
1765 |
^ tabHolder |
|
1766 |
! |
|
1767 |
||
1768 |
wizardHolder |
|
1769 |
"holder, which keeps the current wizard window |
|
1770 |
" |
|
879 | 1771 |
|holder| |
1606 | 1772 |
|
1773 |
holder := builder bindingAt:#wizardHolder. |
|
1774 |
||
2151 | 1775 |
holder isNil ifTrue:[ |
2188 | 1776 |
holder := nil asValue. |
1777 |
builder aspectAt:#wizardHolder put:holder. |
|
879 | 1778 |
]. |
1779 |
^ holder |
|
199 | 1780 |
! ! |
1781 |
||
728 | 1782 |
!MenuEditor methodsFor:'building'! |
1783 |
||
1606 | 1784 |
buildFromMenu:aMenu selector:aSelector |
1785 |
"rebuild menu from a Menu |
|
1786 |
" |
|
1787 |
|root menu| |
|
1788 |
||
1789 |
aMenu isCollection ifTrue:[menu := aMenu decodeAsLiteralArray] |
|
2188 | 1790 |
ifFalse:[menu := aMenu]. |
1988 | 1791 |
|
1792 |
self enablingCommitButtonsHolder value:false. |
|
1606 | 1793 |
root := listOfItems root. |
1794 |
||
1795 |
self withoutNotifyDo:[ |
|
2188 | 1796 |
selectionHolder setValue:#(). |
1797 |
root menu:aMenu labeled:(aSelector ? specSelector). |
|
1606 | 1798 |
]. |
1799 |
self selectedItem:root. |
|
734 | 1800 |
self updateHistory. |
1801 |
! |
|
1802 |
||
2019 | 1803 |
buildFromResourceSpec:aResourceSpec |
1804 |
"rebuild the menu from a resource spec" |
|
1805 |
||
1806 |
self buildFromMenu:aResourceSpec selector:nil |
|
1807 |
! |
|
1808 |
||
1971 | 1809 |
loadFromClass:aClass andSelector:aSelector |
1810 |
"rebuild menu from a class and selector" |
|
1811 |
||
1812 |
|cls menu| |
|
1813 |
||
1814 |
self assert:(aClass isNil or:[aClass isClass]). |
|
1815 |
||
1816 |
menu := nil. |
|
1817 |
||
2188 | 1818 |
self isStandAlone ifTrue:[ self helpTool loadFromClass:aClass ]. |
1971 | 1819 |
|
1820 |
specClass := aClass. |
|
1821 |
specSelector := aSelector. |
|
1822 |
||
1823 |
aSelector notNil ifTrue:[ |
|
2188 | 1824 |
aClass notNil ifTrue:[ |
1825 |
cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass]. |
|
1826 |
||
1827 |
(cls respondsTo:aSelector) ifTrue:[ |
|
1828 |
menu := cls perform: aSelector. |
|
1829 |
]. |
|
1830 |
||
1831 |
menu notNil ifTrue:[ |
|
1832 |
(menu isCollection) ifTrue:[ |
|
1833 |
menu := Menu decodeFromLiteralArray:menu |
|
1834 |
]. |
|
1835 |
] |
|
1836 |
]. |
|
1971 | 1837 |
]. |
1838 |
self buildFromMenu:menu selector:aSelector. |
|
1839 |
self clearModified. |
|
2168 | 1840 |
|
2169 | 1841 |
"Modified: / 27-03-2007 / 11:16:47 / cg" |
728 | 1842 |
! ! |
1843 |
||
199 | 1844 |
!MenuEditor methodsFor:'change & update'! |
1845 |
||
1606 | 1846 |
selectedSuperItems |
1847 |
"returns collection of superItems derived from selection |
|
1848 |
" |
|
1849 |
|selection size root| |
|
1850 |
||
1851 |
selectedSuperItems ifNotNil:[ ^ selectedSuperItems ]. |
|
1852 |
||
1853 |
selection := selectionHolder value. |
|
1854 |
size := selection size. |
|
1855 |
||
1856 |
size <= 1 ifTrue:[ |
|
2188 | 1857 |
selectedSuperItems := selection ? #(). |
1606 | 1858 |
^ selectedSuperItems |
1859 |
]. |
|
1860 |
||
1861 |
root := listOfItems root. |
|
1862 |
||
1863 |
(selection includesIdentical:root) ifTrue:[ |
|
2188 | 1864 |
selectedSuperItems := Array with:root. |
1865 |
^ selectedSuperItems |
|
1606 | 1866 |
]. |
1867 |
selectedSuperItems := OrderedCollection new. |
|
1868 |
||
1869 |
selection do:[:anItem| |
|
2188 | 1870 |
anItem parentsDetect:[:el| selection includesIdentical:el ] |
1871 |
ifNone:[ selectedSuperItems add:anItem ]. |
|
1606 | 1872 |
]. |
1873 |
^ selectedSuperItems |
|
1874 |
! |
|
1875 |
||
1876 |
selectionChanged |
|
1877 |
"called if the selection has changed |
|
1878 |
" |
|
1879 |
|newTabList selection| |
|
1880 |
||
1881 |
selection := selectionHolder value. |
|
1882 |
||
1883 |
selection size == 1 ifTrue:[ |
|
2188 | 1884 |
selectedSuperItems := selection. |
1885 |
||
1886 |
newTabList := selection first slices collect:[:el| el first ]. |
|
1887 |
newTabList = listOfTabs ifFalse:[ |
|
1888 |
listOfTabs contents:newTabList. |
|
1889 |
]. |
|
1606 | 1890 |
] ifFalse:[ |
2188 | 1891 |
"must compute selected super items on request |
1892 |
" |
|
1893 |
selectedSuperItems := nil. |
|
1606 | 1894 |
]. |
1895 |
self cancel. |
|
1896 |
self tabChanged. |
|
1897 |
self updateChannels. |
|
1898 |
! |
|
1899 |
||
1900 |
tabChanged |
|
1901 |
"called if the tab changed |
|
1902 |
" |
|
1903 |
|tab selector item canvas wizardHolder| |
|
1904 |
||
1905 |
wizardHolder := self wizardHolder. |
|
1906 |
item := self selectedItem. |
|
2151 | 1907 |
item isNil ifTrue:[ ^ wizardHolder value:nil ]. |
1606 | 1908 |
|
1909 |
tab := tabHolder value. |
|
1910 |
||
1676 | 1911 |
tab notNil ifTrue:[ |
2188 | 1912 |
tab := item slices detect:[:el| el first = tab ] ifNone:nil. |
1606 | 1913 |
]. |
1676 | 1914 |
tab isNil ifTrue:[ |
2188 | 1915 |
^ tabHolder value:( listOfTabs at:1 ifAbsent:nil ) |
1606 | 1916 |
]. |
1917 |
selector := tab last. |
|
1918 |
||
1919 |
selector == #help ifTrue:[ ^ wizardHolder value:(self helpTool window) ]. |
|
1920 |
selector == #image ifTrue:[ ^ wizardHolder value:(self imageTool window) ]. |
|
1921 |
||
1922 |
canvas := wizards at:(item class name, selector) asSymbol |
|
2188 | 1923 |
ifAbsentPut:[ SimpleView new client:self |
1924 |
spec:(item class perform:selector) |
|
1925 |
builder:(self builder) |
|
1926 |
]. |
|
1606 | 1927 |
|
1928 |
wizardHolder value:canvas. |
|
1929 |
! |
|
1930 |
||
970 | 1931 |
update:something with:aParameter from:changedObject |
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1932 |
|lbl| |
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1933 |
|
1606 | 1934 |
notifyDisabledCounter ~~ 0 ifTrue:[ ^ self ]. |
1935 |
||
1936 |
changedObject == selectionHolder ifTrue:[ ^ self selectionChanged ]. |
|
1937 |
changedObject == tabHolder ifTrue:[ ^ self tabChanged ]. |
|
1938 |
||
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1939 |
changedObject == self autoAcceptOnSelectionChange ifTrue:[ |
2188 | 1940 |
lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK']. |
1941 |
(builder componentAt:'okButton') label:(resources string:lbl). |
|
1942 |
^ self |
|
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1943 |
]. |
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
1944 |
|
1606 | 1945 |
super update:something with:aParameter from:changedObject |
970 | 1946 |
! |
1947 |
||
748 | 1948 |
updateChannels |
1606 | 1949 |
"update all channels |
1950 |
" |
|
1951 |
|selection sizeOfSel selectedItem| |
|
1952 |
||
1953 |
super updateChannels. |
|
1954 |
||
1955 |
selection := selectionHolder value. |
|
1956 |
sizeOfSel := selection size. |
|
1957 |
||
1958 |
sizeOfSel == 1 ifTrue:[selectedItem := selection at:1] |
|
2188 | 1959 |
ifFalse:[selectedItem := nil]. |
1606 | 1960 |
|
1961 |
self hasSelectionChannel value:(sizeOfSel ~~ 0). |
|
1962 |
self hasSingleSelectionChannel value:(selectedItem notNil). |
|
1963 |
||
1964 |
selectedItem isNil ifTrue:[ |
|
2188 | 1965 |
self enableMovingInHolder value:false. |
1966 |
self enableMovingOutHolder value:false. |
|
1967 |
self enableMovingUpOrDownHolder value:false. |
|
1968 |
self enableMovingInAboveHolder value:false. |
|
1969 |
self canCreateDelayedMenuChannel value:false. |
|
1244 | 1970 |
] ifFalse:[ |
2188 | 1971 |
self enableMovingUpOrDownHolder value:(selectedItem canMoveUpOrDown). |
1972 |
self enableMovingOutHolder value:(selectedItem canMoveOut). |
|
1973 |
self enableMovingInHolder value:(selectedItem canMoveInNext). |
|
1974 |
self enableMovingInAboveHolder value:(selectedItem canMoveInAbove). |
|
1975 |
self canCreateDelayedMenuChannel value:(selectedItem canAddDelayedMenu). |
|
902 | 1976 |
]. |
220 | 1977 |
! ! |
1978 |
||
916 | 1979 |
!MenuEditor methodsFor:'defaults'! |
1980 |
||
1981 |
aboutImage |
|
1982 |
"the image to be displayed in my about-box; |
|
1606 | 1983 |
If nil is returned, the ST/X default image is used. |
1244 | 1984 |
" |
1606 | 1985 |
^ self class aboutImage |
1986 |
! ! |
|
1987 |
||
1988 |
!MenuEditor methodsFor:'drag & drop'! |
|
1989 |
||
2118 | 1990 |
canDrop:aDropContext |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
1991 |
"return true, if the DropContext can be dropped into the list of items. |
1953 | 1992 |
The dropable objects are already validated by: #dropEnter:" |
1993 |
||
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
1994 |
^ (dropOverLine notNil and:[dropOverLine ~~ 0]) |
2118 | 1995 |
|
1996 |
"Modified: / 13-10-2006 / 16:03:47 / cg" |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
1997 |
! |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
1998 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
1999 |
changeDropLineTo:aLineOrNil in:aContext |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2000 |
"the over dropLine changed; redraw drop indication stuff |
1244 | 2001 |
" |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2002 |
|x0 x1 y0| |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2003 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2004 |
aLineOrNil == dropOverLine ifTrue:[ |
2188 | 2005 |
^ self. "/ nothing changed |
1244 | 2006 |
]. |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2007 |
x0 := listOfItemsView margin + 2. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2008 |
x1 := listOfItemsView width - x0. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2009 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2010 |
"/ inform the DragAndDrop handler that the draw contents will change |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2011 |
aContext contentsWillChange. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2012 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2013 |
(dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[ |
2188 | 2014 |
"/ restore old draw |
2015 |
y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1). |
|
2016 |
y0 := y0 - 3. |
|
2017 |
||
2018 |
listOfItemsView invalidate:(Rectangle left:x0 top:y0 width:(x1-x0+1) height:2) |
|
2019 |
repairNow:true. |
|
1606 | 2020 |
]. |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2021 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2022 |
dropOverLine := aLineOrNil. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2023 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2024 |
(dropOverLine notNil and:[dropOverLine ~~ 0]) ifTrue:[ |
2188 | 2025 |
"/ highlight new drop target |
2026 |
y0 := listOfItemsView yVisibleOfLine:(dropOverLine + 1). |
|
2027 |
y0 := y0 - 3. |
|
2028 |
||
2029 |
listOfItemsView paint:(Color white). |
|
2030 |
listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0. |
|
2031 |
y0 := y0 + 1. |
|
2032 |
listOfItemsView paint:(Color black). |
|
2033 |
listOfItemsView displayLineFromX:x0 y:y0 toX:x1 y:y0. |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2034 |
]. |
1606 | 2035 |
! |
2036 |
||
2118 | 2037 |
doDrop:aDropContext |
1702 | 2038 |
"drop the dropContext into the hierachical list of items |
1244 | 2039 |
" |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2040 |
|done item| |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2041 |
|
2151 | 2042 |
dropOverLine isNil ifTrue:[^ false ]. "/ context not valid to me ... |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2043 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2044 |
item := listOfItems at:dropOverLine ifAbsent:nil. |
2118 | 2045 |
self dropLeave:aDropContext. |
2151 | 2046 |
item isNil ifTrue:[^ false]. |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2047 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2048 |
selectionHolder setValue:(Array with:item). |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2049 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2050 |
done := false. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2051 |
|
1702 | 2052 |
self addAndSelectValueOf:[ |
2188 | 2053 |
done := true. |
2054 |
aDropContext dropObjects collect:[:el| Item menuItem:(el theObject) ] |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2055 |
]. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2056 |
^ done |
2118 | 2057 |
|
2058 |
"Modified: / 13-10-2006 / 16:03:54 / cg" |
|
2059 |
! |
|
2060 |
||
2061 |
dropEnter:aDropContext |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2062 |
"a drop operation enters my widget; validate dropable objects. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2063 |
If the objects are not dropable, dropOverLine is set to nil, |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2064 |
otherwise to 0 (can drop the contents but not). |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2065 |
" |
1606 | 2066 |
|objects| |
2067 |
||
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2068 |
dropOverLine := nil. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2069 |
|
1988 | 2070 |
self enablingCommitButtonsHolder value ifTrue:[ |
2188 | 2071 |
"/ current editing spec is modified (couldn't accept operation) |
2072 |
^ self |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2073 |
]. |
2118 | 2074 |
objects := aDropContext dropObjects. |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2075 |
objects isEmpty ifTrue:[ ^ self ]. "/ nothing to drop ??? |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2076 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2077 |
"/ test whether all objects are dropable (kind of MenuItem) |
2113
8e2be2823f9e
code cleanup: use #contains/#conform instead of explicit loop
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
2078 |
(objects conform:[:el | (el theObject askFor:#isMenuItem)]) ifTrue:[ |
2188 | 2079 |
"/ ok, the contents is dropable |
2080 |
dropOverLine := 0. |
|
2113
8e2be2823f9e
code cleanup: use #contains/#conform instead of explicit loop
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
2081 |
] |
8e2be2823f9e
code cleanup: use #contains/#conform instead of explicit loop
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
2082 |
|
2118 | 2083 |
"Modified: / 13-10-2006 / 16:04:14 / cg" |
2084 |
! |
|
2085 |
||
2086 |
dropLeave:aDropContext |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2087 |
"the widget is leaved; restore drop indications drawn ... |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2088 |
" |
2118 | 2089 |
self changeDropLineTo:nil in:aDropContext. |
2090 |
||
2091 |
"Modified: / 13-10-2006 / 16:03:59 / cg" |
|
879 | 2092 |
! |
2093 |
||
1606 | 2094 |
dropObjects |
2095 |
"returns list of DropObjects |
|
2096 |
" |
|
2097 |
|obj items| |
|
2098 |
||
2099 |
items := self selectedSuperItems. |
|
2100 |
items isEmpty ifTrue:[ ^ nil ]. |
|
2101 |
||
2102 |
^ items collect:[:el| |
|
2188 | 2103 |
obj := DropObject new:(el menuItem). |
2104 |
obj displayObject:(el rawLabel). |
|
2105 |
obj |
|
199 | 2106 |
]. |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2107 |
! |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2108 |
|
2118 | 2109 |
dropOver:aDropContext |
1685 | 2110 |
"called during drag & drop while moving over the widget." |
2111 |
||
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2112 |
|lnNr item| |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2113 |
|
2151 | 2114 |
dropOverLine isNil ifTrue:[^ self ]. "/ context not valid to me ... |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2115 |
|
2118 | 2116 |
lnNr := listOfItemsView yVisibleToLineNr:(aDropContext targetPoint y). |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2117 |
item := nil. |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2118 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2119 |
lnNr ifNotNil:[ |
2188 | 2120 |
item := listOfItems at:lnNr ifAbsent:nil. |
2121 |
item ifNotNil:[ |
|
2122 |
(item isAction and:[item hasDelayedMenu]) ifTrue:[ |
|
2123 |
item := nil |
|
2124 |
] |
|
2125 |
] |
|
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2126 |
]. |
2151 | 2127 |
item isNil ifTrue:[ lnNr := 0 ]. "/ not dropable for item |
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2128 |
|
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2129 |
"/ redraw drop indication |
2118 | 2130 |
self changeDropLineTo:lnNr in:aDropContext. |
2131 |
||
2132 |
"Modified: / 13-10-2006 / 16:04:05 / cg" |
|
1606 | 2133 |
! ! |
2134 |
||
2135 |
!MenuEditor methodsFor:'event processing'! |
|
2136 |
||
2137 |
processEvent:anEvent |
|
1895 | 2138 |
"filter keyboard edit-events typed into the listOfItemsView. |
2139 |
Return true, if I have eaten the event" |
|
2140 |
||
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2141 |
|evView rawKey key| |
1606 | 2142 |
|
2187 | 2143 |
anEvent isKeyPressEvent ifFalse:[^ false]. |
1606 | 2144 |
|
2145 |
evView := anEvent targetView. |
|
2151 | 2146 |
evView isNil ifTrue:[ ^ false ]. |
1606 | 2147 |
|
2263 | 2148 |
"/ only handle keyboard events for the left item list |
2149 |
"/ (otherwise, copy-paste would not work in the editFields on the right) |
|
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2150 |
(evView isSameOrComponentOf:listOfItemsView) ifFalse:[^ false]. |
1606 | 2151 |
|
2152 |
key := anEvent key. |
|
2153 |
rawKey := anEvent rawKey. |
|
2154 |
||
2155 |
( key == #Delete |
|
2156 |
or:[key == #BackSpace |
|
2157 |
or:[key == #Cut]] |
|
2158 |
) ifTrue:[ |
|
2263 | 2159 |
self doCut. |
2160 |
^ true. |
|
199 | 2161 |
]. |
1256
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2162 |
|
1606 | 2163 |
key == #Copy ifTrue:[ self doCopy. ^ true ]. |
2164 |
key == #Paste ifTrue:[ self doPaste. ^ true ]. |
|
2165 |
||
2188 | 2166 |
(rawKey == #CtrlCursorUp) ifTrue:[ |
2263 | 2167 |
self doMoveUp. |
2168 |
^ true. |
|
1958 | 2169 |
]. |
2188 | 2170 |
(rawKey == #CtrlCursorDown) ifTrue:[ |
2263 | 2171 |
self doMoveDown. |
2172 |
^ true. |
|
1958 | 2173 |
]. |
2188 | 2174 |
(rawKey == #CtrlCursorLeft) ifTrue:[ |
2263 | 2175 |
self doMoveOut. |
2176 |
^ true. |
|
1958 | 2177 |
]. |
2188 | 2178 |
(rawKey == #CtrlCursorRight) ifTrue:[ |
2263 | 2179 |
self doMoveInNext. |
2180 |
^ true. |
|
1958 | 2181 |
]. |
2182 |
||
2183 |
^ false. |
|
1606 | 2184 |
! ! |
2185 |
||
2186 |
!MenuEditor methodsFor:'initialization & release'! |
|
2187 |
||
2188 |
closeRequest |
|
2036 | 2189 |
"asks for permission before closing" |
2190 |
||
2075 | 2191 |
self askForModification ifFalse:[^self]. |
2192 |
||
2193 |
"/ self enablingCommitButtonsHolder value ifTrue:[ |
|
2194 |
"/ self setModified. |
|
2195 |
"/ self askForListModification. |
|
2196 |
"/ modified ifTrue:[^ self]. |
|
2197 |
"/ self clearModified. |
|
2198 |
"/ ]. |
|
2036 | 2199 |
super closeRequest |
2075 | 2200 |
|
2201 |
"Modified: / 05-09-2006 / 18:44:15 / cg" |
|
1606 | 2202 |
! |
199 | 2203 |
|
1992 | 2204 |
commonPostBuild |
2205 |
self autoAcceptOnSelectionChange addDependent:self. |
|
2206 |
self autoAcceptOnSelectionChange value ifTrue:[ |
|
2188 | 2207 |
(builder componentAt:'okButton') label:(resources string:'Apply') |
1992 | 2208 |
]. |
2209 |
||
1997 | 2210 |
"/ using masters infoHolder ? |
2211 |
(builder aspectAt:#useAlienInfoLabelHolder) == true ifTrue:[ |
|
2188 | 2212 |
(builder componentAt:#mainPanel) layout bottomOffset:0. |
2213 |
(builder componentAt:#infoBarSubSpec) beInvisible |
|
1997 | 2214 |
] |
1992 | 2215 |
! |
2216 |
||
738 | 2217 |
initialize |
1606 | 2218 |
"setup aspects, ... |
2219 |
" |
|
738 | 2220 |
super initialize. |
1606 | 2221 |
notifyDisabledCounter := 0. |
2222 |
||
2223 |
Item withAllSubclasses do:[:aClass| |
|
2188 | 2224 |
aClass addBindingsTo:aspects for:self. |
1606 | 2225 |
]. |
2226 |
||
2227 |
selectionHolder := #() asValue. |
|
2228 |
selectionHolder addDependent:self. |
|
2229 |
||
2230 |
listOfItems := HierarchicalList new. |
|
2231 |
listOfItems application:self. |
|
1631 | 2232 |
listOfItems root:(RootItem new). |
1606 | 2233 |
|
2234 |
tabHolder := nil asValue. |
|
2235 |
tabHolder addDependent:self. |
|
2236 |
||
2237 |
listOfTabs := List new. |
|
2238 |
wizards := IdentityDictionary new. |
|
738 | 2239 |
! |
2240 |
||
1606 | 2241 |
openModalOnMenu:aMenu |
2242 |
"build a tree from aMenu and open it modal |
|
2243 |
" |
|
2244 |
self openModalOnResourceSpec:aMenu |
|
2245 |
! |
|
2246 |
||
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2247 |
postBuildListOfItemsView:aSrollableView |
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2248 |
listOfItemsView := aSrollableView scrolledView. |
1250 | 2249 |
! |
2250 |
||
1676 | 2251 |
postBuildNoteBook:aNoteBook |
2252 |
aNoteBook tabLabelInset:16@4. |
|
2253 |
! |
|
2254 |
||
1250 | 2255 |
postOpenWith:aBuilder |
2036 | 2256 |
"reset keyboardProcessor for menuBar" |
2257 |
||
1250 | 2258 |
super postOpenWith: aBuilder. |
2259 |
aBuilder keyboardProcessor menuBar:nil. |
|
1606 | 2260 |
self windowGroup addPreEventHook:self. |
199 | 2261 |
! ! |
2262 |
||
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2263 |
!MenuEditor methodsFor:'menus-dynamic'! |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2264 |
|
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2265 |
submenuTest |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2266 |
"returns a menu on the current editing menu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2267 |
" |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2268 |
|menu indication choice submenu retriever| |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2269 |
|
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2270 |
menu := listOfItems root submenu. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2271 |
menu isNil ifTrue:[^ nil ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2272 |
|
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2273 |
menu allItemsDo:[:anItem| |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2274 |
anItem ignoreShortcutKeys:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2275 |
anItem isVisible:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2276 |
anItem enabled:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2277 |
anItem translateLabel:false. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2278 |
|
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2279 |
anItem itemValue notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2280 |
anItem itemValue:[ Transcript showCR:(anItem label) ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2281 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2282 |
anItem indication notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2283 |
indication isNil ifTrue:[ indication := true asValue ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2284 |
anItem indication:indication |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2285 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2286 |
anItem choice notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2287 |
choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2288 |
anItem choice:choice |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2289 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2290 |
anItem isMenuSlice ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2291 |
anItem submenuChannel:nil. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2292 |
anItem label:'... Slice Menu ...'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2293 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2294 |
anItem submenuChannel notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2295 |
anItem submenuChannel:nil. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2296 |
anItem submenu isNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2297 |
submenu isNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2298 |
submenu := Menu new. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2299 |
submenu addItem:(MenuItem labeled:'Linked Menu...'). |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2300 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2301 |
anItem submenu:submenu. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2302 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2303 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2304 |
retriever := anItem resourceRetriever. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2305 |
retriever notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2306 |
retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ] |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2307 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2308 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2309 |
menu findGuiResourcesIn:(self resolveName:specClass). |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2310 |
^ menu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2311 |
! ! |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2312 |
|
1606 | 2313 |
!MenuEditor methodsFor:'private'! |
2314 |
||
1702 | 2315 |
addAndSelectValueOf:aBlockOrItem |
1606 | 2316 |
"add an item(s) derived from the block; test if add operation |
2317 |
is enabled. On success the new item(s) are returned otherwise nil. |
|
2318 |
" |
|
2319 |
|intoItem index newItem| |
|
2320 |
||
2321 |
intoItem := self selectedItem. |
|
2151 | 2322 |
intoItem isNil ifTrue:[ ^ nil]. |
1606 | 2323 |
|
2324 |
self askForItemModification ifFalse:[ ^ nil ]. |
|
2325 |
||
2326 |
index := 1. |
|
2327 |
||
1618
9c9b649ce251
support drag & drop inside my widget (highlight the drop target)
ca
parents:
1617
diff
changeset
|
2328 |
(intoItem canAddChildren and:[intoItem isExpanded]) ifFalse:[ |
2188 | 2329 |
intoItem parent notNil ifTrue:[ |
2330 |
[ intoItem parent canAddChildren ] whileFalse:[ |
|
2331 |
intoItem := intoItem parent. |
|
2332 |
]. |
|
2333 |
index := intoItem parent identityIndexOf:intoItem. |
|
2334 |
index := index + 1. |
|
2335 |
intoItem := intoItem parent. |
|
2336 |
]. |
|
1606 | 2337 |
]. |
1702 | 2338 |
newItem := aBlockOrItem value. |
1606 | 2339 |
|
2340 |
newItem ifNotNil:[ |
|
2188 | 2341 |
selectionHolder setValue:nil. |
2342 |
intoItem expand. |
|
2343 |
||
2344 |
newItem isCollection ifTrue:[ |
|
2345 |
intoItem addAll:newItem beforeIndex:index. |
|
2346 |
selectionHolder value:newItem. |
|
2347 |
] ifFalse:[ |
|
2348 |
intoItem add:newItem beforeIndex:index. |
|
2349 |
selectionHolder value:(Array with:newItem). |
|
2350 |
]. |
|
2351 |
self setModified. |
|
1606 | 2352 |
]. |
2353 |
^ newItem |
|
407 | 2354 |
! |
2355 |
||
1606 | 2356 |
clearModified |
1971 | 2357 |
"clear the modifiedChannel and the commitPanel" |
2358 |
||
2008
a2906aabdbb1
embedding as special editors
Claus Gittinger <cg@exept.de>
parents:
2003
diff
changeset
|
2359 |
super clearModified. |
1988 | 2360 |
self enablingCommitButtonsHolder value:false. |
1189
0e7e286f864c
code cleanup; care for non-string argument
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
2361 |
self clearModifiedFlag. |
407 | 2362 |
! |
2363 |
||
1606 | 2364 |
generateMenuSpec |
2365 |
"generate and returns the current menu spec or nil |
|
2366 |
" |
|
2367 |
|menu spec| |
|
2368 |
||
2369 |
menu := listOfItems root submenu. |
|
2151 | 2370 |
menu isNil ifTrue:[^ nil]. |
1606 | 2371 |
menu := menu literalArrayEncoding. |
2372 |
spec := WriteStream on:String new. |
|
2373 |
UISpecification prettyPrintSpecArray:menu on:spec indent:5. |
|
2151 | 2374 |
^ spec contents. |
1606 | 2375 |
! |
2376 |
||
2377 |
withoutNotifyDo:aBlock |
|
2378 |
"evaluate the block; all change notifications are |
|
1722
517efee14b0d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1715
diff
changeset
|
2379 |
discard during the block is evaluated" |
517efee14b0d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1715
diff
changeset
|
2380 |
|
1606 | 2381 |
|blockResult| |
2382 |
||
2188 | 2383 |
[ |
2384 |
notifyDisabledCounter := notifyDisabledCounter + 1. |
|
2385 |
blockResult := aBlock value. |
|
1722
517efee14b0d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
1715
diff
changeset
|
2386 |
] ensure:[ |
2188 | 2387 |
notifyDisabledCounter := notifyDisabledCounter - 1 |
2388 |
]. |
|
1606 | 2389 |
^ blockResult |
2390 |
! ! |
|
2391 |
||
2392 |
!MenuEditor methodsFor:'queries'! |
|
2393 |
||
2394 |
hasValidSpecClass |
|
2395 |
"returns true if a valid specClass exists |
|
2396 |
" |
|
2397 |
|cls| |
|
2398 |
||
2151 | 2399 |
specClass isNil ifTrue:[^ false]. |
1606 | 2400 |
cls := self resolveName:specClass. |
2151 | 2401 |
^ cls notNil |
1606 | 2402 |
! ! |
2403 |
||
2404 |
!MenuEditor methodsFor:'selection'! |
|
2405 |
||
2406 |
canSelect:anIndex |
|
2407 |
"called whenever the selection changed; test whether |
|
2408 |
current item is not modified .... |
|
2409 |
" |
|
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
2410 |
|oldSelectedItem newSelectedItem anythingChanged| |
1606 | 2411 |
|
1988 | 2412 |
self enablingCommitButtonsHolder value ifFalse:[ |
2188 | 2413 |
^ true |
1606 | 2414 |
]. |
2415 |
oldSelectedItem := self selectedItem. |
|
2151 | 2416 |
oldSelectedItem isNil ifTrue:[^ true]. |
1606 | 2417 |
|
2418 |
newSelectedItem := listOfItems at:anIndex ifAbsent:nil. |
|
2419 |
oldSelectedItem == newSelectedItem ifTrue:[ |
|
2188 | 2420 |
^ true |
1606 | 2421 |
]. |
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
2422 |
|
1988 | 2423 |
anythingChanged := self enablingCommitButtonsHolder value. |
2188 | 2424 |
anythingChanged ifTrue:[ |
2425 |
self autoAcceptOnSelectionChange value ifTrue:[ |
|
2426 |
self accept. |
|
2427 |
^ true |
|
2428 |
]. |
|
1711
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
2429 |
]. |
548d690e780f
auto-accept on selection change
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
2430 |
|
1606 | 2431 |
^ self askForItemModification |
879 | 2432 |
! |
2433 |
||
1610
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2434 |
hasSelection |
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2435 |
"returns true if a selection exists |
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2436 |
" |
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2437 |
^ selectionHolder value size ~~ 0 |
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2438 |
! |
cb3e093aa6d5
if after collapse no selection exists, use the collapsed element
ca
parents:
1609
diff
changeset
|
2439 |
|
1606 | 2440 |
selectedItem |
2441 |
"returns the selected item or nil (none or multiple selected) |
|
2442 |
" |
|
2443 |
|selection| |
|
2444 |
||
2445 |
selection := selectionHolder value. |
|
2446 |
selection size == 1 ifTrue:[ ^ selection first ]. |
|
2447 |
^ nil |
|
2448 |
! |
|
2449 |
||
2450 |
selectedItem:anItem |
|
2451 |
"change selection to an item |
|
2452 |
" |
|
2453 |
|selection| |
|
2454 |
||
2455 |
anItem notNil ifTrue:[ selection := Array with:anItem ] |
|
2456 |
ifFalse:[ selection := #() ]. |
|
2457 |
||
2458 |
selectionHolder value:selection. |
|
2459 |
! ! |
|
2460 |
||
1715 | 2461 |
!MenuEditor methodsFor:'user actions-aspects'! |
1614 | 2462 |
|
2463 |
collectActionSelectors |
|
2464 |
|selectors| |
|
2465 |
||
2466 |
selectors := IdentitySet new. |
|
2467 |
||
2468 |
listOfItems root recursiveDo:[:el| |
|
2188 | 2469 |
el actionSelectors do:[:s| selectors add:s ]. |
1614 | 2470 |
]. |
2471 |
^ selectors asOrderedCollection |
|
2472 |
! |
|
2473 |
||
2474 |
collectAspectSelectors |
|
2475 |
|selectors| |
|
2476 |
||
2477 |
selectors := IdentitySet new. |
|
2478 |
||
2479 |
listOfItems root recursiveDo:[:el| |
|
2252 | 2480 |
selectors addAll:(el aspectSelectors). |
1614 | 2481 |
]. |
2482 |
^ selectors asOrderedCollection |
|
2483 |
! |
|
2484 |
||
2485 |
doGenerateAspectMethods |
|
1805
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2486 |
"compile aspect and action methods" |
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2487 |
|
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2488 |
|cls redefineAspectMethods category| |
1614 | 2489 |
|
2151 | 2490 |
specClass isNil ifTrue:[ |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2491 |
self warn:'Define the class first !!'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2492 |
^ self |
1614 | 2493 |
]. |
1617 | 2494 |
redefineAspectMethods := self redefineAspectMethodsChannel value. |
1614 | 2495 |
|
2496 |
cls := self resolveName:specClass. |
|
2151 | 2497 |
cls isNil ifTrue:[ |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2498 |
self warn:'Class ', specClass asString, ' does not exist!!'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2499 |
^ self |
1614 | 2500 |
]. |
1617 | 2501 |
|
1805
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2502 |
category := UserPreferences current categoryForMenuActionsMethods. |
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2503 |
|
1617 | 2504 |
self collectActionSelectors do:[:aSelector| |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2505 |
CodeGeneratorTool |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2506 |
createActionMethodFor:aSelector in:cls |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2507 |
category:category |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2508 |
redefine:redefineAspectMethods. |
1614 | 2509 |
]. |
1617 | 2510 |
|
2511 |
self collectAspectSelectors do:[:anAspect| |
|
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2512 |
CodeGeneratorTool |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2513 |
createAspectMethodFor:anAspect in:cls |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2514 |
category:category |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2515 |
redefine:redefineAspectMethods |
1614 | 2516 |
]. |
2517 |
! ! |
|
2518 |
||
1715 | 2519 |
!MenuEditor methodsFor:'user actions-building'! |
1606 | 2520 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2521 |
doNew |
1606 | 2522 |
"clear editing menu; start from scratch |
2523 |
" |
|
2524 |
super doNew ifTrue:[ self helpTool doNew ]. |
|
199 | 2525 |
! |
2526 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2527 |
doPickAMenu |
1971 | 2528 |
"pick a menu from user" |
2529 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2530 |
|view| |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2531 |
|
1244 | 2532 |
self askForModification ifTrue:[ |
2188 | 2533 |
view := Screen current viewFromUser. |
2534 |
(view isNil or:[view == Screen current rootView]) ifTrue:[ |
|
2535 |
^ self |
|
2536 |
]. |
|
2537 |
view specClass == MenuPanelSpec ifTrue:[ |
|
2538 |
specSelector := #pickedMenu. |
|
2539 |
self buildFromMenu:(view asMenu) selector:specSelector. |
|
2540 |
]. |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2541 |
]. |
888 | 2542 |
! |
2543 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2544 |
doSave |
1606 | 2545 |
"save current editing menu to |
2188 | 2546 |
class: specClass |
2547 |
selector: specSelector |
|
1606 | 2548 |
" |
2549 |
|cls spec mthd category code excla| |
|
199 | 2550 |
|
642 | 2551 |
super doSave ifFalse: [^nil]. |
1606 | 2552 |
spec := self generateMenuSpec. |
2151 | 2553 |
spec isNil ifTrue:[^ nil]. |
1606 | 2554 |
|
2555 |
cls := self resolveName:specClass. |
|
199 | 2556 |
|
2557 |
"/ if that method already exists, do not overwrite the category |
|
2558 |
||
576 | 2559 |
category := 'menu specs'. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2560 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
2188 | 2561 |
category := mthd category. |
199 | 2562 |
]. |
2563 |
||
764 | 2564 |
excla := Character excla asString. |
2565 |
||
2566 |
code := excla |
|
2188 | 2567 |
, (cls name , ' class methodsFor:' , category storeString) |
2568 |
, excla , '\\' |
|
2569 |
||
2570 |
, specSelector , '\' |
|
2571 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
|
2572 |
, '\\ "\' |
|
2573 |
, (' MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\') |
|
2574 |
, (' (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp\') |
|
2575 |
, ' "\'. |
|
2576 |
||
2577 |
code := code |
|
2578 |
, '\' |
|
2579 |
, ' <resource: #menu>\\' |
|
2580 |
, ' ^ ' , spec |
|
2581 |
, '\' |
|
2582 |
, (excla , ' ' , excla) |
|
2583 |
, '\\'. |
|
199 | 2584 |
|
2585 |
code := code withCRs. |
|
2586 |
(ReadStream on:code) fileIn. |
|
2587 |
||
1669 | 2588 |
self isStandAlone ifTrue:[ |
2188 | 2589 |
self helpTool doSave |
1669 | 2590 |
]. |
699 | 2591 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2592 |
self updateHistory. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2593 |
hasSaved := true. |
1971 | 2594 |
self clearModified. |
199 | 2595 |
! |
2596 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2597 |
doSaveAs |
1606 | 2598 |
"save current editing menu to class and selector |
2599 |
defined by the user. |
|
2600 |
" |
|
2601 |
super doSaveAs ifTrue:[ |
|
2602 |
listOfItems root rawLabel:specSelector |
|
2603 |
]. |
|
2604 |
! |
|
2605 |
||
2606 |
doShowMenuSpec |
|
2607 |
"opens a code view with the contents of the menu spec |
|
2608 |
" |
|
2609 |
|spec| |
|
2610 |
||
2611 |
spec := self generateMenuSpec. |
|
2612 |
||
2613 |
spec ifNotNil:[ |
|
2188 | 2614 |
CodeView openWith:spec title: 'Menu Spec' |
1606 | 2615 |
]. |
1971 | 2616 |
! |
2617 |
||
2618 |
save |
|
2619 |
self doSave |
|
1606 | 2620 |
! ! |
2621 |
||
1715 | 2622 |
!MenuEditor methodsFor:'user actions-creation'! |
1606 | 2623 |
|
2624 |
doCreateDelayedMenu:what |
|
2625 |
|selectedItem delayedItem| |
|
2626 |
||
2627 |
selectedItem := self selectedItem. |
|
2151 | 2628 |
selectedItem isNil ifTrue:[^ self]. |
1606 | 2629 |
|
2630 |
selectedItem canAddDelayedMenu ifFalse:[ ^ self ]. |
|
2631 |
self askForItemModification ifFalse:[ ^ self ]. |
|
2632 |
||
1633 | 2633 |
what == #menu ifTrue:[ delayedItem := RegularMenuItem new ] |
2188 | 2634 |
ifFalse:[ delayedItem := LinkedMenuItem new ]. |
1606 | 2635 |
|
2636 |
delayedItem setExpanded:true. |
|
2637 |
delayedItem := selectedItem add:delayedItem. |
|
2638 |
||
2639 |
delayedItem ifNotNil:[ |
|
2188 | 2640 |
self selectedItem:delayedItem. |
1606 | 2641 |
]. |
2642 |
! |
|
2643 |
||
2644 |
doCreateItem |
|
2645 |
"create a new Item |
|
2646 |
" |
|
1702 | 2647 |
self addAndSelectValueOf:[ ActionItem new translateLabel:true ]. |
1606 | 2648 |
! |
2649 |
||
2650 |
doCreateLinkedMenu |
|
2651 |
"create a new Linked Menu |
|
2652 |
" |
|
1702 | 2653 |
self addAndSelectValueOf:[ LinkedMenuItem new ]. |
1606 | 2654 |
! |
2655 |
||
2656 |
doCreateMenu |
|
2657 |
"create a new Menu |
|
2658 |
" |
|
1702 | 2659 |
self addAndSelectValueOf: |
2188 | 2660 |
[ |item| |
2661 |
item := RegularMenuItem new. |
|
2662 |
"/ --- do not add it expanded - because that makes it hard to add multipe menus |
|
2663 |
"/ item expand. |
|
2664 |
item |
|
2665 |
]. |
|
1606 | 2666 |
! |
2667 |
||
1844 | 2668 |
doCreateMenuSliceItem |
2669 |
"create a new MenuSlice Item |
|
2670 |
" |
|
2671 |
self addAndSelectValueOf:[ MenuSliceItem new ]. |
|
2672 |
! |
|
2673 |
||
1606 | 2674 |
doCreateSep |
2675 |
"create a new Separator Item |
|
2676 |
" |
|
1702 | 2677 |
self addAndSelectValueOf:[ SeparatorItem new ]. |
1606 | 2678 |
! |
2679 |
||
2680 |
doCreateStandardEditMenu |
|
2681 |
"create a standart edit menu |
|
2682 |
" |
|
1702 | 2683 |
self addAndSelectValueOf:[ |
2188 | 2684 |
RegularMenuItem menu:(self class standardEditMenu) labeled:'Edit' translateLabel:true |
1606 | 2685 |
]. |
218 | 2686 |
! |
199 | 2687 |
|
1606 | 2688 |
doCreateStandardFileMenu |
2689 |
"create a standart file menu |
|
2690 |
" |
|
1702 | 2691 |
self addAndSelectValueOf:[ |
2188 | 2692 |
RegularMenuItem menu:(self class standardFileMenu) labeled:'File' translateLabel:true |
1606 | 2693 |
]. |
2694 |
! |
|
2695 |
||
2696 |
doCreateStandardHelpMenu |
|
2697 |
"create a standart help menu |
|
2698 |
" |
|
2699 |
|item| |
|
2700 |
||
1702 | 2701 |
self addAndSelectValueOf:[ |
2188 | 2702 |
item := RegularMenuItem menu:(self class standardHelpMenu) labeled:'Help' translateLabel:true. |
2703 |
item aspectAt:#startGroup put:#conditionalRight. |
|
2704 |
item |
|
1606 | 2705 |
]. |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
2706 |
|
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
2707 |
"Modified: / 16-10-2006 / 12:49:27 / cg" |
1606 | 2708 |
! ! |
2709 |
||
1715 | 2710 |
!MenuEditor methodsFor:'user actions-editing'! |
1606 | 2711 |
|
2712 |
doCopy |
|
2713 |
"copy selected menuItems to the clipboard |
|
2714 |
" |
|
2715 |
|clip items| |
|
2716 |
||
2717 |
items := self selectedSuperItems. |
|
2718 |
items isEmpty ifTrue:[ ^ self ]. |
|
2719 |
||
2720 |
clip := OrderedCollection new. |
|
2721 |
items do:[:el| clip add:(el menuItem) ]. |
|
2722 |
||
2723 |
self clipboard:clip. |
|
2724 |
self updateAllToolInstances. |
|
2725 |
! |
|
2726 |
||
2727 |
doCut |
|
2728 |
"copy selected menuItems to the clipboard and delete |
|
2729 |
" |
|
2730 |
self doCopy. |
|
2731 |
self doDelete. |
|
2732 |
! |
|
2733 |
||
2734 |
doDelete |
|
2735 |
"delete selected menuItems |
|
2736 |
" |
|
2737 |
|selectedItem parent toDelete behind nextItem prevItem| |
|
2738 |
||
2739 |
toDelete := self selectedSuperItems. |
|
2740 |
toDelete isEmpty ifTrue:[ ^ self ]. |
|
2741 |
||
2742 |
self clearModified. |
|
2743 |
||
2744 |
selectedItem := toDelete first. |
|
2745 |
||
2746 |
selectedItem isRootItem ifTrue:[ |
|
2188 | 2747 |
^ selectedItem removeAll. |
1606 | 2748 |
]. |
2749 |
"/ compute the new selection |
|
2750 |
||
2751 |
prevItem := parent := selectedItem parent. |
|
2752 |
nextItem := nil. |
|
2753 |
||
2754 |
parent children size ~~ 1 ifTrue:[ |
|
2188 | 2755 |
behind := false. |
2756 |
||
2757 |
parent do:[:el| |
|
2758 |
behind ifTrue:[ |
|
2759 |
(nextItem notNil or:[toDelete includesIdentical:el]) ifFalse:[ nextItem := el ]. |
|
2760 |
] ifFalse:[ |
|
2761 |
behind := el == selectedItem. |
|
2762 |
(behind or:[toDelete includesIdentical:el]) ifFalse:[ prevItem := el ]. |
|
2763 |
] |
|
2764 |
] |
|
1606 | 2765 |
]. |
2766 |
self withoutNotifyDo:[ |
|
2188 | 2767 |
toDelete do:[:el| el remove ]. |
1606 | 2768 |
]. |
2769 |
self selectedItem:(nextItem ? prevItem). |
|
1971 | 2770 |
self setModified. |
1606 | 2771 |
self updateChannels. |
2772 |
! |
|
2773 |
||
2774 |
doPaste |
|
2775 |
"paste from clipboard |
|
2776 |
" |
|
2777 |
^ self doPaste:(self clipboard) |
|
218 | 2778 |
! |
2779 |
||
1606 | 2780 |
doPaste:aCollection |
2781 |
"paste collection of MenuItems |
|
2782 |
" |
|
2783 |
|item loMenuItems| |
|
2784 |
||
2785 |
aCollection size == 0 ifTrue:[ ^ self ]. |
|
2786 |
||
2787 |
item := self selectedItem. |
|
2151 | 2788 |
item isNil ifTrue:[ ^ self ]. |
1606 | 2789 |
|
2790 |
loMenuItems := OrderedCollection new. |
|
2791 |
aCollection do:[:el| |
|
2188 | 2792 |
(el askFor:#isMenuItem) ifTrue:[ loMenuItems add:el ]. |
1606 | 2793 |
]. |
2794 |
loMenuItems isEmpty ifTrue:[ ^ self ]. |
|
2795 |
||
1702 | 2796 |
self addAndSelectValueOf:[ |
2188 | 2797 |
loMenuItems collect:[:el| Item menuItem:el ] |
1606 | 2798 |
]. |
2799 |
! ! |
|
2800 |
||
1715 | 2801 |
!MenuEditor methodsFor:'user actions-hierarchy'! |
1606 | 2802 |
|
1958 | 2803 |
doMoveDown |
2804 |
"move selected item down" |
|
2805 |
||
2806 |
self doMoveUpOrDown:#down |
|
2807 |
! |
|
2808 |
||
1606 | 2809 |
doMoveIn:aDirection |
2810 |
"move selected item into the next (#inNext) or previous (#inPrev) item |
|
2811 |
" |
|
2812 |
|item idx parent toParent| |
|
2813 |
||
2814 |
item := self selectedItem. |
|
2151 | 2815 |
item isNil ifTrue:[^ self]. |
1606 | 2816 |
|
2817 |
aDirection == #inNext ifTrue:[ item canMoveInNext ifFalse:[^ self] ] |
|
2188 | 2818 |
ifFalse:[ item canMoveInAbove ifFalse:[^ self] ]. |
1606 | 2819 |
|
2820 |
self askForItemModification ifFalse:[ ^ self ]. |
|
2821 |
||
2822 |
parent := item parent. |
|
2823 |
idx := parent identityIndexOf:item. |
|
2824 |
||
2825 |
aDirection == #inNext ifTrue:[ toParent := parent at:(idx + 1) ifAbsent:nil ] |
|
2188 | 2826 |
ifFalse:[ toParent := parent at:(idx - 1) ifAbsent:nil ]. |
1606 | 2827 |
|
2828 |
self withoutNotifyDo:[ |
|
2188 | 2829 |
selectionHolder setValue:#(). |
2830 |
parent removeIndex:idx. |
|
2831 |
||
2832 |
aDirection == #inNext ifTrue:[ toParent addFirst:item ] |
|
2833 |
ifFalse:[ toParent addLast:item ]. |
|
2834 |
item makeVisible. |
|
1606 | 2835 |
]. |
2836 |
self selectedItem:item. |
|
1971 | 2837 |
self setModified. |
1468 | 2838 |
! |
2839 |
||
1958 | 2840 |
doMoveInNext |
2841 |
"move selected item into the next item" |
|
2842 |
||
2843 |
self doMoveIn:#inNext. |
|
2844 |
! |
|
2845 |
||
2846 |
doMoveInPrevious |
|
2847 |
"move selected item into the previous item" |
|
2848 |
||
2849 |
self doMoveIn:#inPrev. |
|
2850 |
! |
|
2851 |
||
1606 | 2852 |
doMoveOut |
2853 |
"move selected item out of current item |
|
2854 |
" |
|
2855 |
|item parent grandParent index| |
|
2856 |
||
2857 |
item := self selectedItem. |
|
2151 | 2858 |
item isNil ifTrue:[^ self]. |
1606 | 2859 |
item canMoveOut ifFalse:[^ self]. |
2860 |
||
2861 |
self askForItemModification ifFalse:[ ^ self ]. |
|
2862 |
||
2863 |
parent := item parent. |
|
2864 |
grandParent := parent parent. |
|
2865 |
index := grandParent identityIndexOf:parent. |
|
2866 |
||
2867 |
self withoutNotifyDo:[ |
|
2188 | 2868 |
selectionHolder setValue:#(). |
2869 |
parent remove:item. |
|
2870 |
index > grandParent size ifTrue:[ grandParent add:item ] |
|
2871 |
ifFalse:[ grandParent add:item afterIndex:index ] |
|
1606 | 2872 |
]. |
2873 |
self selectedItem:item. |
|
1971 | 2874 |
self setModified. |
218 | 2875 |
! |
2876 |
||
1958 | 2877 |
doMoveUp |
2878 |
"move selected item up" |
|
2879 |
||
2880 |
self doMoveUpOrDown:#up |
|
2881 |
! |
|
2882 |
||
1606 | 2883 |
doMoveUpOrDown:aDirection |
2884 |
"move selected item up (#up) or down (#down) |
|
2885 |
" |
|
2886 |
|item index parent children| |
|
2887 |
||
2888 |
item := self selectedItem. |
|
2151 | 2889 |
item isNil ifTrue:[^ self]. |
1606 | 2890 |
item canMoveUpOrDown ifFalse:[^ self]. |
2891 |
||
2892 |
self askForItemModification ifFalse:[ ^ self ]. |
|
2893 |
||
2894 |
self withoutNotifyDo:[ |
|
2188 | 2895 |
parent := item parent. |
2896 |
children := parent children. |
|
2897 |
index := children identityIndexOf:item. |
|
2898 |
||
2899 |
selectionHolder setValue:#(). |
|
2900 |
children removeIndex:index. |
|
2901 |
||
2902 |
aDirection == #up ifTrue:[ |
|
2903 |
index == 1 ifTrue:[ children add:item ] |
|
2904 |
ifFalse:[ children add:item beforeIndex:index - 1 ] |
|
2905 |
] ifFalse:[ |
|
2906 |
index > children size ifTrue:[ children addFirst:item ] |
|
2907 |
ifFalse:[ children add:item afterIndex:index ] |
|
2908 |
]. |
|
2909 |
parent childrenOrderChanged. |
|
1606 | 2910 |
]. |
2911 |
self selectedItem:item. |
|
1971 | 2912 |
self setModified. |
199 | 2913 |
! ! |
2914 |
||
1606 | 2915 |
!MenuEditor::Item class methodsFor:'defaults'! |
2916 |
||
2917 |
defaultLabel |
|
2918 |
^ self subclassResponsibility |
|
2919 |
! ! |
|
2920 |
||
2921 |
!MenuEditor::Item class methodsFor:'image specs'! |
|
2922 |
||
2923 |
iconDelayedLinkedMenu |
|
2924 |
"This resource specification was automatically generated |
|
2925 |
by the ImageEditor of ST/X." |
|
2926 |
||
2927 |
"Do not manually edit this!! If it is corrupted, |
|
2928 |
the ImageEditor may not be able to read the specification." |
|
2929 |
||
2930 |
" |
|
2931 |
self iconDelayedLinkedMenu inspect |
|
2932 |
ImageEditor openOnClass:self andSelector:#iconDelayedLinkedMenu |
|
2933 |
Icon flushCachedIcons |
|
2934 |
" |
|
2935 |
||
2936 |
<resource: #image> |
|
2937 |
||
2938 |
^Icon |
|
2270 | 2939 |
constantNamed:'MenuEditor::Item class iconDelayedLinkedMenu' |
2940 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
2941 |
@@@@@@@@@@@@@@DQDQDQDQDQDR@AH"H"H"H"H"H0@@@BH"H"@@@BL@QDPBH"H"@@H#@DQDPBH@H"@"H0ADQDPBA@H"H"L@@@QDP@Q@@@@C@ADPQDQDQ@DQD: |
|
2942 |
@RH QDQDQ@H"L@D"H QDQD@"H#@A@@@@@DP@@@@0@QDQDQA@DQDQL@D"H"H @"H"H#@BL3L3L3L3L3L0@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127 255 0 0]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0') ; yourself); yourself] |
|
1606 | 2943 |
! |
2944 |
||
2945 |
iconDelayedMenu |
|
2946 |
"This resource specification was automatically generated |
|
2947 |
by the ImageEditor of ST/X." |
|
2948 |
||
2949 |
"Do not manually edit this!! If it is corrupted, |
|
2950 |
the ImageEditor may not be able to read the specification." |
|
2951 |
||
2952 |
" |
|
2953 |
self iconDelayedMenu inspect |
|
2954 |
ImageEditor openOnClass:self andSelector:#iconDelayedMenu |
|
2955 |
Icon flushCachedIcons |
|
2956 |
" |
|
2957 |
||
2958 |
<resource: #image> |
|
2959 |
||
2960 |
^Icon |
|
2270 | 2961 |
constantNamed:'MenuEditor::Item class iconDelayedMenu' |
2962 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@UUUUUVA*****,F***@B0Z***@+A****J,F*****0@@@@@@AUUUUUXF*****0Z****+A@@@@@LEUUUUU0Z****+B?????<@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0') ; yourself); yourself] |
|
1606 | 2963 |
! |
2964 |
||
2965 |
iconItem |
|
2966 |
"This resource specification was automatically generated |
|
2967 |
by the ImageEditor of ST/X." |
|
2968 |
||
2969 |
"Do not manually edit this!! If it is corrupted, |
|
2970 |
the ImageEditor may not be able to read the specification." |
|
2971 |
||
2972 |
" |
|
2973 |
self iconItem inspect |
|
2974 |
ImageEditor openOnClass:self andSelector:#iconItem |
|
2975 |
Icon flushCachedIcons |
|
2976 |
" |
|
2977 |
||
2978 |
<resource: #image> |
|
2979 |
||
2980 |
^Icon |
|
2270 | 2981 |
constantNamed:'MenuEditor::Item class iconItem' |
2982 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUUUUUUUP@@@@@@EUUUUU Z****+A.?/;+,F:::/>0[++>:;A...++,F::?..0Z****+B?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
|
1606 | 2983 |
! |
2984 |
||
2985 |
iconLinkedMenu |
|
2986 |
"This resource specification was automatically generated |
|
2987 |
by the ImageEditor of ST/X." |
|
2988 |
||
2989 |
"Do not manually edit this!! If it is corrupted, |
|
2990 |
the ImageEditor may not be able to read the specification." |
|
2991 |
||
2992 |
" |
|
2993 |
self iconLinkedMenu inspect |
|
2994 |
ImageEditor openOnClass:self andSelector:#iconLinkedMenu |
|
2995 |
Icon flushCachedIcons |
|
2996 |
" |
|
2997 |
||
2998 |
<resource: #image> |
|
2999 |
||
3000 |
^Icon |
|
2270 | 3001 |
constantNamed:'MenuEditor::Item class iconLinkedMenu' |
3002 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1606 | 3003 |
@@@@@@@@@@@@@@QDQDQDQDQDQA@DH"H"H"H"H"HPABH@@@H"H"H"D@PQ@3L0DQDQDQ@D@@L3L0@@@@@PADPCL3L0PCADD@P"@@@3L0@3@!!@DH"H"@3L3L3@P |
2270 | 3004 |
AADQDQ@3L3L3@@P@@@@@@3L3LA@DQDQDQD@@L0PPABH"H"H"HC@"D@P"H"H"H"@BH!!@BDQDQDQDQDQDP@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 127 127 127 170 170 170 255 0 0 255 255 255]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0') ; yourself); yourself] |
1606 | 3005 |
! |
3006 |
||
3007 |
iconMenu |
|
3008 |
"This resource specification was automatically generated |
|
3009 |
by the ImageEditor of ST/X." |
|
3010 |
||
3011 |
"Do not manually edit this!! If it is corrupted, |
|
3012 |
the ImageEditor may not be able to read the specification." |
|
3013 |
||
3014 |
" |
|
3015 |
self iconMenu inspect |
|
3016 |
ImageEditor openOnClass:self andSelector:#iconMenu |
|
3017 |
Icon flushCachedIcons |
|
3018 |
" |
|
3019 |
||
3020 |
<resource: #image> |
|
3021 |
||
3022 |
^Icon |
|
2270 | 3023 |
constantNamed:'MenuEditor::Item class iconMenu' |
3024 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@?????=C*****$N*****P5UUUUUC@@@@@DO?????P:****)C*****$MUUUUUP0@@@@AC?????4N*****P:****)BUUUUUT@@@@@@@b') ; colorMapFromArray:#[0 0 0 127 127 127 170 170 170 255 255 255]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0???0') ; yourself); yourself] |
|
1606 | 3025 |
! |
3026 |
||
3027 |
iconSeparator |
|
3028 |
"This resource specification was automatically generated |
|
3029 |
by the ImageEditor of ST/X." |
|
3030 |
||
3031 |
"Do not manually edit this!! If it is corrupted, |
|
3032 |
the ImageEditor may not be able to read the specification." |
|
3033 |
||
3034 |
" |
|
3035 |
self iconSeparator inspect |
|
3036 |
ImageEditor openOnClass:self andSelector:#iconSeparator |
|
3037 |
Icon flushCachedIcons |
|
3038 |
" |
|
3039 |
||
3040 |
<resource: #image> |
|
3041 |
||
3042 |
^Icon |
|
2270 | 3043 |
constantNamed:'MenuEditor::Item class iconSeparator' |
3044 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUUUUUUUP@@@@@@EUUUUU Z****+A*****,F????:0[@@@@[A)UUUU,F*****0Z****+B?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
|
1844 | 3045 |
! |
3046 |
||
3047 |
iconSliceMenu |
|
3048 |
"This resource specification was automatically generated |
|
3049 |
by the ImageEditor of ST/X." |
|
3050 |
||
3051 |
"Do not manually edit this!! If it is corrupted, |
|
3052 |
the ImageEditor may not be able to read the specification." |
|
3053 |
||
3054 |
" |
|
3055 |
self iconSliceMenu inspect |
|
3056 |
ImageEditor openOnClass:self andSelector:#iconSliceMenu |
|
3057 |
Icon flushCachedIcons |
|
3058 |
" |
|
3059 |
||
3060 |
<resource: #image> |
|
3061 |
||
3062 |
^Icon |
|
2270 | 3063 |
constantNamed:'MenuEditor::Item class iconSliceMenu' |
3064 |
ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@O?????0:*****C/?6??XN:*[*) ;*).*&C.*&:*XN5U[UU :*****C*****(@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 127 127 127 170 170 170 255 255 255]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
|
1606 | 3065 |
! ! |
3066 |
||
3067 |
!MenuEditor::Item class methodsFor:'instance creation'! |
|
3068 |
||
3069 |
classFor:aMenuItem |
|
3070 |
||
1631 | 3071 |
aMenuItem isNil ifTrue:[ ^ nil ]. |
3072 |
||
3073 |
aMenuItem itemValue isNil ifTrue:[ |
|
2188 | 3074 |
aMenuItem isMenuSlice ifTrue:[ ^ MenuEditor::MenuSliceItem ]. |
3075 |
aMenuItem submenu notNil ifTrue:[ ^ MenuEditor::RegularMenuItem ]. |
|
3076 |
aMenuItem submenuChannel notNil ifTrue:[ ^ MenuEditor::LinkedMenuItem ]. |
|
3077 |
||
3078 |
(self separatorTypeOf:(aMenuItem rawLabel)) notNil ifTrue:[ |
|
3079 |
^ MenuEditor::SeparatorItem |
|
3080 |
] |
|
1606 | 3081 |
]. |
1631 | 3082 |
^ MenuEditor::ActionItem |
1454 | 3083 |
! |
3084 |
||
1606 | 3085 |
menuItem:aMenuItem |
3086 |
|item cls| |
|
3087 |
||
3088 |
cls := self classFor:aMenuItem. |
|
2151 | 3089 |
cls isNil ifTrue:[^ nil]. |
1606 | 3090 |
|
3091 |
item := cls new. |
|
3092 |
item menuItem:aMenuItem. |
|
2151 | 3093 |
^ item |
1606 | 3094 |
! ! |
3095 |
||
1668 | 3096 |
!MenuEditor::Item class methodsFor:'interface specs'! |
1606 | 3097 |
|
3098 |
detailsEditSpec |
|
3099 |
"This resource specification was automatically generated |
|
3100 |
by the UIPainter of ST/X." |
|
3101 |
||
3102 |
"Do not manually edit this!! If it is corrupted, |
|
3103 |
the UIPainter may not be able to read the specification." |
|
3104 |
||
3105 |
" |
|
3106 |
UIPainter new openOnClass:MenuEditor::Item andSelector:#detailsEditSpec |
|
3107 |
" |
|
3108 |
||
3109 |
<resource: #canvas> |
|
3110 |
||
2188 | 3111 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3112 |
#(FullSpec |
2189 | 3113 |
name: detailsEditSpec |
3114 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3115 |
(WindowSpec |
2189 | 3116 |
label: 'Details Edit' |
3117 |
name: 'Details Edit' |
|
3118 |
min: (Point 10 10) |
|
3119 |
bounds: (Rectangle 0 0 407 291) |
|
3120 |
) |
|
3121 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3122 |
(SpecCollection |
2189 | 3123 |
collection: ( |
3124 |
(LabelSpec |
|
3125 |
label: 'Accelerator:' |
|
3126 |
name: 'shortcutKeyLabel' |
|
3127 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
3128 |
activeHelpKey: detailsAccelerator |
|
3129 |
translateLabel: true |
|
3130 |
resizeForLabel: true |
|
3131 |
adjust: right |
|
3132 |
) |
|
3133 |
(InputFieldSpec |
|
3134 |
name: 'shortcutKeyField' |
|
3135 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
3136 |
activeHelpKey: detailsAccelerator |
|
3137 |
tabable: true |
|
3138 |
model: shortcutKeyCharacter |
|
3139 |
group: inputGroup |
|
3140 |
type: symbolOrNil |
|
3141 |
immediateAccept: false |
|
3142 |
acceptOnReturn: true |
|
3143 |
acceptOnTab: true |
|
3144 |
acceptChannel: acceptChannel |
|
3145 |
modifiedChannel: modifiedChannel |
|
3146 |
acceptOnPointerLeave: false |
|
3147 |
) |
|
3148 |
(LabelSpec |
|
3149 |
label: 'Enabled:' |
|
3150 |
name: 'enabledLabel' |
|
3151 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
3152 |
activeHelpKey: detailsEnabled |
|
3153 |
translateLabel: true |
|
3154 |
resizeForLabel: true |
|
3155 |
adjust: right |
|
3156 |
) |
|
3157 |
(InputFieldSpec |
|
3158 |
name: 'enabledField' |
|
3159 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
3160 |
activeHelpKey: detailsEnabled |
|
3161 |
tabable: true |
|
3162 |
model: enabled |
|
3163 |
group: inputGroup |
|
3164 |
type: symbolOrBooleanOrNil |
|
3165 |
immediateAccept: false |
|
3166 |
acceptOnReturn: true |
|
3167 |
acceptOnTab: true |
|
3168 |
acceptChannel: acceptChannel |
|
3169 |
modifiedChannel: modifiedChannel |
|
3170 |
acceptOnPointerLeave: false |
|
3171 |
) |
|
3172 |
(LabelSpec |
|
3173 |
label: 'Visibility:' |
|
3174 |
name: 'visibilityLabel' |
|
3175 |
layout: (AlignmentOrigin 107 0 76 0 1 0.5) |
|
3176 |
activeHelpKey: detailsVisibility |
|
3177 |
translateLabel: true |
|
3178 |
resizeForLabel: true |
|
3179 |
adjust: right |
|
3180 |
) |
|
3181 |
(InputFieldSpec |
|
3182 |
name: 'isVisibleInputField' |
|
3183 |
layout: (LayoutFrame 110 0 65 0 -5 1.0 87 0) |
|
3184 |
activeHelpKey: detailsVisibility |
|
3185 |
tabable: true |
|
3186 |
model: isVisible |
|
3187 |
group: inputGroup |
|
3188 |
type: symbolOrBooleanOrNil |
|
3189 |
immediateAccept: false |
|
3190 |
acceptOnReturn: true |
|
3191 |
acceptOnTab: true |
|
3192 |
acceptChannel: acceptChannel |
|
3193 |
modifiedChannel: modifiedChannel |
|
3194 |
acceptOnPointerLeave: false |
|
3195 |
) |
|
3196 |
(LabelSpec |
|
3197 |
label: 'Aux Value' |
|
3198 |
name: 'auxLabel' |
|
3199 |
layout: (AlignmentOrigin 107 0 101 0 1 0.5) |
|
3200 |
activeHelpKey: detailsAuxValue |
|
3201 |
translateLabel: true |
|
3202 |
resizeForLabel: true |
|
3203 |
adjust: right |
|
3204 |
) |
|
3205 |
(InputFieldSpec |
|
3206 |
name: 'auxInputField' |
|
3207 |
layout: (LayoutFrame 110 0 90 0 -5 1.0 112 0) |
|
3208 |
activeHelpKey: detailsAuxValue |
|
3209 |
tabable: true |
|
3210 |
model: auxValue |
|
3211 |
group: inputGroup |
|
3212 |
type: smalltalkObjectOrNil |
|
3213 |
immediateAccept: false |
|
3214 |
acceptOnReturn: true |
|
3215 |
acceptOnTab: true |
|
3216 |
acceptChannel: acceptChannel |
|
3217 |
modifiedChannel: modifiedChannel |
|
3218 |
acceptOnPointerLeave: false |
|
3219 |
) |
|
3220 |
(LabelSpec |
|
3221 |
label: 'Start Group:' |
|
3222 |
name: 'StartGroupLabel' |
|
3223 |
layout: (AlignmentOrigin 107 0 139 0 1 0.5) |
|
3224 |
activeHelpKey: detailsStartGroup |
|
3225 |
translateLabel: true |
|
3226 |
resizeForLabel: true |
|
3227 |
adjust: right |
|
3228 |
) |
|
3229 |
(PopUpListSpec |
|
3230 |
label: 'left' |
|
3231 |
name: 'StartGroupPopUp' |
|
3232 |
layout: (LayoutFrame 110 0 128 0 -5 1.0 150 0) |
|
3233 |
activeHelpKey: detailsStartGroup |
|
3234 |
tabable: true |
|
3235 |
model: startGroup |
|
3236 |
menu: (left right conditionalRight) |
|
3237 |
) |
|
3238 |
(LabelSpec |
|
3239 |
label: 'Access Character Position:' |
|
3240 |
name: 'accessCharLabel' |
|
3241 |
layout: (AlignmentOrigin 217 0 170 0 1 0.5) |
|
3242 |
translateLabel: true |
|
3243 |
resizeForLabel: true |
|
3244 |
adjust: right |
|
3245 |
) |
|
3246 |
(InputFieldSpec |
|
3247 |
name: 'accessCharField' |
|
3248 |
layout: (LayoutFrame 220 0 159 0 -5 1.0 181 0) |
|
3249 |
activeHelpKey: detailsAccessCharaterPosition |
|
3250 |
tabable: true |
|
3251 |
model: accessCharacterPosition |
|
3252 |
group: inputGroup |
|
3253 |
type: numberOrNil |
|
3254 |
immediateAccept: false |
|
3255 |
acceptOnReturn: true |
|
3256 |
acceptOnTab: true |
|
3257 |
acceptChannel: acceptChannel |
|
3258 |
modifiedChannel: modifiedChannel |
|
3259 |
acceptOnPointerLeave: false |
|
3260 |
) |
|
3261 |
(CheckBoxSpec |
|
3262 |
label: 'Ignore Accelerator (i.e. Display Only)' |
|
3263 |
name: 'ignoreShortcutKeysInItem' |
|
3264 |
layout: (AlignmentOrigin 42 0 204 0 0 0.5) |
|
3265 |
activeHelpKey: detailsIgnoreAcceleratorKeys |
|
3266 |
visibilityChannel: hasNoSubmenu |
|
3267 |
model: ignoreShortcutKeys |
|
3268 |
translateLabel: true |
|
3269 |
resizeForLabel: true |
|
3270 |
) |
|
3271 |
(CheckBoxSpec |
|
3272 |
label: 'Ignore Accelerators in Submenu' |
|
3273 |
name: 'ignoreShortcutKeys' |
|
3274 |
layout: (AlignmentOrigin 42 0 204 0 0 0.5) |
|
3275 |
activeHelpKey: detailsIgnoreAcceleratorKeys |
|
3276 |
visibilityChannel: hasSubmenu |
|
3277 |
model: ignoreShortcutKeys |
|
3278 |
translateLabel: true |
|
3279 |
resizeForLabel: true |
|
3280 |
) |
|
3281 |
(CheckBoxSpec |
|
3282 |
label: 'Ignore Mnemonics in Submenu' |
|
3283 |
name: 'ignoreMnemonicKeys' |
|
3284 |
layout: (AlignmentOrigin 42 0 232 0 0 0.5) |
|
3285 |
activeHelpKey: detailsIgnoreMnemonicKeys |
|
3286 |
visibilityChannel: hasSubmenu |
|
3287 |
model: ignoreMnemonicKeys |
|
3288 |
translateLabel: true |
|
3289 |
resizeForLabel: true |
|
3290 |
) |
|
3291 |
(LabelSpec |
|
3292 |
label: 'Font:' |
|
3293 |
name: 'fontLabel' |
|
3294 |
layout: (AlignmentOrigin 107 0 271 0 1 0.5) |
|
3295 |
translateLabel: true |
|
3296 |
resizeForLabel: true |
|
3297 |
adjust: right |
|
3298 |
) |
|
3299 |
(FontMenuSpec |
|
3300 |
attributes: |
|
3301 |
(tabable |
|
3302 |
true |
|
3303 |
) |
|
3304 |
name: 'fontMenu' |
|
3305 |
layout: (LayoutFrame 110 0 260 0 -5 1.0 282 0) |
|
3306 |
activeHelpKey: fontMenu |
|
3307 |
model: font |
|
3308 |
) |
|
3309 |
) |
|
3310 |
||
3311 |
) |
|
1454 | 3312 |
) |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
3313 |
|
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
3314 |
"Modified: / 16-10-2006 / 12:48:12 / cg" |
1454 | 3315 |
! ! |
3316 |
||
1725 | 3317 |
!MenuEditor::Item class methodsFor:'interface-editor'! |
3318 |
||
3319 |
addBindingsTo:aspects for:aMenuEditor |
|
3320 |
"add additional bindings to the aspects |
|
3321 |
" |
|
3322 |
aspects at:#notDelayedMenu ifAbsentPut:[ |
|
2188 | 3323 |
true asValue |
1725 | 3324 |
]. |
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
3325 |
aspects at:#hasSubmenu ifAbsentPut:[ |
2188 | 3326 |
false asValue |
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
3327 |
]. |
2010
f5f5a961cfa8
ignoreShortcutKeys also blocks individual items
Claus Gittinger <cg@exept.de>
parents:
2008
diff
changeset
|
3328 |
aspects at:#hasNoSubmenu ifAbsentPut:[ |
2188 | 3329 |
true asValue |
2010
f5f5a961cfa8
ignoreShortcutKeys also blocks individual items
Claus Gittinger <cg@exept.de>
parents:
2008
diff
changeset
|
3330 |
]. |
1725 | 3331 |
! ! |
3332 |
||
1606 | 3333 |
!MenuEditor::Item class methodsFor:'testing'! |
3334 |
||
3335 |
separatorTypeOf:aString |
|
3336 |
|size first| |
|
3337 |
||
3338 |
size := aString size. |
|
3339 |
||
3340 |
size == 0 ifTrue:[ ^ #blank ]. |
|
3341 |
||
3342 |
size == 1 ifTrue:[ |
|
3343 |
first := aString first. |
|
3344 |
first == $- ifTrue:[ ^ #single ]. |
|
3345 |
first == $= ifTrue:[ ^ #double ]. |
|
3346 |
first == (Character space) ifTrue:[ ^ #blank ]. |
|
3347 |
]. |
|
3348 |
^ nil |
|
1454 | 3349 |
! ! |
3350 |
||
3351 |
!MenuEditor::Item methodsFor:'accessing'! |
|
3352 |
||
1606 | 3353 |
children |
3354 |
"optimize access; do not ask the model for unspecified children |
|
3355 |
" |
|
3356 |
^ children |
|
3357 |
! |
|
3358 |
||
3359 |
menuItem |
|
3360 |
"returns self as a MenuItem |
|
3361 |
" |
|
2168 | 3362 |
^ MenuItem decodeFromLiteralArray:(menuItem literalArrayEncoding). |
3363 |
||
3364 |
"Modified: / 27-03-2007 / 08:43:14 / cg" |
|
1606 | 3365 |
! |
3366 |
||
3367 |
menuItem:aMenuItem |
|
3368 |
"rebuild self from a MenuItem |
|
3369 |
" |
|
3370 |
|value| |
|
3371 |
||
3372 |
menuItem := MenuItem labeled:(self rawLabel). |
|
3373 |
||
3374 |
MenuEditor aspects do:[:aKey| |
|
2188 | 3375 |
value := self validateValue:(aMenuItem perform:aKey). |
3376 |
||
3377 |
value notNil ifTrue:[ |
|
3378 |
self aspectAt:aKey put:value. |
|
3379 |
]. |
|
1606 | 3380 |
]. |
3381 |
! |
|
3382 |
||
3383 |
rawLabel |
|
3384 |
"returns the label assigned to the item |
|
3385 |
" |
|
3386 |
^ menuItem rawLabel |
|
3387 |
! |
|
3388 |
||
3389 |
rawLabel:aValue |
|
3390 |
"set the label assigned to the item |
|
3391 |
" |
|
3392 |
aValue isString ifTrue:[ |
|
2188 | 3393 |
"/ KLUDGE alarm: '-' and '' indicate a separator |
3394 |
"/ (there is no separate menuItem class for them) |
|
3395 |
||
3396 |
(self isKindOfMenu or:[(self class separatorTypeOf:aValue) isNil]) ifTrue:[ |
|
3397 |
menuItem rawLabel:aValue |
|
3398 |
] |
|
1606 | 3399 |
]. |
3400 |
! |
|
3401 |
||
3402 |
slices |
|
3403 |
"returns a sequence of supported slices |
|
3404 |
" |
|
3405 |
^ self subclassResponsibility |
|
1454 | 3406 |
! |
3407 |
||
1606 | 3408 |
submenu |
3409 |
"returns the submenu (of class Menu) or nil |
|
3410 |
" |
|
3411 |
^ nil |
|
1631 | 3412 |
! |
3413 |
||
3414 |
translateLabel:aBoolean |
|
3415 |
menuItem translateLabel:aBoolean |
|
1606 | 3416 |
! ! |
3417 |
||
3418 |
!MenuEditor::Item methodsFor:'aspects'! |
|
3419 |
||
3420 |
aspectAt:aKey put:aValue |
|
2075 | 3421 |
"set a specific aspect named aKey to the aValue" |
3422 |
||
1606 | 3423 |
aKey == #rawLabel ifTrue:[ ^ self rawLabel:aValue ]. |
3424 |
aKey == #submenuChannel ifTrue:[ ^ self ]. |
|
3425 |
menuItem perform:((aKey, ':') asSymbol) with:aValue. |
|
2075 | 3426 |
|
3427 |
"Modified: / 05-09-2006 / 17:47:19 / cg" |
|
1606 | 3428 |
! |
3429 |
||
3430 |
fromAspects:aspects |
|
3431 |
"read values from aspects |
|
3432 |
" |
|
3433 |
MenuEditor aspects do:[:aKey| |
|
2189 | 3434 |
self aspectAt:aKey put:((aspects at:aKey) value). |
1606 | 3435 |
]. |
2189 | 3436 |
self validateMenuItem. |
1606 | 3437 |
self changed. |
3438 |
! |
|
3439 |
||
3440 |
toAspects:aspects |
|
3441 |
"write values to aspects |
|
3442 |
" |
|
3443 |
MenuEditor aspects do:[:aKey| |
|
2188 | 3444 |
(aspects at:aKey) value:(menuItem perform:aKey) |
1606 | 3445 |
]. |
3446 |
(aspects at:#notDelayedMenu) value:(self isDelayedMenu not). |
|
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
3447 |
(aspects at:#hasSubmenu) value:(self isKindOfMenu or:[self children size ~~ 0]). |
2010
f5f5a961cfa8
ignoreShortcutKeys also blocks individual items
Claus Gittinger <cg@exept.de>
parents:
2008
diff
changeset
|
3448 |
(aspects at:#hasNoSubmenu) value:(self isKindOfMenu not ). |
2189 | 3449 |
! |
3450 |
||
3451 |
validateMenuItem |
|
3452 |
"validate the menuItem for correctness" |
|
3453 |
||
3454 |
menuItem isNil ifTrue:[^ self]. |
|
3455 |
||
3456 |
menuItem choice isEmptyOrNil ifTrue:[ |
|
3457 |
menuItem choice:nil. |
|
3458 |
menuItem choiceValue:nil. |
|
3459 |
]. |
|
1606 | 3460 |
! ! |
3461 |
||
3462 |
!MenuEditor::Item methodsFor:'displaying'! |
|
3463 |
||
3464 |
displayLabel |
|
3465 |
"returns the label on default displayed on the screen |
|
3466 |
" |
|
3467 |
^ menuItem rawLabel |
|
3468 |
! |
|
3469 |
||
3470 |
displayOn:aGC x:x y:y h:h |
|
3471 |
"display the item in the graphicsContext, aGC. |
|
3472 |
" |
|
3473 |
|label| |
|
3474 |
||
3475 |
label := self displayLabel. |
|
3476 |
||
3477 |
label notNil ifTrue:[ |
|
3478 |
self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h |
|
3479 |
]. |
|
3480 |
! |
|
3481 |
||
3482 |
heightOn:aGC |
|
3483 |
"returns the height of the label on a GC |
|
3484 |
" |
|
2151 | 3485 |
height isNil ifTrue:[ height := parent heightOn:aGC ]. |
3486 |
^ height |
|
1454 | 3487 |
! |
3488 |
||
3489 |
label |
|
1606 | 3490 |
"get the rawLabel assigned to the item |
3491 |
" |
|
3492 |
^ menuItem rawLabel |
|
1454 | 3493 |
! |
3494 |
||
1606 | 3495 |
label:aLabel |
3496 |
"set the rawLabel assigned to the item |
|
3497 |
" |
|
3498 |
self rawLabel:aLabel |
|
1454 | 3499 |
! |
3500 |
||
1606 | 3501 |
widthOn:aGC |
3502 |
"returns the height of the displayLabel on a GC |
|
3503 |
" |
|
2151 | 3504 |
width isNil ifTrue:[ width := self widthOf:(self displayLabel) on:aGC ]. |
3505 |
^ width |
|
1454 | 3506 |
! ! |
3507 |
||
1606 | 3508 |
!MenuEditor::Item methodsFor:'initialization'! |
3509 |
||
3510 |
initialize |
|
3511 |
super initialize. |
|
3512 |
menuItem := MenuItem label:(self class defaultLabel). |
|
1454 | 3513 |
! ! |
3514 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3515 |
!MenuEditor::Item methodsFor:'private'! |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3516 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3517 |
validateValue:aValue |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3518 |
"if we pick a menupanel, the values of an item can be |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3519 |
a block model, .... |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3520 |
" |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3521 |
aValue notNil ifTrue:[ |
2188 | 3522 |
aValue isBlock ifTrue:[ ^ #block ]. |
3523 |
aValue isValueModel ifTrue:[ ^ #valueModel ]. |
|
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3524 |
]. |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3525 |
^ aValue |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3526 |
! ! |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3527 |
|
1454 | 3528 |
!MenuEditor::Item methodsFor:'queries'! |
3529 |
||
1606 | 3530 |
isAction |
3531 |
"returns true if the item is an Action |
|
3532 |
" |
|
3533 |
^ false |
|
3534 |
! |
|
3535 |
||
3536 |
isDelayedMenu |
|
3537 |
"returns true if the item is a Delayed (Linked) Menu |
|
3538 |
" |
|
3539 |
^ parent isAction |
|
3540 |
! |
|
3541 |
||
3542 |
isKindOfMenu |
|
3543 |
"returns true if the item is a Linked Menu or Menu |
|
3544 |
" |
|
3545 |
^ false |
|
3546 |
! |
|
3547 |
||
1633 | 3548 |
isMenuEditItem |
3549 |
^ true |
|
3550 |
! |
|
3551 |
||
1606 | 3552 |
isRootItem |
3553 |
"returns true if the item is the root item |
|
3554 |
" |
|
3555 |
^ false |
|
3556 |
! ! |
|
3557 |
||
1660 | 3558 |
!MenuEditor::Item methodsFor:'queries-editor'! |
1614 | 3559 |
|
3560 |
actionSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3561 |
"return my action selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3562 |
|
1614 | 3563 |
|value| |
3564 |
||
3565 |
value := menuItem value. |
|
3566 |
value isSymbol ifTrue:[ ^ Array with:value ]. |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3567 |
^ #() |
1614 | 3568 |
! |
3569 |
||
3570 |
aspectSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3571 |
"return my aspect selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3572 |
|
1614 | 3573 |
|aspects| |
3574 |
||
3575 |
aspects := OrderedCollection new. |
|
3576 |
||
3577 |
#( indication choice enabled isVisible ) do:[:aKey| |sel| |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3578 |
sel := menuItem perform:aKey. |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3579 |
sel isSymbol ifTrue:[ aspects add:sel ] |
2188 | 3580 |
]. |
1614 | 3581 |
^ aspects |
3582 |
! ! |
|
3583 |
||
1660 | 3584 |
!MenuEditor::Item methodsFor:'queries-operation'! |
1606 | 3585 |
|
3586 |
canAddChildren |
|
3587 |
"returns true if children can be added |
|
3588 |
" |
|
3589 |
^ false |
|
3590 |
! |
|
3591 |
||
3592 |
canAddDelayedMenu |
|
3593 |
"returns true if a delayed menu can be added; |
|
3594 |
on default false is returned |
|
3595 |
" |
|
3596 |
^ false |
|
3597 |
! |
|
3598 |
||
3599 |
canMoveInAbove |
|
3600 |
"returns true if the item can become a child of its previous sibling |
|
3601 |
" |
|
3602 |
|siblings index nextItem| |
|
3603 |
||
3604 |
siblings := parent children. |
|
3605 |
siblings size > 1 ifFalse:[ ^ false ]. |
|
3606 |
||
3607 |
index := siblings identityIndexOf:self. |
|
3608 |
nextItem := siblings at:(index - 1) ifAbsent:nil. |
|
3609 |
||
2151 | 3610 |
nextItem isNil ifTrue:[^ false]. |
3611 |
^ nextItem canAddChildren |
|
1454 | 3612 |
! |
3613 |
||
1606 | 3614 |
canMoveInNext |
3615 |
"returns true if the item can become a child of its next sibling |
|
3616 |
" |
|
3617 |
|siblings index nextItem| |
|
3618 |
||
3619 |
siblings := parent children. |
|
3620 |
siblings size > 1 ifFalse:[ ^ false ]. |
|
3621 |
||
3622 |
index := siblings identityIndexOf:self. |
|
3623 |
nextItem := siblings at:(index + 1) ifAbsent:nil. |
|
3624 |
||
2151 | 3625 |
nextItem isNil ifTrue:[^ false]. |
3626 |
^ nextItem canAddChildren |
|
1606 | 3627 |
! |
3628 |
||
3629 |
canMoveOut |
|
3630 |
"returns true if the item can be moved out from its current parent |
|
3631 |
" |
|
3632 |
self isDelayedMenu ifTrue:[^ false]. |
|
3633 |
parent isDelayedMenu ifTrue:[^ false]. |
|
3634 |
||
3635 |
^ parent parent notNil |
|
1454 | 3636 |
! |
3637 |
||
1606 | 3638 |
canMoveUpOrDown |
3639 |
"returns true if the item can change its vertical order in its sibling |
|
3640 |
" |
|
3641 |
^ parent children size > 1 |
|
3642 |
! ! |
|
3643 |
||
1631 | 3644 |
!MenuEditor::ActionItem class methodsFor:'defaults'! |
1606 | 3645 |
|
3646 |
defaultLabel |
|
3647 |
^ 'Action' |
|
3648 |
! ! |
|
3649 |
||
1668 | 3650 |
!MenuEditor::ActionItem class methodsFor:'interface specs'! |
1606 | 3651 |
|
3652 |
basicsEditSpec |
|
3653 |
"This resource specification was automatically generated |
|
3654 |
by the UIPainter of ST/X." |
|
3655 |
||
3656 |
"Do not manually edit this!! If it is corrupted, |
|
3657 |
the UIPainter may not be able to read the specification." |
|
3658 |
||
3659 |
" |
|
1634 | 3660 |
UIPainter new openOnClass:MenuEditor::ActionItem andSelector:#basicsEditSpec |
1606 | 3661 |
" |
3662 |
||
3663 |
<resource: #canvas> |
|
3664 |
||
2188 | 3665 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3666 |
#(FullSpec |
2189 | 3667 |
name: basicsEditSpec |
3668 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3669 |
(WindowSpec |
2189 | 3670 |
label: 'basicsEditSpec' |
3671 |
name: 'basicsEditSpec' |
|
3672 |
min: (Point 10 10) |
|
3673 |
bounds: (Rectangle 0 0 340 340) |
|
3674 |
) |
|
3675 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3676 |
(SpecCollection |
2189 | 3677 |
collection: ( |
3678 |
(LabelSpec |
|
3679 |
label: 'Name Key:' |
|
3680 |
name: 'nameKeyLabel' |
|
3681 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
3682 |
activeHelpKey: basicsKey |
|
3683 |
translateLabel: true |
|
3684 |
resizeForLabel: true |
|
3685 |
adjust: right |
|
3686 |
) |
|
3687 |
(InputFieldSpec |
|
3688 |
name: 'nameKeyField' |
|
3689 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
3690 |
activeHelpKey: basicsKey |
|
3691 |
tabable: true |
|
3692 |
model: nameKey |
|
3693 |
group: inputGroup |
|
3694 |
type: symbolOrNil |
|
3695 |
immediateAccept: false |
|
3696 |
acceptOnLeave: false |
|
3697 |
acceptOnReturn: true |
|
3698 |
acceptOnTab: true |
|
3699 |
acceptOnLostFocus: false |
|
3700 |
acceptChannel: acceptChannel |
|
3701 |
modifiedChannel: modifiedChannel |
|
3702 |
acceptOnPointerLeave: false |
|
3703 |
) |
|
3704 |
(LabelSpec |
|
3705 |
label: 'Label:' |
|
3706 |
name: 'labelLabel' |
|
3707 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
3708 |
activeHelpKey: basicsLabel |
|
3709 |
translateLabel: true |
|
3710 |
resizeForLabel: true |
|
3711 |
adjust: right |
|
3712 |
) |
|
3713 |
(InputFieldSpec |
|
3714 |
name: 'labelField' |
|
3715 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
3716 |
activeHelpKey: basicsLabel |
|
3717 |
tabable: true |
|
3718 |
model: rawLabel |
|
3719 |
group: inputGroup |
|
3720 |
immediateAccept: false |
|
3721 |
acceptOnReturn: true |
|
3722 |
acceptOnTab: true |
|
3723 |
acceptOnLostFocus: false |
|
3724 |
acceptChannel: acceptChannel |
|
3725 |
modifiedChannel: modifiedChannel |
|
3726 |
acceptOnPointerLeave: false |
|
3727 |
) |
|
3728 |
(LabelSpec |
|
3729 |
label: 'Action:' |
|
3730 |
name: 'valueLabel' |
|
3731 |
layout: (AlignmentOrigin 107 0 82 0 1 0.5) |
|
3732 |
activeHelpKey: basicsAction |
|
3733 |
translateLabel: true |
|
3734 |
resizeForLabel: true |
|
3735 |
adjust: right |
|
3736 |
) |
|
3737 |
(InputFieldSpec |
|
3738 |
name: 'valueField' |
|
3739 |
layout: (LayoutFrame 110 0 71 0 -5 1.0 93 0) |
|
3740 |
activeHelpKey: basicsAction |
|
3741 |
tabable: true |
|
3742 |
model: itemValue |
|
3743 |
group: inputGroup |
|
3744 |
type: symbolOrNil |
|
3745 |
immediateAccept: false |
|
3746 |
acceptOnLeave: true |
|
3747 |
acceptOnReturn: true |
|
3748 |
acceptOnTab: true |
|
3749 |
acceptOnLostFocus: true |
|
3750 |
acceptChannel: acceptChannel |
|
3751 |
modifiedChannel: modifiedChannel |
|
3752 |
acceptOnPointerLeave: true |
|
3753 |
) |
|
3754 |
(LabelSpec |
|
3755 |
label: 'Argument:' |
|
3756 |
name: 'argumentLabel' |
|
3757 |
layout: (AlignmentOrigin 107 0 107 0 1 0.5) |
|
3758 |
activeHelpKey: basicsArgument |
|
3759 |
translateLabel: true |
|
3760 |
resizeForLabel: true |
|
3761 |
adjust: right |
|
3762 |
) |
|
3763 |
(InputFieldSpec |
|
3764 |
name: 'argumentField' |
|
3765 |
layout: (LayoutFrame 110 0 96 0 -5 1.0 118 0) |
|
3766 |
activeHelpKey: basicsArgument |
|
3767 |
tabable: true |
|
3768 |
model: argument |
|
3769 |
group: inputGroup |
|
3770 |
type: smalltalkObjectOrNil |
|
3771 |
immediateAccept: false |
|
3772 |
acceptOnReturn: true |
|
3773 |
acceptOnTab: true |
|
3774 |
acceptOnLostFocus: false |
|
3775 |
acceptChannel: acceptChannel |
|
3776 |
modifiedChannel: modifiedChannel |
|
3777 |
acceptOnPointerLeave: false |
|
3778 |
) |
|
3779 |
(LabelSpec |
|
3780 |
label: 'Indication:' |
|
3781 |
name: 'indicationLabel' |
|
3782 |
layout: (AlignmentOrigin 107 0 138 0 1 0.5) |
|
3783 |
activeHelpKey: basicsIndication |
|
3784 |
translateLabel: true |
|
3785 |
resizeForLabel: true |
|
3786 |
adjust: right |
|
3787 |
) |
|
3788 |
(InputFieldSpec |
|
3789 |
name: 'indicationField' |
|
3790 |
layout: (LayoutFrame 110 0 127 0 -5 1.0 149 0) |
|
3791 |
activeHelpKey: basicsIndication |
|
3792 |
enableChannel: indicationEnabled |
|
3793 |
tabable: true |
|
3794 |
model: indication |
|
3795 |
group: inputGroup |
|
3796 |
type: symbolOrNil |
|
3797 |
immediateAccept: true |
|
3798 |
acceptOnReturn: false |
|
3799 |
acceptOnTab: false |
|
3800 |
acceptOnLostFocus: false |
|
3801 |
modifiedChannel: modifiedChannel |
|
3802 |
acceptOnPointerLeave: false |
|
3803 |
) |
|
3804 |
(LabelSpec |
|
3805 |
label: 'Choice:' |
|
3806 |
name: 'choiceLabel' |
|
3807 |
layout: (AlignmentOrigin 107 0 163 0 1 0.5) |
|
3808 |
activeHelpKey: basicsChoice |
|
3809 |
translateLabel: true |
|
3810 |
resizeForLabel: true |
|
3811 |
adjust: right |
|
3812 |
) |
|
3813 |
(InputFieldSpec |
|
3814 |
name: 'choiceField' |
|
3815 |
layout: (LayoutFrame 110 0 152 0 -5 1.0 174 0) |
|
3816 |
activeHelpKey: basicsChoice |
|
3817 |
enableChannel: choiceEnabled |
|
3818 |
tabable: true |
|
3819 |
model: choice |
|
3820 |
group: inputGroup |
|
3821 |
type: symbolOrNil |
|
3822 |
immediateAccept: true |
|
3823 |
acceptOnReturn: false |
|
3824 |
acceptOnTab: false |
|
3825 |
acceptOnLostFocus: false |
|
3826 |
modifiedChannel: modifiedChannel |
|
3827 |
acceptOnPointerLeave: false |
|
3828 |
) |
|
3829 |
(LabelSpec |
|
3830 |
label: 'Value:' |
|
3831 |
name: 'choiceValueLabel' |
|
3832 |
layout: (AlignmentOrigin 107 0 188 0 1 0.5) |
|
3833 |
activeHelpKey: basicsChoiceValue |
|
3834 |
translateLabel: true |
|
3835 |
resizeForLabel: true |
|
3836 |
adjust: right |
|
3837 |
) |
|
3838 |
(InputFieldSpec |
|
3839 |
name: 'choiceValueField' |
|
3840 |
layout: (LayoutFrame 110 0 177 0 -5 1.0 199 0) |
|
3841 |
activeHelpKey: basicsChoiceValue |
|
3842 |
enableChannel: choiceValueEnabled |
|
3843 |
tabable: true |
|
3844 |
model: choiceValue |
|
3845 |
group: inputGroup |
|
3846 |
type: smalltalkObjectOrNil |
|
3847 |
immediateAccept: false |
|
3848 |
acceptOnLeave: false |
|
3849 |
acceptOnReturn: true |
|
3850 |
acceptOnTab: true |
|
3851 |
acceptOnLostFocus: false |
|
3852 |
acceptChannel: acceptChannel |
|
3853 |
modifiedChannel: modifiedChannel |
|
3854 |
acceptOnPointerLeave: false |
|
3855 |
) |
|
3856 |
(CheckBoxSpec |
|
3857 |
label: 'Translate Label' |
|
3858 |
name: 'translateLabelCheckBox' |
|
3859 |
layout: (AlignmentOrigin 7 0 213 0 0 0) |
|
3860 |
activeHelpKey: basicsTranslateLabel |
|
3861 |
tabable: true |
|
3862 |
model: translateLabel |
|
3863 |
translateLabel: true |
|
3864 |
) |
|
3865 |
(CheckBoxSpec |
|
3866 |
label: 'Is Button' |
|
3867 |
name: 'isButtonCheckBox' |
|
3868 |
layout: (AlignmentOrigin 7 0 238 0 0 0) |
|
3869 |
activeHelpKey: basicsIsButton |
|
3870 |
tabable: true |
|
3871 |
model: isButton |
|
3872 |
translateLabel: true |
|
3873 |
) |
|
3874 |
(CheckBoxSpec |
|
3875 |
label: 'Hide Menu after Activation' |
|
3876 |
name: 'hideMenuOnActivated' |
|
3877 |
layout: (AlignmentOrigin 7 0 263 0 0 0) |
|
3878 |
activeHelpKey: hideMenuOnActivated |
|
3879 |
tabable: true |
|
3880 |
model: hideMenuOnActivated |
|
3881 |
translateLabel: true |
|
3882 |
) |
|
3883 |
(CheckBoxSpec |
|
3884 |
label: 'BusyCursor while Active' |
|
3885 |
name: 'showBusyCursorWhilePerforming' |
|
3886 |
layout: (AlignmentOrigin 7 0 288 0 0 0) |
|
3887 |
activeHelpKey: showBusyCursorWhilePerforming |
|
3888 |
tabable: true |
|
3889 |
model: showBusyCursorWhilePerforming |
|
3890 |
translateLabel: true |
|
3891 |
) |
|
3892 |
(CheckBoxSpec |
|
3893 |
label: 'Trigger On Down' |
|
3894 |
name: 'triggerOnDown' |
|
3895 |
layout: (AlignmentOrigin 25 0.5 238 0 0 0) |
|
3896 |
activeHelpKey: triggerOnDown |
|
3897 |
enableChannel: hasNoDelayedMenuValue |
|
3898 |
tabable: true |
|
3899 |
model: triggerOnDown |
|
3900 |
translateLabel: true |
|
3901 |
) |
|
3902 |
(CheckBoxSpec |
|
3903 |
label: 'Send To Originating Widget' |
|
3904 |
name: 'sendToOriginator' |
|
3905 |
layout: (AlignmentOrigin 7 0 313 0 0 0) |
|
3906 |
activeHelpKey: sendToOriginator |
|
3907 |
enableChannel: hasItemValue |
|
3908 |
tabable: true |
|
3909 |
model: sendToOriginator |
|
3910 |
translateLabel: true |
|
3911 |
) |
|
3912 |
) |
|
3913 |
||
3914 |
) |
|
1606 | 3915 |
) |
199 | 3916 |
! ! |
3917 |
||
1725 | 3918 |
!MenuEditor::ActionItem class methodsFor:'interface-editor'! |
3919 |
||
3920 |
addBindingsTo:aspects for:aMenuEditor |
|
3921 |
"add additional bindings to the aspects |
|
3922 |
" |
|
3923 |
aspects at:#indicationEnabled ifAbsentPut:[ |
|
3924 |
BlockValue with:[:a | a size == 0 ] argument:(aspects at:#choice) |
|
3925 |
]. |
|
3926 |
||
3927 |
aspects at:#choiceEnabled ifAbsentPut:[ |
|
3928 |
BlockValue with:[:a | a size == 0 ] argument:(aspects at:#indication) |
|
3929 |
]. |
|
3930 |
||
3931 |
aspects at:#choiceValueEnabled ifAbsentPut:[ |
|
3932 |
BlockValue with:[:a | a size ~~ 0 ] argument:(aspects at:#choice) |
|
3933 |
]. |
|
3934 |
aspects at:#hasNoDelayedMenuValue ifAbsentPut:[ |
|
3935 |
true asValue |
|
3936 |
]. |
|
3937 |
! ! |
|
3938 |
||
1631 | 3939 |
!MenuEditor::ActionItem methodsFor:'accessing'! |
1606 | 3940 |
|
3941 |
menuItem |
|
3942 |
|item| |
|
3943 |
||
3944 |
item := super menuItem. |
|
3945 |
self hasDelayedMenu ifTrue:[ |
|
2188 | 3946 |
children first setDelayedAttributesTo:item. |
3947 |
||
3948 |
menuItem value isNil ifTrue:[ |
|
3949 |
menuItem value:#unspecified |
|
3950 |
] |
|
199 | 3951 |
]. |
1606 | 3952 |
^ item |
199 | 3953 |
! |
3954 |
||
213 | 3955 |
menuItem:anItem |
1606 | 3956 |
|submenu item| |
3957 |
||
3958 |
super menuItem:anItem. |
|
3959 |
submenu := anItem submenu. |
|
3960 |
||
3961 |
submenu notNil ifTrue:[ |
|
2188 | 3962 |
item := MenuEditor::RegularMenuItem new |
1606 | 3963 |
] ifFalse:[ |
2188 | 3964 |
anItem submenuChannel isNil ifTrue:[ |
3965 |
^ self |
|
3966 |
]. |
|
3967 |
item := MenuEditor::LinkedMenuItem new |
|
1606 | 3968 |
]. |
3969 |
item getDelayedAttributesFrom:anItem. |
|
3970 |
self add:item. |
|
199 | 3971 |
! |
3972 |
||
1606 | 3973 |
slices |
3974 |
^ #( |
|
3975 |
(Basics basicsEditSpec ) |
|
3976 |
(Details detailsEditSpec) |
|
3977 |
(Image image ) |
|
3978 |
(Help help) |
|
3979 |
) |
|
199 | 3980 |
! ! |
3981 |
||
1631 | 3982 |
!MenuEditor::ActionItem methodsFor:'adding & removing'! |
1606 | 3983 |
|
2188 | 3984 |
add:anItem |
1606 | 3985 |
"add an item; test whether the item is a delayed menu and |
2075 | 3986 |
not already a delayed menu exists." |
2188 | 3987 |
|
2075 | 3988 |
(anItem isKindOfMenu and:[ self canAddDelayedMenu ]) ifFalse:[ |
2188 | 3989 |
^ nil |
853 | 3990 |
]. |
2188 | 3991 |
|
1606 | 3992 |
menuItem triggerOnDown:false. |
2075 | 3993 |
anItem argument:(menuItem argument). |
1606 | 3994 |
isExpanded := false. |
3995 |
anItem parent:self. |
|
3996 |
children := Array with:anItem. |
|
3997 |
self expand. |
|
2075 | 3998 |
^ anItem |
3999 |
||
4000 |
"Modified: / 05-09-2006 / 17:49:57 / cg" |
|
199 | 4001 |
! ! |
4002 |
||
1631 | 4003 |
!MenuEditor::ActionItem methodsFor:'aspects'! |
1606 | 4004 |
|
4005 |
aspectAt:aKey put:aValue |
|
2075 | 4006 |
"set a specific aspect named aKey to the aValue" |
4007 |
||
1606 | 4008 |
aKey == #argument ifTrue:[ |
2189 | 4009 |
self hasDelayedMenu ifTrue:[ |
4010 |
children first argument:aValue |
|
4011 |
]. |
|
4012 |
menuItem argument:aValue. |
|
4013 |
^ self |
|
1606 | 4014 |
]. |
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
4015 |
|
1623 | 4016 |
aKey == #triggerOnDown ifTrue:[ |
2189 | 4017 |
|triggerOnDown| |
4018 |
||
4019 |
self hasDelayedMenu ifTrue:[ |
|
4020 |
triggerOnDown := false |
|
4021 |
] ifFalse:[ |
|
4022 |
triggerOnDown := aValue |
|
4023 |
]. |
|
4024 |
menuItem triggerOnDown:triggerOnDown. |
|
4025 |
^ self. |
|
1623 | 4026 |
]. |
1606 | 4027 |
super aspectAt:aKey put:aValue. |
2055 | 4028 |
|
2075 | 4029 |
"Modified: / 05-09-2006 / 17:47:24 / cg" |
1606 | 4030 |
! |
4031 |
||
4032 |
toAspects:aspects |
|
4033 |
"write values to aspects |
|
4034 |
" |
|
1623 | 4035 |
|hasDelayedMenu| |
4036 |
||
1606 | 4037 |
super toAspects:aspects. |
4038 |
||
1623 | 4039 |
hasDelayedMenu := self hasDelayedMenu. |
4040 |
(aspects at:#hasNoDelayedMenuValue) value:(hasDelayedMenu not). |
|
4041 |
||
4042 |
hasDelayedMenu ifTrue:[ |
|
2188 | 4043 |
(aspects at:#triggerOnDown) value:false |
1623 | 4044 |
]. |
356 | 4045 |
! ! |
4046 |
||
1631 | 4047 |
!MenuEditor::ActionItem methodsFor:'displaying'! |
1606 | 4048 |
|
4049 |
icon |
|
4050 |
^ self class iconItem |
|
4051 |
! ! |
|
4052 |
||
1631 | 4053 |
!MenuEditor::ActionItem methodsFor:'initialization'! |
199 | 4054 |
|
4055 |
initialize |
|
4056 |
super initialize. |
|
1606 | 4057 |
isExpanded := true. |
4058 |
! ! |
|
4059 |
||
1631 | 4060 |
!MenuEditor::ActionItem methodsFor:'queries'! |
1606 | 4061 |
|
4062 |
canCollapse |
|
4063 |
^ false |
|
4064 |
! |
|
4065 |
||
4066 |
hasDelayedMenu |
|
4067 |
"returns true if a delayed menu exists |
|
4068 |
" |
|
4069 |
^ children size ~~ 0 |
|
4070 |
! |
|
4071 |
||
4072 |
hasIndicator |
|
4073 |
^ false |
|
4074 |
! |
|
4075 |
||
4076 |
isAction |
|
4077 |
^ true |
|
4078 |
! ! |
|
4079 |
||
1660 | 4080 |
!MenuEditor::ActionItem methodsFor:'queries-operation'! |
1606 | 4081 |
|
4082 |
canAddDelayedMenu |
|
1623 | 4083 |
"returns true if a delayed menu can be added |
1606 | 4084 |
" |
1623 | 4085 |
^ self hasDelayedMenu not |
1606 | 4086 |
! ! |
4087 |
||
1631 | 4088 |
!MenuEditor::LinkedMenuItem class methodsFor:'defaults'! |
1606 | 4089 |
|
4090 |
defaultLabel |
|
4091 |
^ 'Linked Menu' |
|
199 | 4092 |
! ! |
4093 |
||
1668 | 4094 |
!MenuEditor::LinkedMenuItem class methodsFor:'interface specs'! |
1606 | 4095 |
|
4096 |
basicsEditSpec |
|
4097 |
"This resource specification was automatically generated |
|
4098 |
by the UIPainter of ST/X." |
|
4099 |
||
4100 |
"Do not manually edit this!! If it is corrupted, |
|
4101 |
the UIPainter may not be able to read the specification." |
|
4102 |
||
4103 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4104 |
UIPainter new openOnClass:MenuEditor::LinkedMenuItem andSelector:#basicsEditSpec |
1606 | 4105 |
" |
4106 |
||
4107 |
<resource: #canvas> |
|
4108 |
||
2188 | 4109 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4110 |
#(FullSpec |
2189 | 4111 |
name: basicsEditSpec |
4112 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4113 |
(WindowSpec |
2189 | 4114 |
label: 'basicsEditSpec' |
4115 |
name: 'basicsEditSpec' |
|
4116 |
min: (Point 10 10) |
|
4117 |
bounds: (Rectangle 0 0 340 340) |
|
4118 |
) |
|
4119 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4120 |
(SpecCollection |
2189 | 4121 |
collection: ( |
4122 |
(LabelSpec |
|
4123 |
label: 'Name Key:' |
|
4124 |
name: 'nameKeyLabel' |
|
4125 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
4126 |
activeHelpKey: basicsKey |
|
4127 |
visibilityChannel: notDelayedMenu |
|
4128 |
translateLabel: true |
|
4129 |
resizeForLabel: true |
|
4130 |
adjust: right |
|
4131 |
) |
|
4132 |
(InputFieldSpec |
|
4133 |
name: 'nameKeyField' |
|
4134 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
4135 |
activeHelpKey: basicsKey |
|
4136 |
visibilityChannel: notDelayedMenu |
|
4137 |
tabable: true |
|
4138 |
model: nameKey |
|
4139 |
group: inputGroup |
|
4140 |
type: symbolOrNil |
|
4141 |
immediateAccept: false |
|
4142 |
acceptOnLeave: false |
|
4143 |
acceptOnReturn: true |
|
4144 |
acceptOnTab: true |
|
4145 |
acceptOnLostFocus: false |
|
4146 |
acceptChannel: acceptChannel |
|
4147 |
modifiedChannel: modifiedChannel |
|
4148 |
acceptOnPointerLeave: false |
|
4149 |
) |
|
4150 |
(LabelSpec |
|
4151 |
label: 'Label:' |
|
4152 |
name: 'labelLabel' |
|
4153 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4154 |
activeHelpKey: basicsLabel |
|
4155 |
visibilityChannel: notDelayedMenu |
|
4156 |
translateLabel: true |
|
4157 |
resizeForLabel: true |
|
4158 |
adjust: right |
|
4159 |
) |
|
4160 |
(InputFieldSpec |
|
4161 |
name: 'labelField' |
|
4162 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
4163 |
activeHelpKey: basicsLabel |
|
4164 |
visibilityChannel: notDelayedMenu |
|
4165 |
tabable: true |
|
4166 |
model: rawLabel |
|
4167 |
group: inputGroup |
|
4168 |
immediateAccept: false |
|
4169 |
acceptOnReturn: true |
|
4170 |
acceptOnTab: true |
|
4171 |
acceptOnLostFocus: false |
|
4172 |
acceptChannel: acceptChannel |
|
4173 |
modifiedChannel: modifiedChannel |
|
4174 |
acceptOnPointerLeave: false |
|
4175 |
) |
|
4176 |
(LabelSpec |
|
4177 |
label: 'Menu:' |
|
4178 |
name: 'menuLabel' |
|
4179 |
layout: (AlignmentOrigin 107 0 90 0 1 0.5) |
|
4180 |
activeHelpKey: basicsLabel |
|
4181 |
translateLabel: true |
|
4182 |
resizeForLabel: true |
|
4183 |
adjust: right |
|
4184 |
) |
|
4185 |
(InputFieldSpec |
|
4186 |
name: 'menuField' |
|
4187 |
layout: (LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
4188 |
activeHelpKey: basicsMenu |
|
4189 |
tabable: true |
|
4190 |
model: submenuChannel |
|
4191 |
group: inputGroup |
|
4192 |
type: symbolOrNil |
|
4193 |
immediateAccept: false |
|
4194 |
acceptOnReturn: true |
|
4195 |
acceptOnTab: true |
|
4196 |
acceptOnLostFocus: false |
|
4197 |
acceptChannel: acceptChannel |
|
4198 |
modifiedChannel: modifiedChannel |
|
4199 |
acceptOnPointerLeave: false |
|
4200 |
) |
|
4201 |
(LabelSpec |
|
4202 |
label: 'Argument:' |
|
4203 |
name: 'argumentLabel' |
|
4204 |
layout: (AlignmentOrigin 107 0 115 0 1 0.5) |
|
4205 |
activeHelpKey: basicsLabel |
|
4206 |
translateLabel: true |
|
4207 |
resizeForLabel: true |
|
4208 |
adjust: right |
|
4209 |
) |
|
4210 |
(InputFieldSpec |
|
4211 |
name: 'argumentField' |
|
4212 |
layout: (LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
4213 |
activeHelpKey: basicsMenuArgument |
|
4214 |
enableChannel: notDelayedMenu |
|
4215 |
tabable: true |
|
4216 |
model: argument |
|
4217 |
group: inputGroup |
|
4218 |
type: smalltalkObjectOrNil |
|
4219 |
immediateAccept: false |
|
4220 |
acceptOnReturn: true |
|
4221 |
acceptOnTab: true |
|
4222 |
acceptOnLostFocus: false |
|
4223 |
acceptChannel: acceptChannel |
|
4224 |
modifiedChannel: modifiedChannel |
|
4225 |
acceptOnPointerLeave: false |
|
4226 |
) |
|
4227 |
(CheckBoxSpec |
|
4228 |
label: 'Translate Label' |
|
4229 |
name: 'translateLabelCheckBox' |
|
4230 |
layout: (Point 20 213) |
|
4231 |
activeHelpKey: basicsTranslateLabel |
|
4232 |
visibilityChannel: notDelayedMenu |
|
4233 |
tabable: true |
|
4234 |
model: translateLabel |
|
4235 |
translateLabel: true |
|
4236 |
) |
|
4237 |
(CheckBoxSpec |
|
4238 |
label: 'Is Button' |
|
4239 |
name: 'isButtonCheckBox' |
|
4240 |
layout: (Point 20 238) |
|
4241 |
activeHelpKey: basicsIsButton |
|
4242 |
visibilityChannel: notDelayedMenu |
|
4243 |
tabable: true |
|
4244 |
model: isButton |
|
4245 |
translateLabel: true |
|
4246 |
) |
|
4247 |
(CheckBoxSpec |
|
4248 |
label: 'Horizontal Layout' |
|
4249 |
name: 'horizontalLayout' |
|
4250 |
layout: (Point 20 263) |
|
4251 |
activeHelpKey: horizontalLayout |
|
4252 |
tabable: true |
|
4253 |
model: horizontalLayout |
|
4254 |
translateLabel: true |
|
4255 |
) |
|
4256 |
(CheckBoxSpec |
|
4257 |
label: 'Do not Destroy Linked Menu' |
|
4258 |
name: 'keepLinkedMenu' |
|
4259 |
layout: (Point 20 288) |
|
4260 |
activeHelpKey: keepLinkedMenu |
|
4261 |
tabable: true |
|
4262 |
model: keepLinkedMenu |
|
4263 |
translateLabel: true |
|
4264 |
) |
|
4265 |
) |
|
4266 |
||
4267 |
) |
|
1606 | 4268 |
) |
4269 |
! ! |
|
4270 |
||
1631 | 4271 |
!MenuEditor::LinkedMenuItem methodsFor:'accessing'! |
1606 | 4272 |
|
4273 |
argument:aValue |
|
4274 |
menuItem argument:aValue. |
|
4275 |
! |
|
4276 |
||
4277 |
menuItem |
|
4278 |
"returns self as a MenuItem |
|
4279 |
" |
|
4280 |
|item| |
|
4281 |
||
4282 |
item := super menuItem. |
|
4283 |
item submenuChannel:(self submenuChannel). |
|
4284 |
^ item |
|
4285 |
! |
|
4286 |
||
4287 |
slices |
|
4288 |
self isDelayedMenu ifTrue:[ |
|
2188 | 4289 |
^ #( |
4290 |
(Basics basicsEditSpec ) |
|
4291 |
) |
|
1389 | 4292 |
]. |
4293 |
||
1606 | 4294 |
^ #( |
2188 | 4295 |
(Basics basicsEditSpec ) |
4296 |
(Details detailsEditSpec) |
|
4297 |
(Image image ) |
|
4298 |
(Help help) |
|
1606 | 4299 |
) |
4300 |
! |
|
4301 |
||
4302 |
submenuChannel |
|
4303 |
^ menuItem submenuChannel ? #unspecified |
|
4304 |
! |
|
4305 |
||
4306 |
submenuChannel:aValue |
|
4307 |
menuItem submenuChannel:aValue. |
|
4308 |
! ! |
|
4309 |
||
1631 | 4310 |
!MenuEditor::LinkedMenuItem methodsFor:'aspects'! |
1606 | 4311 |
|
4312 |
aspectAt:aKey put:aValue |
|
2075 | 4313 |
"set a specific aspect named aKey to the aValue" |
4314 |
||
1606 | 4315 |
aKey == #submenuChannel ifTrue:[ ^ self submenuChannel:aValue ]. |
4316 |
super aspectAt:aKey put:aValue. |
|
2075 | 4317 |
|
4318 |
"Modified: / 05-09-2006 / 17:47:39 / cg" |
|
1606 | 4319 |
! |
4320 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4321 |
getDelayedAttributesFrom:anItem |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4322 |
|
1606 | 4323 |
menuItem rawLabel:'Delayed'. |
4324 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4325 |
menuItem submenuChannel:(self validateValue:(anItem submenuChannel)). |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4326 |
menuItem horizontalLayout:(self validateValue:(anItem horizontalLayout)). |
1881
dde52f4278c0
horizontalLayout flag bug fixed
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
4327 |
menuItem keepLinkedMenu:(self validateValue:(anItem keepLinkedMenu)). |
1389 | 4328 |
! |
4329 |
||
1606 | 4330 |
setDelayedAttributesTo:aMenuItem |
4331 |
aMenuItem submenuChannel:(self submenuChannel). |
|
4332 |
aMenuItem horizontalLayout:(menuItem horizontalLayout). |
|
4333 |
aMenuItem keepLinkedMenu:(menuItem keepLinkedMenu). |
|
4334 |
! ! |
|
4335 |
||
1631 | 4336 |
!MenuEditor::LinkedMenuItem methodsFor:'displaying'! |
1606 | 4337 |
|
4338 |
displayLabel |
|
4339 |
"returns the label dependent on is delayed or not |
|
4340 |
" |
|
4341 |
self isDelayedMenu ifTrue:[ ^ self submenuChannel ]. |
|
4342 |
^ menuItem rawLabel |
|
199 | 4343 |
! |
4344 |
||
1606 | 4345 |
icon |
4346 |
self isDelayedMenu ifTrue:[ ^ self class iconDelayedLinkedMenu ]. |
|
4347 |
^ self class iconLinkedMenu |
|
4348 |
! ! |
|
4349 |
||
1780
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4350 |
!MenuEditor::LinkedMenuItem methodsFor:'initialization'! |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4351 |
|
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4352 |
initialize |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4353 |
"setup default values on the item |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4354 |
" |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4355 |
super initialize. |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4356 |
|
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4357 |
"setting default values |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4358 |
" |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4359 |
menuItem keepLinkedMenu:true. |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4360 |
! ! |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
4361 |
|
1631 | 4362 |
!MenuEditor::LinkedMenuItem methodsFor:'queries'! |
1606 | 4363 |
|
4364 |
isKindOfMenu |
|
4365 |
^ true |
|
4366 |
! ! |
|
4367 |
||
1844 | 4368 |
!MenuEditor::MenuSliceItem class methodsFor:'defaults'! |
4369 |
||
4370 |
defaultLabel |
|
4371 |
^ 'Menu Slice' |
|
4372 |
! ! |
|
4373 |
||
4374 |
!MenuEditor::MenuSliceItem class methodsFor:'interface specs'! |
|
4375 |
||
4376 |
basicsEditSpec |
|
4377 |
"This resource specification was automatically generated |
|
4378 |
by the UIPainter of ST/X." |
|
4379 |
||
4380 |
"Do not manually edit this!! If it is corrupted, |
|
4381 |
the UIPainter may not be able to read the specification." |
|
4382 |
||
4383 |
" |
|
4384 |
UIPainter new openOnClass:MenuEditor::MenuSliceItem andSelector:#basicsEditSpec |
|
4385 |
" |
|
4386 |
||
4387 |
<resource: #canvas> |
|
4388 |
||
2188 | 4389 |
^ |
1844 | 4390 |
#(FullSpec |
2189 | 4391 |
name: basicsEditSpec |
4392 |
window: |
|
1844 | 4393 |
(WindowSpec |
2189 | 4394 |
label: 'basicsEditSpec' |
4395 |
name: 'basicsEditSpec' |
|
4396 |
min: (Point 10 10) |
|
4397 |
bounds: (Rectangle 0 0 344 146) |
|
4398 |
) |
|
4399 |
component: |
|
1844 | 4400 |
(SpecCollection |
2189 | 4401 |
collection: ( |
4402 |
(LabelSpec |
|
4403 |
label: 'Name Key:' |
|
4404 |
name: 'nameKeyLabel' |
|
4405 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
4406 |
activeHelpKey: basicsKey |
|
4407 |
visibilityChannel: notDelayedMenu |
|
4408 |
translateLabel: true |
|
4409 |
resizeForLabel: true |
|
4410 |
adjust: right |
|
4411 |
) |
|
4412 |
(InputFieldSpec |
|
4413 |
name: 'nameKeyField' |
|
4414 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
4415 |
activeHelpKey: basicsKey |
|
4416 |
visibilityChannel: notDelayedMenu |
|
4417 |
tabable: true |
|
4418 |
model: nameKey |
|
4419 |
group: inputGroup |
|
4420 |
type: symbolOrNil |
|
4421 |
immediateAccept: false |
|
4422 |
acceptOnLeave: false |
|
4423 |
acceptOnReturn: true |
|
4424 |
acceptOnTab: true |
|
4425 |
acceptOnLostFocus: false |
|
4426 |
acceptChannel: acceptChannel |
|
4427 |
modifiedChannel: modifiedChannel |
|
4428 |
acceptOnPointerLeave: false |
|
4429 |
) |
|
4430 |
(LabelSpec |
|
4431 |
label: 'Label:' |
|
4432 |
name: 'labelLabel' |
|
4433 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4434 |
activeHelpKey: basicsLabel |
|
4435 |
visibilityChannel: notDelayedMenu |
|
4436 |
translateLabel: true |
|
4437 |
resizeForLabel: true |
|
4438 |
adjust: right |
|
4439 |
) |
|
4440 |
(InputFieldSpec |
|
4441 |
name: 'labelField' |
|
4442 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
4443 |
activeHelpKey: basicsLabel |
|
4444 |
visibilityChannel: notDelayedMenu |
|
4445 |
tabable: true |
|
4446 |
model: rawLabel |
|
4447 |
group: inputGroup |
|
4448 |
immediateAccept: false |
|
4449 |
acceptOnReturn: true |
|
4450 |
acceptOnTab: true |
|
4451 |
acceptOnLostFocus: false |
|
4452 |
acceptChannel: acceptChannel |
|
4453 |
modifiedChannel: modifiedChannel |
|
4454 |
acceptOnPointerLeave: false |
|
4455 |
) |
|
4456 |
(LabelSpec |
|
4457 |
label: 'Menu:' |
|
4458 |
name: 'menuLabel' |
|
4459 |
layout: (AlignmentOrigin 107 0 90 0 1 0.5) |
|
4460 |
activeHelpKey: basicsLabel |
|
4461 |
translateLabel: true |
|
4462 |
resizeForLabel: true |
|
4463 |
adjust: right |
|
4464 |
) |
|
4465 |
(InputFieldSpec |
|
4466 |
name: 'menuField' |
|
4467 |
layout: (LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
4468 |
activeHelpKey: basicsMenu |
|
4469 |
tabable: true |
|
4470 |
model: submenuChannel |
|
4471 |
group: inputGroup |
|
4472 |
type: symbolOrNil |
|
4473 |
immediateAccept: false |
|
4474 |
acceptOnReturn: true |
|
4475 |
acceptOnTab: true |
|
4476 |
acceptOnLostFocus: false |
|
4477 |
acceptChannel: acceptChannel |
|
4478 |
modifiedChannel: modifiedChannel |
|
4479 |
acceptOnPointerLeave: false |
|
4480 |
) |
|
4481 |
(LabelSpec |
|
4482 |
label: 'Argument:' |
|
4483 |
name: 'argumentLabel' |
|
4484 |
layout: (AlignmentOrigin 107 0 115 0 1 0.5) |
|
4485 |
activeHelpKey: basicsLabel |
|
4486 |
translateLabel: true |
|
4487 |
resizeForLabel: true |
|
4488 |
adjust: right |
|
4489 |
) |
|
4490 |
(InputFieldSpec |
|
4491 |
name: 'argumentField' |
|
4492 |
layout: (LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
4493 |
activeHelpKey: basicsMenuArgument |
|
4494 |
enableChannel: notDelayedMenu |
|
4495 |
tabable: true |
|
4496 |
model: argument |
|
4497 |
group: inputGroup |
|
4498 |
type: smalltalkObjectOrNil |
|
4499 |
immediateAccept: false |
|
4500 |
acceptOnReturn: true |
|
4501 |
acceptOnTab: true |
|
4502 |
acceptOnLostFocus: false |
|
4503 |
acceptChannel: acceptChannel |
|
4504 |
modifiedChannel: modifiedChannel |
|
4505 |
acceptOnPointerLeave: false |
|
4506 |
) |
|
4507 |
) |
|
4508 |
||
4509 |
) |
|
1844 | 4510 |
) |
4511 |
! ! |
|
4512 |
||
4513 |
!MenuEditor::MenuSliceItem methodsFor:'accessing'! |
|
4514 |
||
4515 |
icon |
|
4516 |
^ self class iconSliceMenu |
|
4517 |
! |
|
4518 |
||
4519 |
menuItem |
|
4520 |
"returns self as a MenuItem |
|
4521 |
" |
|
4522 |
|item| |
|
4523 |
||
4524 |
item := super menuItem. |
|
4525 |
item submenuChannel:(self submenuChannel). |
|
4526 |
item isMenuSlice:true. |
|
4527 |
^ item |
|
4528 |
! |
|
4529 |
||
4530 |
slices |
|
4531 |
^ #( |
|
2188 | 4532 |
(Basics basicsEditSpec) |
1844 | 4533 |
) |
4534 |
! ! |
|
4535 |
||
4536 |
!MenuEditor::MenuSliceItem methodsFor:'aspects'! |
|
4537 |
||
4538 |
argument:aValue |
|
4539 |
menuItem argument:aValue. |
|
4540 |
! |
|
4541 |
||
4542 |
aspectAt:aKey put:aValue |
|
2075 | 4543 |
"set a specific aspect named aKey to the aValue" |
4544 |
||
1844 | 4545 |
aKey == #submenuChannel ifTrue:[ ^ self submenuChannel:aValue ]. |
4546 |
aKey == #isSliceMenu ifTrue:[ ^ self ]. |
|
4547 |
||
4548 |
super aspectAt:aKey put:aValue. |
|
2075 | 4549 |
|
4550 |
"Modified: / 05-09-2006 / 17:47:42 / cg" |
|
1844 | 4551 |
! |
4552 |
||
4553 |
submenuChannel |
|
4554 |
^ menuItem submenuChannel ? #unspecified |
|
4555 |
! |
|
4556 |
||
4557 |
submenuChannel:aValue |
|
4558 |
menuItem submenuChannel:aValue. |
|
4559 |
! ! |
|
4560 |
||
1633 | 4561 |
!MenuEditor::RegularMenuItem class methodsFor:'defaults'! |
1606 | 4562 |
|
4563 |
defaultDelayedLabel |
|
4564 |
^ 'delayed' |
|
199 | 4565 |
! |
4566 |
||
1606 | 4567 |
defaultLabel |
4568 |
^ 'Menu' |
|
4569 |
! ! |
|
4570 |
||
1633 | 4571 |
!MenuEditor::RegularMenuItem class methodsFor:'instance creation'! |
1606 | 4572 |
|
4573 |
menu:aMenu labeled:aString |
|
4574 |
|item| |
|
4575 |
||
4576 |
item := self new. |
|
4577 |
item menu:aMenu labeled:aString. |
|
1631 | 4578 |
^ item |
4579 |
! |
|
4580 |
||
4581 |
menu:aMenu labeled:aString translateLabel:translateLabel |
|
4582 |
|item| |
|
4583 |
||
4584 |
item := self new. |
|
4585 |
item menu:aMenu labeled:aString. |
|
4586 |
item translateLabel:translateLabel. |
|
4587 |
^ item |
|
1606 | 4588 |
! ! |
4589 |
||
1668 | 4590 |
!MenuEditor::RegularMenuItem class methodsFor:'interface specs'! |
1606 | 4591 |
|
4592 |
basicsEditSpec |
|
4593 |
"This resource specification was automatically generated |
|
4594 |
by the UIPainter of ST/X." |
|
4595 |
||
4596 |
"Do not manually edit this!! If it is corrupted, |
|
4597 |
the UIPainter may not be able to read the specification." |
|
4598 |
||
4599 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4600 |
UIPainter new openOnClass:MenuEditor::RegularMenuItem andSelector:#basicsEditSpec |
1606 | 4601 |
" |
4602 |
||
4603 |
<resource: #canvas> |
|
4604 |
||
2188 | 4605 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4606 |
#(FullSpec |
2188 | 4607 |
name: basicsEditSpec |
4608 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4609 |
(WindowSpec |
2188 | 4610 |
label: 'basicsEditSpec' |
4611 |
name: 'basicsEditSpec' |
|
4612 |
min: (Point 10 10) |
|
4613 |
bounds: (Rectangle 0 0 340 340) |
|
4614 |
) |
|
4615 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4616 |
(SpecCollection |
2188 | 4617 |
collection: ( |
4618 |
(LabelSpec |
|
4619 |
label: 'Name Key:' |
|
4620 |
name: 'nameKeyLabel' |
|
4621 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
4622 |
activeHelpKey: basicsKey |
|
4623 |
visibilityChannel: notDelayedMenu |
|
4624 |
translateLabel: true |
|
4625 |
resizeForLabel: true |
|
4626 |
adjust: right |
|
4627 |
) |
|
4628 |
(InputFieldSpec |
|
4629 |
name: 'nameKeyField' |
|
4630 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
4631 |
activeHelpKey: basicsKey |
|
4632 |
visibilityChannel: notDelayedMenu |
|
4633 |
tabable: true |
|
4634 |
model: nameKey |
|
4635 |
group: inputGroup |
|
4636 |
type: symbolOrNil |
|
4637 |
immediateAccept: false |
|
4638 |
acceptOnLeave: false |
|
4639 |
acceptOnReturn: true |
|
4640 |
acceptOnTab: true |
|
4641 |
acceptOnLostFocus: false |
|
4642 |
acceptChannel: acceptChannel |
|
4643 |
modifiedChannel: modifiedChannel |
|
4644 |
acceptOnPointerLeave: false |
|
4645 |
) |
|
4646 |
(LabelSpec |
|
4647 |
label: 'Label:' |
|
4648 |
name: 'labelLabel' |
|
4649 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4650 |
activeHelpKey: basicsLabel |
|
4651 |
visibilityChannel: notDelayedMenu |
|
4652 |
translateLabel: true |
|
4653 |
resizeForLabel: true |
|
4654 |
adjust: right |
|
4655 |
) |
|
4656 |
(InputFieldSpec |
|
4657 |
name: 'labelField' |
|
4658 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
4659 |
activeHelpKey: basicsLabel |
|
4660 |
visibilityChannel: notDelayedMenu |
|
4661 |
tabable: true |
|
4662 |
model: rawLabel |
|
4663 |
group: inputGroup |
|
4664 |
immediateAccept: false |
|
4665 |
acceptOnReturn: true |
|
4666 |
acceptOnTab: true |
|
4667 |
acceptOnLostFocus: false |
|
4668 |
acceptChannel: acceptChannel |
|
4669 |
modifiedChannel: modifiedChannel |
|
4670 |
acceptOnPointerLeave: false |
|
4671 |
) |
|
4672 |
(CheckBoxSpec |
|
4673 |
label: 'Translate Label' |
|
4674 |
name: 'translateLabelCheckBox' |
|
4675 |
layout: (Point 20 213) |
|
4676 |
activeHelpKey: basicsTranslateLabel |
|
4677 |
visibilityChannel: notDelayedMenu |
|
4678 |
tabable: true |
|
4679 |
model: translateLabel |
|
4680 |
translateLabel: true |
|
4681 |
) |
|
4682 |
(CheckBoxSpec |
|
4683 |
label: 'Is Button' |
|
4684 |
name: 'isButtonCheckBox' |
|
4685 |
layout: (Point 20 238) |
|
4686 |
activeHelpKey: basicsIsButton |
|
4687 |
visibilityChannel: notDelayedMenu |
|
4688 |
tabable: true |
|
4689 |
model: isButton |
|
4690 |
translateLabel: true |
|
4691 |
) |
|
4692 |
(CheckBoxSpec |
|
4693 |
label: 'Horizontal Layout' |
|
4694 |
name: 'horizontalLayout' |
|
4695 |
layout: (Point 20 263) |
|
4696 |
activeHelpKey: horizontalLayout |
|
4697 |
tabable: true |
|
4698 |
model: horizontalLayout |
|
4699 |
translateLabel: true |
|
4700 |
) |
|
4701 |
) |
|
4702 |
||
4703 |
) |
|
1606 | 4704 |
) |
4705 |
! ! |
|
4706 |
||
1633 | 4707 |
!MenuEditor::RegularMenuItem methodsFor:'accessing'! |
1606 | 4708 |
|
4709 |
argument:aValue |
|
4710 |
"/ ignorred. |
|
218 | 4711 |
! |
4712 |
||
1606 | 4713 |
menu:aMenu labeled:aString |
4714 |
|expanded item menu| |
|
4715 |
||
4716 |
self criticalDo:[ |
|
2188 | 4717 |
self isRootItem ifTrue:[ expanded := true ] |
4718 |
ifFalse:[ expanded := isExpanded ]. |
|
4719 |
||
4720 |
self removeAll. |
|
4721 |
self rawLabel:aString. |
|
4722 |
||
4723 |
menu := aMenu value. |
|
4724 |
||
4725 |
(menu isNil or:[menu isString]) ifTrue:[ |
|
4726 |
menu := nil |
|
4727 |
] ifFalse:[ |
|
4728 |
aMenu isCollection ifTrue:[ menu := Menu decodeFromLiteralArray:aMenu ] |
|
4729 |
ifFalse:[ menu := aMenu ]. |
|
4730 |
||
4731 |
menu numberOfItems == 0 ifTrue:[ |
|
4732 |
menu := nil |
|
4733 |
]. |
|
4734 |
]. |
|
4735 |
menu ifNotNil:[ |
|
4736 |
isExpanded := false. "/ discard change notifications |
|
4737 |
children := OrderedCollection new. |
|
4738 |
||
4739 |
menu itemsDo:[:el| |
|
4740 |
item := self class menuItem:el. |
|
4741 |
item parent:self. |
|
4742 |
children add:item. |
|
4743 |
]. |
|
4744 |
expanded ifTrue:[ self expand ]. |
|
4745 |
]. |
|
4746 |
isExpanded := expanded. |
|
4747 |
]. |
|
1606 | 4748 |
self changed |
2168 | 4749 |
|
4750 |
"Modified: / 27-03-2007 / 08:43:07 / cg" |
|
199 | 4751 |
! |
4752 |
||
1606 | 4753 |
menuItem |
4754 |
"returns self as a MenuItem |
|
4755 |
" |
|
4756 |
|item| |
|
4757 |
||
4758 |
item := super menuItem. |
|
4759 |
item submenu:(self submenu). |
|
4760 |
^ item |
|
199 | 4761 |
! |
4762 |
||
1606 | 4763 |
menuItem:anItem |
4764 |
||
4765 |
super menuItem:anItem. |
|
4766 |
self menu:(anItem submenu) labeled:nil. |
|
4767 |
! |
|
4768 |
||
4769 |
slices |
|
4770 |
self isDelayedMenu ifTrue:[ |
|
2188 | 4771 |
^ #( |
4772 |
(Basics basicsEditSpec ) |
|
4773 |
) |
|
1606 | 4774 |
]. |
4775 |
||
4776 |
^ #( |
|
2188 | 4777 |
(Basics basicsEditSpec ) |
4778 |
(Details detailsEditSpec) |
|
4779 |
(Image image ) |
|
4780 |
(Help help) |
|
1606 | 4781 |
) |
4782 |
! |
|
4783 |
||
4784 |
submenu |
|
4785 |
|menu| |
|
4786 |
||
4787 |
menu := Menu new. |
|
4788 |
||
4789 |
children size ~~ 0 ifTrue:[ |
|
4790 |
children do:[:el| menu addItem:(el menuItem) ]. |
|
4791 |
]. |
|
4792 |
^ menu |
|
4793 |
! ! |
|
4794 |
||
1633 | 4795 |
!MenuEditor::RegularMenuItem methodsFor:'aspects'! |
1606 | 4796 |
|
4797 |
getDelayedAttributesFrom:aMenuItem |
|
4798 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4799 |
|menu| |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4800 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4801 |
menu := self validateValue:(aMenuItem submenu value). |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4802 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
4803 |
self menu:menu labeled:nil. |
1606 | 4804 |
menuItem horizontalLayout:(aMenuItem horizontalLayout). |
4805 |
! |
|
4806 |
||
4807 |
setDelayedAttributesTo:aMenuItem |
|
4808 |
aMenuItem submenu:(self submenu). |
|
4809 |
aMenuItem horizontalLayout:(menuItem horizontalLayout). |
|
4810 |
! ! |
|
4811 |
||
1633 | 4812 |
!MenuEditor::RegularMenuItem methodsFor:'displaying'! |
1606 | 4813 |
|
4814 |
displayLabel |
|
4815 |
"returns the label dependent on is delayed or not |
|
4816 |
" |
|
4817 |
self isDelayedMenu ifTrue:[ ^ self class defaultDelayedLabel ]. |
|
4818 |
^ menuItem rawLabel |
|
4819 |
! |
|
4820 |
||
4821 |
icon |
|
4822 |
self isDelayedMenu ifTrue:[ ^ self class iconDelayedMenu ]. |
|
4823 |
^ self class iconMenu |
|
4824 |
! ! |
|
4825 |
||
1633 | 4826 |
!MenuEditor::RegularMenuItem methodsFor:'queries'! |
1606 | 4827 |
|
4828 |
canAddChildren |
|
4829 |
"children can be added |
|
4830 |
" |
|
4831 |
^ true |
|
4832 |
! |
|
4833 |
||
4834 |
canExpand |
|
4835 |
"returns true if the item is expandable |
|
4836 |
" |
|
4837 |
^ isExpanded == false |
|
4838 |
! |
|
4839 |
||
4840 |
hasIndicator |
|
4841 |
^ true |
|
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
4842 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
4843 |
|
1606 | 4844 |
isKindOfMenu |
4845 |
^ true |
|
4846 |
! ! |
|
4847 |
||
4848 |
!MenuEditor::ResourceEditor class methodsFor:'interface specs'! |
|
4849 |
||
4850 |
windowSpec |
|
4851 |
"This resource specification was automatically generated |
|
4852 |
by the UIPainter of ST/X." |
|
4853 |
||
4854 |
"Do not manually edit this!! If it is corrupted, |
|
4855 |
the UIPainter may not be able to read the specification." |
|
4856 |
||
4857 |
" |
|
4858 |
UIPainter new openOnClass:MenuEditor::ResourceEditor andSelector:#windowSpec |
|
4859 |
MenuEditor::ResourceEditor new openInterface:#windowSpec |
|
4860 |
MenuEditor::ResourceEditor open |
|
4861 |
" |
|
4862 |
||
4863 |
<resource: #canvas> |
|
4864 |
||
2188 | 4865 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4866 |
#(FullSpec |
2188 | 4867 |
name: windowSpec |
4868 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4869 |
(WindowSpec |
2188 | 4870 |
label: 'Image Item' |
4871 |
name: 'Image Item' |
|
4872 |
min: (Point 10 10) |
|
4873 |
bounds: (Rectangle 0 0 288 295) |
|
4874 |
) |
|
4875 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4876 |
(SpecCollection |
2188 | 4877 |
collection: ( |
4878 |
(LabelSpec |
|
4879 |
label: 'Retriever:' |
|
4880 |
name: 'retrieverLabel' |
|
4881 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
4882 |
activeHelpKey: imageRetriever |
|
4883 |
translateLabel: true |
|
4884 |
resizeForLabel: true |
|
4885 |
adjust: right |
|
4886 |
) |
|
4887 |
(ComboBoxSpec |
|
4888 |
name: 'retrieverHolder' |
|
4889 |
layout: (LayoutFrame 110 0 15 0 -20 1.0 37 0) |
|
4890 |
activeHelpKey: imageRetriever |
|
4891 |
tabable: true |
|
4892 |
model: retrieverHolder |
|
4893 |
type: symbolOrNil |
|
4894 |
immediateAccept: true |
|
4895 |
acceptOnReturn: false |
|
4896 |
acceptOnTab: false |
|
4897 |
acceptOnPointerLeave: false |
|
4898 |
entryCompletionBlock: entryCompletionForRetriever |
|
4899 |
comboList: retrieverList |
|
4900 |
isFilenameBox: false |
|
4901 |
) |
|
4902 |
(LabelSpec |
|
4903 |
label: 'Selector:' |
|
4904 |
name: 'iconLabel' |
|
4905 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4906 |
activeHelpKey: imageSelector |
|
4907 |
translateLabel: true |
|
4908 |
resizeForLabel: true |
|
4909 |
adjust: right |
|
4910 |
) |
|
4911 |
(InputFieldSpec |
|
4912 |
name: 'selectorHolder' |
|
4913 |
layout: (LayoutFrame 110 0 40 0 -42 1.0 62 0) |
|
4914 |
activeHelpKey: imageSelector |
|
4915 |
tabable: true |
|
4916 |
model: selectorHolder |
|
4917 |
group: inputGroup |
|
4918 |
type: symbolOrNil |
|
4919 |
immediateAccept: true |
|
4920 |
acceptOnReturn: false |
|
4921 |
acceptOnTab: false |
|
4922 |
modifiedChannel: modifiedChannel |
|
4923 |
acceptOnPointerLeave: false |
|
4924 |
) |
|
4925 |
(ActionButtonSpec |
|
4926 |
label: '...' |
|
4927 |
name: 'browseButton' |
|
4928 |
layout: (LayoutFrame -40 1 40 0 -20 1 62 0) |
|
4929 |
activeHelpKey: browseResource |
|
4930 |
tabable: true |
|
4931 |
model: doBrowseForImageResource |
|
4932 |
) |
|
4933 |
(HierarchicalListViewSpec |
|
4934 |
name: 'imageList' |
|
4935 |
layout: (LayoutFrame 20 0.0 67 0 -20 1.0 -30 1.0) |
|
4936 |
activeHelpKey: imageImageList |
|
4937 |
model: imageHolder |
|
4938 |
menu: menuEditImage |
|
4939 |
hasHorizontalScrollBar: true |
|
4940 |
hasVerticalScrollBar: true |
|
4941 |
miniScrollerHorizontal: true |
|
4942 |
listModel: imageList |
|
4943 |
useIndex: false |
|
4944 |
highlightMode: label |
|
4945 |
postBuildCallback: postBuildImageViewer: |
|
4946 |
) |
|
4947 |
(ViewSpec |
|
4948 |
name: 'Box1' |
|
4949 |
layout: (LayoutFrame 20 0.0 -30 1.0 -20 1.0 0 1.0) |
|
4950 |
level: 0 |
|
4951 |
component: |
|
4952 |
(SpecCollection |
|
4953 |
collection: ( |
|
4954 |
(CheckBoxSpec |
|
4955 |
label: 'Image & Label' |
|
4956 |
name: 'iconAndLabelCheckBox' |
|
4957 |
layout: (AlignmentOrigin 0 0 0 0.5 0 0.5) |
|
4958 |
activeHelpKey: imageImageAndLabel |
|
4959 |
tabable: true |
|
4960 |
model: iconAndLabelHolder |
|
4961 |
translateLabel: true |
|
4962 |
) |
|
4963 |
(ActionButtonSpec |
|
4964 |
label: 'Image Editor' |
|
4965 |
name: 'imageEditorButton' |
|
4966 |
layout: (AlignmentOrigin 0 1.0 0 0.5 1 0.5) |
|
4967 |
activeHelpKey: imageImageEditor |
|
4968 |
hasCharacterOrientedLabel: false |
|
4969 |
tabable: true |
|
4970 |
model: doEditImage |
|
4971 |
) |
|
4972 |
) |
|
4973 |
||
4974 |
) |
|
4975 |
) |
|
4976 |
) |
|
4977 |
||
4978 |
) |
|
1606 | 4979 |
) |
4980 |
! ! |
|
4981 |
||
4982 |
!MenuEditor::ResourceEditor methodsFor:'accessing'! |
|
4983 |
||
4984 |
resourceRetriever |
|
4985 |
|rcv sel cls| |
|
4986 |
||
4987 |
sel := selectorHolder value. |
|
4988 |
sel size == 0 ifTrue:[ ^ nil ]. |
|
4989 |
cls := self retrieverClass. |
|
4990 |
cls ifNotNil:[ cls := cls name asSymbol ]. |
|
4991 |
||
4992 |
rcv := ResourceRetriever new. |
|
4993 |
rcv className:cls. |
|
4994 |
rcv selector:sel. |
|
4995 |
||
4996 |
iconAndLabelHolder value ifTrue:[ rcv labelText:'' ]. |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
4997 |
^ rcv |
1606 | 4998 |
! |
4999 |
||
5000 |
resourceRetriever:aResourceRetriever |
|
5001 |
|cls sel isOn| |
|
5002 |
||
5003 |
aResourceRetriever notNil ifTrue:[ |
|
5004 |
cls := aResourceRetriever className. |
|
5005 |
cls ifNotNil:[ |
|
5006 |
cls isBehavior ifTrue:[cls := cls name asSymbol]. |
|
5007 |
]. |
|
5008 |
sel := aResourceRetriever selector. |
|
5009 |
isOn := aResourceRetriever labelText notNil. |
|
5010 |
] ifFalse:[ |
|
5011 |
cls := sel := nil. |
|
5012 |
isOn := false. |
|
1586 | 5013 |
]. |
1606 | 5014 |
|
5015 |
retrieverHolder value:cls. |
|
5016 |
selectorHolder value:sel. |
|
5017 |
iconAndLabelHolder value:isOn. |
|
5018 |
! |
|
5019 |
||
5020 |
retrieverClass |
|
5021 |
|cls| |
|
5022 |
||
5023 |
cls := retrieverHolder value. |
|
5024 |
||
5025 |
cls size ~~ 0 ifTrue:[ |
|
5026 |
cls := Smalltalk at:cls ifAbsent:nil. |
|
5027 |
||
5028 |
(cls notNil and:[cls isBehavior]) ifTrue:[ |
|
5029 |
^ cls |
|
5030 |
]. |
|
5031 |
]. |
|
5032 |
^ nil |
|
5033 |
! ! |
|
5034 |
||
5035 |
!MenuEditor::ResourceEditor methodsFor:'actions'! |
|
5036 |
||
5037 |
doBrowseForImageResource |
|
5038 |
"opens a browser on image-resource methods" |
|
5039 |
||
1971 | 5040 |
|classAndSelector| |
5041 |
||
5042 |
classAndSelector := ResourceSelectionBrowser |
|
2188 | 5043 |
request:'Use Image From Class' |
5044 |
onSuperclass:nil |
|
5045 |
andClass:(self retrieverClass) |
|
5046 |
andSelector:(selectorHolder value) |
|
5047 |
withResourceTypes:#(image fileImage programImage). |
|
1971 | 5048 |
|
5049 |
classAndSelector isNil ifTrue:[ ^ self ]. |
|
5050 |
||
5051 |
retrieverHolder value:(classAndSelector methodClass) name. |
|
5052 |
selectorHolder value:(classAndSelector methodSelector). |
|
1606 | 5053 |
! |
5054 |
||
5055 |
doEditImage |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5056 |
|sel cls item| |
1606 | 5057 |
|
5058 |
item := imageHolder value. |
|
2188 | 5059 |
item notNil ifTrue:[ |
5060 |
item doEdit |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5061 |
] ifFalse:[ |
2188 | 5062 |
(sel := selectorHolder value) isNil ifTrue:[ |
5063 |
Dialog warn:'No selector is defined.'. |
|
5064 |
] ifFalse:[ |
|
5065 |
(cls := retrieverHolder value) isNil ifTrue:[ |
|
5066 |
Dialog warn:'No resource retriever is defined.'. |
|
5067 |
] ifFalse:[ |
|
5068 |
cls := Smalltalk classNamed:cls. |
|
5069 |
cls isNil ifTrue:[ |
|
5070 |
Dialog warn:'No such resource retriever class.'. |
|
5071 |
] ifFalse:[ |
|
5072 |
ImageEditor openOnClass:cls andSelector:sel |
|
5073 |
] |
|
5074 |
] |
|
5075 |
] |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5076 |
]. |
1606 | 5077 |
! ! |
5078 |
||
5079 |
!MenuEditor::ResourceEditor methodsFor:'aspects'! |
|
5080 |
||
1853
bd6900fa7f50
retriever field in Image-Slice: class-name completion
Claus Gittinger <cg@exept.de>
parents:
1848
diff
changeset
|
5081 |
entryCompletionForRetriever |
2057 | 5082 |
^ DoWhatIMeanSupport classNameEntryCompletionBlock. |
5083 |
||
5084 |
"Modified: / 10-08-2006 / 12:55:22 / cg" |
|
1853
bd6900fa7f50
retriever field in Image-Slice: class-name completion
Claus Gittinger <cg@exept.de>
parents:
1848
diff
changeset
|
5085 |
! |
bd6900fa7f50
retriever field in Image-Slice: class-name completion
Claus Gittinger <cg@exept.de>
parents:
1848
diff
changeset
|
5086 |
|
1606 | 5087 |
iconAndLabelHolder |
5088 |
^ iconAndLabelHolder |
|
5089 |
! |
|
5090 |
||
5091 |
imageHolder |
|
5092 |
^ imageHolder. |
|
603 | 5093 |
! |
5094 |
||
1606 | 5095 |
imageList |
5096 |
^ imageList. |
|
5097 |
! |
|
5098 |
||
5099 |
modifiedChannel |
|
5100 |
^ builder booleanValueAspectFor: #modifiedChannel |
|
5101 |
! |
|
5102 |
||
5103 |
modifiedChannel:aChannel |
|
5104 |
builder aspectAt:#modifiedChannel put:aChannel. |
|
5105 |
! |
|
5106 |
||
5107 |
retrieverHolder |
|
5108 |
^ retrieverHolder |
|
5109 |
! |
|
5110 |
||
5111 |
retrieverList |
|
5112 |
|list| |
|
5113 |
||
5114 |
list := builder bindingAt:#retrieverList. |
|
5115 |
||
2151 | 5116 |
list isNil ifTrue:[ |
2188 | 5117 |
list := MenuEditor imageRetrieverClasses asList. |
5118 |
builder aspectAt:#retrieverList put:list. |
|
1606 | 5119 |
]. |
5120 |
^ list |
|
199 | 5121 |
! |
5122 |
||
1606 | 5123 |
selectorHolder |
5124 |
^ selectorHolder. |
|
5125 |
! ! |
|
5126 |
||
5127 |
!MenuEditor::ResourceEditor methodsFor:'change & update'! |
|
5128 |
||
5129 |
retrieverChanged |
|
5130 |
"called if the retriever changed |
|
5131 |
" |
|
5132 |
|retriever list name| |
|
5133 |
||
5134 |
retriever := self retrieverClass. |
|
5135 |
imageHolder setValue:nil. |
|
5136 |
||
5137 |
imageList root fromClass:retriever. |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5138 |
self updateImageHolder. |
1606 | 5139 |
|
5140 |
(retriever notNil and:[imageList size ~~ 0]) ifTrue:[ |
|
2188 | 5141 |
list := self retrieverList. |
5142 |
name := retriever name. |
|
5143 |
||
5144 |
(list includes:name) ifFalse:[ |
|
5145 |
list add:(name asSymbol). |
|
5146 |
] |
|
1606 | 5147 |
]. |
398 | 5148 |
! |
5149 |
||
1606 | 5150 |
selectorChanged |
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5151 |
self updateImageHolder. |
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
5152 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
5153 |
|
1606 | 5154 |
update:what with:aPara from:aModel |
5155 |
|item| |
|
5156 |
||
5157 |
self modifiedChannel value:true. |
|
5158 |
||
5159 |
aModel == retrieverHolder ifTrue:[ ^ self retrieverChanged ]. |
|
5160 |
aModel == selectorHolder ifTrue:[ ^ self selectorChanged ]. |
|
5161 |
||
5162 |
aModel == imageHolder ifTrue:[ |
|
2188 | 5163 |
item := imageHolder value. |
5164 |
item ifNotNil:[ selectorHolder value:(item label) ]. |
|
5165 |
^ self |
|
1606 | 5166 |
]. |
5167 |
super update:what with:aPara from:aModel |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5168 |
! |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5169 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5170 |
updateImageHolder |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5171 |
|item selector line| |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5172 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5173 |
imageList isEmpty ifTrue:[^ self]. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5174 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5175 |
selector := selectorHolder value. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5176 |
selector size == 0 ifTrue:[ imageHolder value:nil. ^ self ]. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5177 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5178 |
item := nil. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5179 |
selector := selector asSymbol. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5180 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5181 |
imageList do:[:anItem| |sel| |
2188 | 5182 |
sel := anItem selector. |
5183 |
selector == sel ifTrue:[ |
|
5184 |
imageHolder value:anItem. |
|
5185 |
^ self |
|
5186 |
]. |
|
5187 |
item isNil ifTrue:[ |
|
5188 |
(sel startsWith:selector) ifTrue:[ item := anItem ] |
|
5189 |
] |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5190 |
]. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5191 |
imageHolder value:nil. |
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5192 |
|
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5193 |
item ifNotNil:[ |
2188 | 5194 |
line := imageList identityIndexOf:item. |
5195 |
imageViewer scrollToLine:line |
|
1641
7e63a11f3333
allow editing even if there is no image yet
Claus Gittinger <cg@exept.de>
parents:
1636
diff
changeset
|
5196 |
]. |
1606 | 5197 |
! ! |
5198 |
||
5199 |
!MenuEditor::ResourceEditor methodsFor:'initialization'! |
|
5200 |
||
5201 |
initialize |
|
5202 |
super initialize. |
|
5203 |
||
5204 |
iconAndLabelHolder := true asValue. |
|
5205 |
iconAndLabelHolder addDependent:self. |
|
5206 |
||
5207 |
imageHolder := nil asValue. |
|
5208 |
||
5209 |
selectorHolder := nil asValue. |
|
5210 |
selectorHolder addDependent:self. |
|
5211 |
||
5212 |
imageList := HierarchicalList new. |
|
5213 |
imageList application:self. |
|
5214 |
imageList root:(MenuEditor::ResourceEditorItem new). |
|
5215 |
imageList showRoot:false. |
|
5216 |
||
5217 |
imageHolder := nil asValue. |
|
5218 |
imageHolder addDependent:self. |
|
5219 |
||
5220 |
retrieverHolder := nil asValue. |
|
5221 |
retrieverHolder addDependent:self. |
|
5222 |
! |
|
5223 |
||
5224 |
postBuildImageViewer:aWidget |
|
5225 |
imageViewer := aWidget. |
|
5226 |
! ! |
|
5227 |
||
5228 |
!MenuEditor::ResourceEditorItem class methodsFor:'instance creation'! |
|
5229 |
||
5230 |
fromClass:aClass selector:aSelector |
|
5231 |
|item| |
|
5232 |
||
5233 |
item := self new. |
|
5234 |
item fromClass:aClass selector:aSelector. |
|
1867
08860770cd69
also offer programImages in image-list
Claus Gittinger <cg@exept.de>
parents:
1853
diff
changeset
|
5235 |
^ item |
1606 | 5236 |
! ! |
5237 |
||
5238 |
!MenuEditor::ResourceEditorItem methodsFor:'accessing'! |
|
5239 |
||
5240 |
icon |
|
5241 |
^ icon |
|
5242 |
! |
|
5243 |
||
5244 |
label |
|
5245 |
^ selector |
|
557 | 5246 |
! |
5247 |
||
1606 | 5248 |
selector |
5249 |
^ selector |
|
5250 |
! ! |
|
5251 |
||
5252 |
!MenuEditor::ResourceEditorItem methodsFor:'instance creation'! |
|
5253 |
||
5254 |
fromClass:aClass |
|
5255 |
|r item| |
|
5256 |
||
5257 |
(aClass notNil and:[aClass isBehavior]) ifFalse:[ |
|
5258 |
^ self collapse. |
|
5259 |
]. |
|
5260 |
aClass == selector ifTrue:[ |
|
5261 |
^ self expand |
|
5262 |
]. |
|
5263 |
self collapse. |
|
5264 |
||
5265 |
selector := aClass. |
|
5266 |
children := SortedCollection sortBlock:[:a :b| a label < b label ]. |
|
5267 |
||
5268 |
self application withWaitCursorDo:[ |
|
5269 |
aClass withAllSuperclassesDo:[:aClass| |
|
2188 | 5270 |
aClass class selectorsAndMethodsDo:[:sel :m| |
1606 | 5271 |
((r := m resourceType) == #image or:[r == #programImage]) ifTrue:[ |
5272 |
item := self class fromClass:aClass selector:sel. |
|
5273 |
item parent:self. |
|
5274 |
children add:item |
|
5275 |
] |
|
5276 |
] |
|
5277 |
]. |
|
5278 |
self expand |
|
5279 |
]. |
|
5280 |
! |
|
5281 |
||
5282 |
fromClass:aClass selector:aSelector |
|
5283 |
|w h magnify| |
|
5284 |
||
5285 |
selector := aSelector asSymbol. |
|
1867
08860770cd69
also offer programImages in image-list
Claus Gittinger <cg@exept.de>
parents:
1853
diff
changeset
|
5286 |
selector numArgs == 0 ifFalse:[^ self]. |
08860770cd69
also offer programImages in image-list
Claus Gittinger <cg@exept.de>
parents:
1853
diff
changeset
|
5287 |
|
1606 | 5288 |
icon := aClass perform:selector. |
5289 |
||
5290 |
w := icon width. |
|
5291 |
h := icon height. |
|
5292 |
||
5293 |
w > 32 ifTrue:[ |
|
2188 | 5294 |
magnify := 32 / w. |
5295 |
h > 32 ifTrue:[ magnify := (32 / h) max:magnify ]. |
|
1606 | 5296 |
] ifFalse:[ |
2188 | 5297 |
h > 32 ifFalse:[^ self]. |
5298 |
magnify := 32 / h. |
|
1606 | 5299 |
]. |
5300 |
icon := icon magnifiedBy: magnify. |
|
5301 |
! |
|
5302 |
||
5303 |
initialize |
|
5304 |
super initialize. |
|
5305 |
children := #(). |
|
5306 |
! ! |
|
5307 |
||
5308 |
!MenuEditor::ResourceEditorItem methodsFor:'user operations'! |
|
5309 |
||
5310 |
doEdit |
|
5311 |
"open image browser on self |
|
5312 |
" |
|
5313 |
|parent| |
|
5314 |
||
5315 |
parent := self parent. |
|
5316 |
||
5317 |
parent ifNotNil:[ |
|
5318 |
ImageEditor openOnClass:(parent selector) andSelector:selector |
|
5319 |
]. |
|
199 | 5320 |
! ! |
5321 |
||
1631 | 5322 |
!MenuEditor::RootItem class methodsFor:'defaults'! |
5323 |
||
5324 |
defaultLabel |
|
5325 |
^ MenuEditor resourceType |
|
5326 |
! ! |
|
5327 |
||
1668 | 5328 |
!MenuEditor::RootItem class methodsFor:'interface specs'! |
1631 | 5329 |
|
5330 |
basicsEditSpec |
|
5331 |
"This resource specification was automatically generated |
|
5332 |
by the UIPainter of ST/X." |
|
5333 |
||
5334 |
"Do not manually edit this!! If it is corrupted, |
|
5335 |
the UIPainter may not be able to read the specification." |
|
5336 |
||
5337 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5338 |
UIPainter new openOnClass:MenuEditor::RootItem andSelector:#basicsEditSpec |
1631 | 5339 |
" |
5340 |
||
5341 |
<resource: #canvas> |
|
5342 |
||
2188 | 5343 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5344 |
#(FullSpec |
2188 | 5345 |
name: basicsEditSpec |
5346 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5347 |
(WindowSpec |
2188 | 5348 |
label: 'basicsEditSpec' |
5349 |
name: 'basicsEditSpec' |
|
5350 |
min: (Point 10 10) |
|
5351 |
bounds: (Rectangle 0 0 260 46) |
|
5352 |
) |
|
5353 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5354 |
(SpecCollection |
2188 | 5355 |
collection: ( |
5356 |
(LabelSpec |
|
5357 |
label: 'Selector:' |
|
5358 |
name: 'selectorLabel' |
|
5359 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
5360 |
activeHelpKey: basicsSelector |
|
5361 |
translateLabel: true |
|
5362 |
resizeForLabel: true |
|
5363 |
adjust: right |
|
5364 |
) |
|
5365 |
(InputFieldSpec |
|
5366 |
name: 'selectorField' |
|
5367 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5368 |
activeHelpKey: basicsSelector |
|
5369 |
tabable: true |
|
5370 |
model: rawLabel |
|
5371 |
group: inputGroup |
|
5372 |
type: string |
|
5373 |
immediateAccept: false |
|
5374 |
acceptOnReturn: true |
|
5375 |
acceptOnTab: true |
|
5376 |
acceptChannel: acceptChannel |
|
5377 |
modifiedChannel: modifiedChannel |
|
5378 |
acceptOnPointerLeave: false |
|
5379 |
) |
|
5380 |
) |
|
5381 |
||
5382 |
) |
|
1631 | 5383 |
) |
5384 |
! ! |
|
5385 |
||
1725 | 5386 |
!MenuEditor::RootItem class methodsFor:'interface-editor'! |
5387 |
||
5388 |
addBindingsTo:aspects for:aMenuEditor |
|
5389 |
"add additional bindings to the aspects |
|
5390 |
" |
|
5391 |
! ! |
|
5392 |
||
1631 | 5393 |
!MenuEditor::RootItem methodsFor:'accessing'! |
5394 |
||
5395 |
menuItem:aMenuItem |
|
5396 |
"rebuild self from a MenuItem |
|
5397 |
" |
|
5398 |
|submenu selector| |
|
5399 |
||
5400 |
aMenuItem notNil ifTrue:[ |
|
5401 |
submenu := aMenuItem submenu. |
|
5402 |
selector := aMenuItem rawLabel. |
|
5403 |
] ifFalse:[ |
|
5404 |
selector := submenu := nil. |
|
5405 |
]. |
|
5406 |
self menu:submenu labeled:selector. |
|
5407 |
! |
|
5408 |
||
5409 |
rawLabel:aValue |
|
5410 |
"set the label assigned to the item |
|
5411 |
" |
|
5412 |
|value| |
|
5413 |
||
5414 |
aValue isString ifTrue:[ |
|
2188 | 5415 |
value := aValue withoutSeparators. |
5416 |
||
5417 |
(value notEmpty and:[value first isLetter]) ifTrue:[ |
|
5418 |
menuItem rawLabel:(value asSymbol) |
|
5419 |
]. |
|
1631 | 5420 |
]. |
5421 |
! |
|
5422 |
||
5423 |
slices |
|
5424 |
^ #( |
|
5425 |
(Basics basicsEditSpec) |
|
5426 |
) |
|
5427 |
! ! |
|
5428 |
||
5429 |
!MenuEditor::RootItem methodsFor:'adding & removing'! |
|
5430 |
||
5431 |
remove |
|
5432 |
"cannot remove the root item; delete all my children |
|
5433 |
" |
|
5434 |
self removeAll. |
|
5435 |
! ! |
|
5436 |
||
5437 |
!MenuEditor::RootItem methodsFor:'aspects'! |
|
5438 |
||
5439 |
aspectAt:aKey put:aValue |
|
2075 | 5440 |
"ignore all aspects other than the rawLabel" |
5441 |
||
1631 | 5442 |
aKey == #rawLabel ifTrue:[ self rawLabel:aValue ]. |
2075 | 5443 |
|
5444 |
"Modified: / 05-09-2006 / 17:48:01 / cg" |
|
1631 | 5445 |
! ! |
5446 |
||
5447 |
!MenuEditor::RootItem methodsFor:'displaying'! |
|
5448 |
||
5449 |
heightOn:aGC |
|
2151 | 5450 |
height isNil ifTrue:[ height := aGC font heightOn:aGC device ]. |
5451 |
^ height |
|
1631 | 5452 |
! ! |
5453 |
||
5454 |
!MenuEditor::RootItem methodsFor:'initialization'! |
|
5455 |
||
5456 |
initialize |
|
5457 |
super initialize. |
|
5458 |
isExpanded := true. |
|
5459 |
! ! |
|
5460 |
||
5461 |
!MenuEditor::RootItem methodsFor:'queries'! |
|
5462 |
||
5463 |
canCollapse |
|
5464 |
^ false |
|
5465 |
! |
|
5466 |
||
5467 |
hasIndicator |
|
5468 |
^ false |
|
5469 |
! |
|
5470 |
||
5471 |
isDelayedMenu |
|
5472 |
^ false |
|
5473 |
! |
|
5474 |
||
5475 |
isRootItem |
|
5476 |
^ true |
|
5477 |
! ! |
|
5478 |
||
1660 | 5479 |
!MenuEditor::RootItem methodsFor:'queries-editor'! |
1631 | 5480 |
|
5481 |
actionSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5482 |
"return my action selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5483 |
|
1631 | 5484 |
^ #() |
5485 |
! |
|
5486 |
||
5487 |
aspectSelectors |
|
5488 |
"returns my aspect selectors |
|
5489 |
" |
|
5490 |
^ #() |
|
5491 |
! ! |
|
5492 |
||
1660 | 5493 |
!MenuEditor::RootItem methodsFor:'queries-operation'! |
1631 | 5494 |
|
5495 |
canMoveInAbove |
|
5496 |
^ false |
|
5497 |
! |
|
5498 |
||
5499 |
canMoveInNext |
|
5500 |
^ false |
|
5501 |
! |
|
5502 |
||
5503 |
canMoveOut |
|
5504 |
^ false |
|
5505 |
! |
|
5506 |
||
5507 |
canMoveUpOrDown |
|
5508 |
^ false |
|
5509 |
! ! |
|
5510 |
||
1668 | 5511 |
!MenuEditor::SeparatorItem class methodsFor:'interface specs'! |
1631 | 5512 |
|
5513 |
basicsEditSpec |
|
5514 |
"This resource specification was automatically generated |
|
5515 |
by the UIPainter of ST/X." |
|
5516 |
||
5517 |
"Do not manually edit this!! If it is corrupted, |
|
5518 |
the UIPainter may not be able to read the specification." |
|
5519 |
||
5520 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5521 |
UIPainter new openOnClass:MenuEditor::SeparatorItem andSelector:#basicsEditSpec |
1631 | 5522 |
" |
5523 |
||
5524 |
<resource: #canvas> |
|
5525 |
||
2188 | 5526 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5527 |
#(FullSpec |
2188 | 5528 |
name: basicsEditSpec |
5529 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5530 |
(WindowSpec |
2188 | 5531 |
label: 'basicsEditSpec' |
5532 |
name: 'basicsEditSpec' |
|
5533 |
min: (Point 10 10) |
|
5534 |
bounds: (Rectangle 0 0 260 245) |
|
5535 |
) |
|
5536 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5537 |
(SpecCollection |
2188 | 5538 |
collection: ( |
5539 |
(LabelSpec |
|
5540 |
label: 'Separator:' |
|
5541 |
name: 'separatorLabel' |
|
5542 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
5543 |
translateLabel: true |
|
5544 |
resizeForLabel: true |
|
5545 |
adjust: right |
|
5546 |
) |
|
5547 |
(ComboListSpec |
|
5548 |
name: 'seperatorList' |
|
5549 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5550 |
activeHelpKey: basicsSeparatorType |
|
5551 |
tabable: true |
|
5552 |
model: seperatorSelection |
|
5553 |
comboList: seperatorList |
|
5554 |
useIndex: true |
|
5555 |
) |
|
5556 |
(LabelSpec |
|
5557 |
label: 'Visibility:' |
|
5558 |
name: 'visibilityLabel' |
|
5559 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
5560 |
translateLabel: true |
|
5561 |
resizeForLabel: true |
|
5562 |
adjust: right |
|
5563 |
) |
|
5564 |
(InputFieldSpec |
|
5565 |
name: 'visibilityInputField' |
|
5566 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
5567 |
activeHelpKey: detailsVisibility |
|
5568 |
tabable: true |
|
5569 |
model: isVisible |
|
5570 |
group: inputGroup |
|
5571 |
type: symbolOrBooleanOrNil |
|
5572 |
immediateAccept: false |
|
5573 |
acceptOnReturn: true |
|
5574 |
acceptOnTab: true |
|
5575 |
acceptChannel: acceptChannel |
|
5576 |
modifiedChannel: modifiedChannel |
|
5577 |
acceptOnPointerLeave: false |
|
5578 |
) |
|
5579 |
(LabelSpec |
|
5580 |
label: 'Start Group:' |
|
5581 |
name: 'startGroupLabel' |
|
5582 |
layout: (AlignmentOrigin 107 0 88 0 1 0.5) |
|
5583 |
translateLabel: true |
|
5584 |
resizeForLabel: true |
|
5585 |
adjust: right |
|
5586 |
) |
|
5587 |
(PopUpListSpec |
|
5588 |
label: 'left' |
|
5589 |
name: 'startGroupPopUp' |
|
5590 |
layout: (LayoutFrame 110 0 77 0 -5 1.0 99 0) |
|
5591 |
activeHelpKey: detailsStartGroup |
|
5592 |
tabable: true |
|
5593 |
model: startGroup |
|
5594 |
menu: (left right conditionalRight) |
|
5595 |
) |
|
5596 |
) |
|
5597 |
||
5598 |
) |
|
1631 | 5599 |
) |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
5600 |
|
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
5601 |
"Modified: / 16-10-2006 / 12:48:30 / cg" |
1631 | 5602 |
! ! |
5603 |
||
1725 | 5604 |
!MenuEditor::SeparatorItem class methodsFor:'interface-editor'! |
5605 |
||
5606 |
addBindingsTo:aspects for:aMenuEditor |
|
5607 |
"add additional bindings to the aspects |
|
5608 |
" |
|
5609 |
|holder| |
|
5610 |
||
2188 | 5611 |
aspects |
5612 |
at:#seperatorList |
|
5613 |
ifAbsentPut: |
|
5614 |
[ |
|
5615 |
|l| |
|
5616 |
||
5617 |
l := self separatorSlices collect:[:el| el last ]. |
|
5618 |
l := l collect:[:s | self classResources string:s ]. |
|
5619 |
l |
|
5620 |
]. |
|
1725 | 5621 |
|
5622 |
aspects at:#seperatorSelection ifAbsentPut:[ |
|
2188 | 5623 |
holder := 0 asValue. |
5624 |
holder addDependent:aMenuEditor. |
|
5625 |
holder |
|
1725 | 5626 |
]. |
5627 |
! |
|
5628 |
||
5629 |
defaultLabel |
|
5630 |
^ '-' |
|
5631 |
! |
|
5632 |
||
5633 |
separatorSlices |
|
5634 |
"get the list of menu spec values of the corresponding separator types |
|
5635 |
" |
|
5636 |
^ #( |
|
5637 |
( #blank '' 'blank' ) |
|
5638 |
( #single '-' 'single line') |
|
5639 |
( #double '=' 'double line') |
|
5640 |
) |
|
5641 |
! ! |
|
5642 |
||
1631 | 5643 |
!MenuEditor::SeparatorItem methodsFor:'accessing'! |
5644 |
||
5645 |
icon |
|
5646 |
^ self class iconSeparator |
|
5647 |
! |
|
5648 |
||
5649 |
rawLabel:aValue |
|
5650 |
|value| |
|
5651 |
||
5652 |
aValue isString ifTrue:[ |
|
5653 |
value := aValue withoutSeparators. |
|
5654 |
||
5655 |
(self class separatorTypeOf:value) ifNotNil:[ |
|
5656 |
menuItem rawLabel:value |
|
5657 |
] |
|
5658 |
]. |
|
5659 |
! |
|
5660 |
||
5661 |
separatorType |
|
5662 |
^ self class separatorTypeOf:(menuItem rawLabel). |
|
5663 |
! |
|
5664 |
||
5665 |
slices |
|
5666 |
^ #( |
|
5667 |
(Basics basicsEditSpec) |
|
5668 |
) |
|
5669 |
! ! |
|
5670 |
||
5671 |
!MenuEditor::SeparatorItem methodsFor:'aspects'! |
|
5672 |
||
5673 |
fromAspects:aspects |
|
5674 |
"put my values into the values of aspects |
|
5675 |
" |
|
5676 |
|index slice| |
|
5677 |
||
5678 |
index := (aspects at:#seperatorSelection) value ? 0. |
|
5679 |
slice := self class separatorSlices at:index ifAbsent:nil. |
|
5680 |
||
5681 |
slice ifNotNil:[ slice := slice at:2 ]. |
|
5682 |
||
5683 |
(aspects at:#rawLabel) value:slice. |
|
5684 |
^ super fromAspects:aspects. |
|
5685 |
! |
|
5686 |
||
5687 |
toAspects:aspects |
|
5688 |
"put my values into the values of aspects |
|
5689 |
" |
|
5690 |
|index type| |
|
5691 |
||
5692 |
type := self separatorType. |
|
5693 |
index := self class separatorSlices findFirst:[:el| el first == type ]. |
|
5694 |
||
5695 |
(aspects at:#seperatorSelection) value:index. |
|
5696 |
^ super toAspects:aspects. |
|
5697 |
! ! |
|
5698 |
||
5699 |
!MenuEditor::SeparatorItem methodsFor:'displaying'! |
|
5700 |
||
5701 |
displayOn:aGC x:x y:y h:h |
|
5702 |
"draw the receiver in the graphicsContext, aGC. |
|
5703 |
" |
|
5704 |
|x1 y0 type| |
|
5705 |
||
5706 |
type := self separatorType. |
|
5707 |
type == #blank ifTrue:[ ^ self ]. |
|
5708 |
||
5709 |
x1 := x + (self widthOn:aGC). |
|
5710 |
y0 := y + (h // 2) - 1. |
|
5711 |
||
5712 |
type == #double ifTrue:[ |
|
5713 |
y0 := y0 + 1. |
|
5714 |
aGC displayLineFromX:x y:y0 toX:x1 y:y0. |
|
5715 |
y0 := y0 - 2 |
|
5716 |
]. |
|
5717 |
aGC displayLineFromX:x y:y0 toX:x1 y:y0 |
|
5718 |
! |
|
5719 |
||
5720 |
widthOn:aGC |
|
2151 | 5721 |
width isNil ifTrue:[ width := 60 ]. |
5722 |
^ width |
|
1631 | 5723 |
! ! |
5724 |
||
2019 | 5725 |
!MenuEditor class methodsFor:'documentation'! |
199 | 5726 |
|
5727 |
version |
|
5728 |
^ '$Header$' |
|
5729 |
! ! |
|
1606 | 5730 |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
5731 |
MenuEditor initialize! |