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