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