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