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