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