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