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