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