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