author | Claus Gittinger <cg@exept.de> |
Mon, 25 Mar 2013 13:14:03 +0100 | |
changeset 2990 | 66833743333c |
parent 2948 | b11312ccf82d |
child 3013 | 4aa95683c0fc |
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 |
||
2936
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
115 |
listOfItemsView <HierarcicalListView> the view which shows the list of items |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
116 |
listOfItems <HierarchicalList> hierarchical list of menu items |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
117 |
listOfTabs <List> list of current shown tab-labels |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
118 |
|
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
119 |
selectionHolder <ValueHolder> collection of current selected items |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
120 |
selectedSuperItems <Collection> collection of superItems derived from selection |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
121 |
|
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
122 |
tabHolder <ValueHolder> selected tab label holder |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
123 |
notifyDisabledCounter <SmallInteger> ~~ 0 than change notifications are discard |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
124 |
wizards <IdentityDictionary> keeps all created wizard dialogs |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
125 |
|
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
126 |
dropOverLine <nil or SmallInteger> nil: drop context not dropabel. |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
127 |
= 0: drop context dropable but no item specified |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
128 |
~ 0: drop context dropable for item at lineNumber |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
129 |
used t6o restore drop indication drawings |
2188 | 130 |
|
1606 | 131 |
[Class variables:] |
2936
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
132 |
ImageRetrieverClasses <Collection> sorted collection of image receivers |
199 | 133 |
|
134 |
[start with:] |
|
2936
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
135 |
MenuEditor open |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
136 |
MenuEditor openOnClass:MenuEditor andSelector:#menu |
199 | 137 |
|
138 |
[author:] |
|
2936
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
139 |
Claus Atzkern, eXept Software AG |
914fbb4edbae
comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents:
2869
diff
changeset
|
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 |
|
405 |
'If on, the submenu organizes its items horizontal insteat of vertical (default).' |
|
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 |
|
1702 | 420 |
'Class implementing the image resource method. If unspecified, the application class is taken.' |
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 |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
609 |
( |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
610 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
611 |
activeHelpKey: addMenuSeparator |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
612 |
label: 'Separator' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
613 |
itemValue: doCreateSep |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
614 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
615 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
616 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
617 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
618 |
activeHelpKey: addMenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
619 |
label: 'Item' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
620 |
itemValue: doCreateItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
621 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
622 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
623 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
624 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
625 |
activeHelpKey: addMenuSliceItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
626 |
label: 'Menu Slice' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
627 |
itemValue: doCreateMenuSliceItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
628 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
629 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
630 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
631 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
632 |
activeHelpKey: addMenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
633 |
label: 'Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
634 |
itemValue: doCreateMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
635 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
636 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
637 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
638 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
639 |
activeHelpKey: addSubMenuLink |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
640 |
label: 'Linked Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
641 |
itemValue: doCreateLinkedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
642 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
643 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
644 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
645 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
646 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
647 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
648 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
649 |
activeHelpKey: addDelayedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
650 |
enabled: canCreateDelayedMenuChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
651 |
label: 'Delayed Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
652 |
itemValue: doCreateDelayedMenu: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
653 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
654 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
655 |
argument: menu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
656 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
657 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
658 |
activeHelpKey: addDelayedSubMenuLink |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
659 |
enabled: canCreateDelayedMenuChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
660 |
label: 'Delayed Linked Menu' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
661 |
itemValue: doCreateDelayedMenu: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
662 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
663 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
664 |
argument: linkedMenu |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
665 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
666 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
667 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
668 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
669 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
670 |
label: 'Standard Menus' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
671 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
672 |
submenuChannel: standardMenus |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
673 |
keepLinkedMenu: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
674 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
675 |
) |
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 |
||
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
695 |
^ |
2186 | 696 |
#(Menu |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
697 |
( |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
698 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
699 |
activeHelpKey: editCut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
700 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
701 |
label: 'Cut' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
702 |
itemValue: doCut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
703 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
704 |
shortcutKey: Cut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
705 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
706 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
707 |
activeHelpKey: editCopy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
708 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
709 |
label: 'Copy' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
710 |
itemValue: doCopy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
711 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
712 |
shortcutKey: Copy |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
713 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
714 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
715 |
activeHelpKey: editPaste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
716 |
enabled: canPasteHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
717 |
label: 'Paste' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
718 |
itemValue: doPaste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
719 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
720 |
shortcutKey: Paste |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
721 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
722 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
723 |
activeHelpKey: editDelete |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
724 |
enabled: hasSelectionChannel |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
725 |
label: 'Delete' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
726 |
itemValue: doDelete |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
727 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
728 |
isVisible: false |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
729 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
730 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
731 |
label: '-' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
732 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
733 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
734 |
activeHelpKey: editMoveUp |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
735 |
enabled: enableMovingUpOrDownHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
736 |
label: 'Move Up' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
737 |
itemValue: doMoveUpOrDown: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
738 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
739 |
startGroup: right |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
740 |
shortcutKey: CtrlCursorUp |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
741 |
labelImage: (ResourceRetriever Icon upIcon 'Move Up') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
742 |
argument: up |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
743 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
744 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
745 |
activeHelpKey: editMoveDown |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
746 |
enabled: enableMovingUpOrDownHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
747 |
label: 'Move Down' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
748 |
itemValue: doMoveUpOrDown: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
749 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
750 |
shortcutKey: CtrlCursorDown |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
751 |
labelImage: (ResourceRetriever Icon downIcon 'Move Down') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
752 |
argument: down |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
753 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
754 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
755 |
activeHelpKey: editMoveIn |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
756 |
enabled: enableMovingInHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
757 |
label: 'Move Into Next' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
758 |
itemValue: doMoveIn: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
759 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
760 |
shortcutKey: CtrlCursorRight |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
761 |
labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next') |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
762 |
argument: inNext |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
763 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
764 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
765 |
activeHelpKey: editMoveInAbove |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
766 |
enabled: enableMovingInAboveHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
767 |
label: 'Move Into Previous' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
768 |
itemValue: doMoveIn: |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
769 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
770 |
labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous' ) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
771 |
argument: inPrev |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
772 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
773 |
(MenuItem |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
774 |
activeHelpKey: editMoveOut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
775 |
enabled: enableMovingOutHolder |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
776 |
label: 'Move Out' |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
777 |
itemValue: doMoveOut |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
778 |
translateLabel: true |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
779 |
shortcutKey: CtrlCursorLeft |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
780 |
labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out' ) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
781 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
782 |
) |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
783 |
nil |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
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 |
||
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
902 |
^ |
1971 | 903 |
#(Menu |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
904 |
( |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
905 |
(MenuItem |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
906 |
isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
907 |
activeHelpKey: fileNew |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
908 |
label: 'New' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
909 |
itemValue: doNew |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
910 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
911 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
912 |
(MenuItem |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
913 |
isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
914 |
label: '-' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
915 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
916 |
(MenuItem |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
917 |
isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
918 |
activeHelpKey: fileLoad |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
919 |
label: 'Load...' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
920 |
itemValue: doLoad |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
921 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
922 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
923 |
(MenuItem |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
924 |
isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
925 |
label: '-' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
926 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
927 |
(MenuItem |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
928 |
isVisible: isEditingSpecOnly |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
929 |
activeHelpKey: fileSaveSpec |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
930 |
label: 'Save' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
931 |
itemValue: doSave |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
932 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
933 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
934 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
935 |
isVisible: isNotEditingSpecOnly |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
936 |
activeHelpKey: fileSave |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
937 |
label: 'Save' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
938 |
itemValue: doSave |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
939 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
940 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
941 |
(MenuItem |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
942 |
isVisible: isNotEditingSpecOnlyAndNotEmbeddedInBrowser |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
943 |
activeHelpKey: fileSaveAs |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
944 |
label: 'Save As...' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
945 |
itemValue: doSaveAs |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
946 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
947 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
948 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
949 |
label: '-' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
950 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
951 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
952 |
activeHelpKey: filePickAMenu |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
953 |
label: 'Pick a Menu...' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
954 |
itemValue: doPickAMenu |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
955 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
956 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
957 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
958 |
activeHelpKey: fileChooseAMenu |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
959 |
label: 'Choose a Menu...' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
960 |
itemValue: doChooseAMenu |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
961 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
962 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
963 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
964 |
label: '-' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
965 |
isVisible: isStandAlone |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
966 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
967 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
968 |
activeHelpKey: fileBrowseClass |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
969 |
enabled: hasValidSpecClass |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
970 |
label: 'Browse Class' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
971 |
itemValue: doBrowseClass |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
972 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
973 |
isVisible: isStandAlone |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
974 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
975 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
976 |
activeHelpKey: fileShowMenuSpec |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
977 |
label: 'Show Menu Spec' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
978 |
itemValue: doShowMenuSpec |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
979 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
980 |
isVisible: isStandAlone |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
981 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
982 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
983 |
label: '-' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
984 |
isVisible: isStandAlone |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
985 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
986 |
(MenuItem |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
987 |
activeHelpKey: fileExit |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
988 |
label: 'Exit' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
989 |
itemValue: closeRequest |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
990 |
translateLabel: true |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
991 |
isVisible: isStandAlone |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
992 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
993 |
) |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
994 |
nil |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
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 |
||
2355 | 1101 |
^ |
1775 | 1102 |
#(Menu |
2355 | 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 |
|
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1128 |
isVisible: isNotEditingSpecOnly |
2355 | 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 |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1190 |
#( |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1191 |
#(#MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1192 |
isVisible: isNotEditingSpecOnly |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1193 |
#activeHelpKey: #settingsRedefineAspectMethods |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1194 |
#enabled: #hasValidSpecClass |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1195 |
#label: 'Redefine Aspect Methods' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1196 |
#translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1197 |
#hideMenuOnActivated: false |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1198 |
#indication: #redefineAspectMethodsChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1199 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1200 |
#(#MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1201 |
#activeHelpKey: #settingsRedefineAspectMethods |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1202 |
#label: 'AutoAccept on Selection-Change' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1203 |
#translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1204 |
#hideMenuOnActivated: false |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1205 |
#indication: #autoAcceptOnSelectionChange |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1206 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1207 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1208 |
nil |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
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 |
||
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1265 |
^ |
1749 | 1266 |
#(Menu |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1267 |
( |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1268 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1269 |
activeHelpKey: fileNew |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1270 |
label: 'New' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1271 |
itemValue: doNew |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1272 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1273 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1274 |
labelImage: (ResourceRetriever ToolbarIconLibrary newMenuIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1275 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1276 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1277 |
label: '-' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1278 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1279 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1280 |
activeHelpKey: fileLoad |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1281 |
label: 'Load' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1282 |
itemValue: doLoad |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1283 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1284 |
isButton: true |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1285 |
isVisible: isNotEditingSpecOnly |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1286 |
submenuChannel: menuHistory |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1287 |
labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1288 |
keepLinkedMenu: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1289 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1290 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1291 |
activeHelpKey: fileSave |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1292 |
label: 'Save' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1293 |
itemValue: doSave |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1294 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1295 |
isButton: true |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1296 |
isVisible: isNotEditingSpecOnly |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1297 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1298 |
) |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1299 |
(MenuItem |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1300 |
activeHelpKey: fileSaveSpec |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1301 |
label: 'Save' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1302 |
itemValue: doSave |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1303 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1304 |
isButton: true |
2581
d78dec3e0866
fixed usage as subcomponent in browser
Claus Gittinger <cg@exept.de>
parents:
2580
diff
changeset
|
1305 |
isVisible: isEditingSpecOnly |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1306 |
labelImage: (ResourceRetriever XPToolbarIconLibrary saveImageIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1307 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1308 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1309 |
label: '-' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1310 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1311 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1312 |
activeHelpKey: editCut |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1313 |
enabled: hasSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1314 |
label: 'Cut' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1315 |
itemValue: doCut |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1316 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1317 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1318 |
labelImage: (ResourceRetriever ToolbarIconLibrary cutMenuItemIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1319 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1320 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1321 |
activeHelpKey: editCopy |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1322 |
enabled: hasSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1323 |
label: 'Copy' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1324 |
itemValue: doCopy |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1325 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1326 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1327 |
labelImage: (ResourceRetriever ToolbarIconLibrary copyMenuItemIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1328 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1329 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1330 |
activeHelpKey: editPaste |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1331 |
enabled: canPasteHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1332 |
label: 'Paste' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1333 |
itemValue: doPaste |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1334 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1335 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1336 |
labelImage: (ResourceRetriever ToolbarIconLibrary pasteMenuItemIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1337 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1338 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1339 |
label: '-' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1340 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1341 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1342 |
activeHelpKey: addMenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1343 |
enabled: hasSingleSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1344 |
label: 'Add Item' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1345 |
itemValue: doCreateItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1346 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1347 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1348 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1349 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1350 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1351 |
activeHelpKey: addMenuSeparator |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1352 |
enabled: hasSingleSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1353 |
label: 'Add Separator' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1354 |
itemValue: doCreateSep |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1355 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1356 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1357 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1358 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1359 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1360 |
activeHelpKey: addMenuSlice |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1361 |
enabled: hasSingleSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1362 |
label: 'Menu Slice' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1363 |
itemValue: doCreateMenuSliceItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1364 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1365 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1366 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1367 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1368 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1369 |
activeHelpKey: addSubMenu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1370 |
enabled: hasSingleSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1371 |
label: 'Add Menu' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1372 |
itemValue: doCreateMenu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1373 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1374 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1375 |
submenuChannel: standardMenus |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1376 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1377 |
keepLinkedMenu: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1378 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1379 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1380 |
activeHelpKey: addSubMenuLink |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1381 |
enabled: hasSingleSelectionChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1382 |
label: 'Add Linked Menu' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1383 |
itemValue: doCreateLinkedMenu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1384 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1385 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1386 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1387 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1388 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1389 |
activeHelpKey: addDelayedMenu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1390 |
enabled: canCreateDelayedMenuChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1391 |
label: 'Add Delayed Menu' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1392 |
itemValue: doCreateDelayedMenu: |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1393 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1394 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1395 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1396 |
argument: menu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1397 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1398 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1399 |
activeHelpKey: addDelayedSubMenuLink |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1400 |
enabled: canCreateDelayedMenuChannel |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1401 |
label: 'Add Delayed Linked Menu' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1402 |
itemValue: doCreateDelayedMenu: |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1403 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1404 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1405 |
labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1406 |
argument: linkedMenu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1407 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1408 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1409 |
label: '' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1410 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1411 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1412 |
activeHelpKey: editMoveUp |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1413 |
enabled: enableMovingUpOrDownHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1414 |
label: 'Move Up' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1415 |
itemValue: doMoveUp |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1416 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1417 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1418 |
startGroup: right |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1419 |
labelImage: (ResourceRetriever Icon upIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1420 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1421 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1422 |
activeHelpKey: editMoveDown |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1423 |
enabled: enableMovingUpOrDownHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1424 |
label: 'Move Down' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1425 |
itemValue: doMoveDown |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1426 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1427 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1428 |
labelImage: (ResourceRetriever Icon downIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1429 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1430 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1431 |
activeHelpKey: editMoveIn |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1432 |
enabled: enableMovingInHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1433 |
label: 'Move Into Next' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1434 |
itemValue: doMoveInNext |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1435 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1436 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1437 |
labelImage: (ResourceRetriever Icon downRightIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1438 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1439 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1440 |
activeHelpKey: editMoveInAbove |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1441 |
enabled: enableMovingInAboveHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1442 |
label: 'Move Into Previous' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1443 |
itemValue: doMoveInPrevious |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1444 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1445 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1446 |
labelImage: (ResourceRetriever Icon upRightIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1447 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1448 |
(MenuItem |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1449 |
activeHelpKey: editMoveOut |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1450 |
enabled: enableMovingOutHolder |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1451 |
label: 'Move Out' |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1452 |
itemValue: doMoveOut |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1453 |
translateLabel: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1454 |
isButton: true |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1455 |
labelImage: (ResourceRetriever Icon leftDownIcon) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1456 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1457 |
) |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1458 |
nil |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
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 |
7a78e0088013
help text for #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
1599 |
|spec sel t g| |
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:[ |
2188 | 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:[ |
2188 | 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:[ |
2188 | 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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1638 |
^ wizards |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1639 |
at:#image |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1640 |
ifAbsentPut:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1641 |
|tool| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1642 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1643 |
tool := ImageResourceEditor new createBuilder. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1644 |
tool masterApplication:self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1645 |
tool modifiedChannel: self enablingCommitButtonsHolder. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1646 |
tool builder window:(ApplicationSubView new client:tool). |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1647 |
tool |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
1648 |
] |
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:[ |
2297 | 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). |
|
2589 | 1693 |
helpKeyHolder value:(helpTool helpKey). |
2297 | 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:[ |
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:[ |
|
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1858 |
aClass notNil ifTrue:[ |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1859 |
cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass]. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1860 |
|
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1861 |
(cls respondsTo:aSelector) ifTrue:[ |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1862 |
menu := cls perform: aSelector. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1863 |
]. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
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:[ |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1876 |
(menu isCollection) ifTrue:[ |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1877 |
menu := Menu decodeFromLiteralArray:menu |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
1878 |
]. |
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:[ |
|
2862 | 1899 |
selectedSuperItems := selection ? #(). |
1606 | 1900 |
^ selectedSuperItems |
1901 |
]. |
|
1902 |
||
1903 |
root := listOfItems root. |
|
1904 |
||
1905 |
(selection includesIdentical:root) ifTrue:[ |
|
2862 | 1906 |
selectedSuperItems := Array with:root. |
2188 | 1907 |
^ selectedSuperItems |
1606 | 1908 |
]. |
1909 |
selectedSuperItems := OrderedCollection new. |
|
1910 |
||
1911 |
selection do:[:anItem| |
|
2862 | 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. |
|
2593
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1951 |
item isNil ifTrue:[ |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1952 |
wizardHolder value:nil. |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1953 |
^ self |
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:[ |
2593
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1959 |
tab := item slices detect:[:el| el first = tab ] ifNone:nil. |
1606 | 1960 |
]. |
1676 | 1961 |
tab isNil ifTrue:[ |
2593
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1962 |
tabHolder value:( listOfTabs at:1 ifAbsent:nil ). |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1963 |
^ self. |
1606 | 1964 |
]. |
1965 |
selector := tab last. |
|
1966 |
||
2593
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1967 |
selector == #help ifTrue:[ |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1968 |
wizardHolder value:(self helpTool window). |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1969 |
^ self |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1970 |
]. |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1971 |
selector == #image ifTrue:[ |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1972 |
wizardHolder value:(self imageTool window). |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1973 |
^ self |
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 |
|
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1976 |
canvas := wizards |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1977 |
at:(item class name, selector) asSymbol |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1978 |
ifAbsentPut:[ |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1979 |
SimpleView new |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1980 |
client:self |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1981 |
spec:(item class perform:selector) |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
1982 |
builder:(self builder) |
719725e66005
comment/format in: #imageTool
Claus Gittinger <cg@exept.de>
parents:
2589
diff
changeset
|
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] |
2869 | 2017 |
ifFalse:[selectedItem := nil]. |
2018 |
||
2019 |
self hasSelectionChannel value:hasSelection. |
|
1606 | 2020 |
self hasSingleSelectionChannel value:(selectedItem notNil). |
2021 |
||
2022 |
selectedItem isNil ifTrue:[ |
|
2869 | 2023 |
"/ self enableMovingUpOrDownHolder value:false. |
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). |
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:[ |
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 |
2194 |
#CtrlCursorLeft #CtrlCursorRight )> |
|
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:[ |
|
2263 | 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:[ |
2263 | 2222 |
self doMoveUp. |
2223 |
^ true. |
|
1958 | 2224 |
]. |
2188 | 2225 |
(rawKey == #CtrlCursorDown) ifTrue:[ |
2263 | 2226 |
self doMoveDown. |
2227 |
^ true. |
|
1958 | 2228 |
]. |
2188 | 2229 |
(rawKey == #CtrlCursorLeft) ifTrue:[ |
2263 | 2230 |
self doMoveOut. |
2231 |
^ true. |
|
1958 | 2232 |
]. |
2188 | 2233 |
(rawKey == #CtrlCursorRight) ifTrue:[ |
2263 | 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| |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2333 |
anItem ignoreShortcutKeys:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2334 |
anItem isVisible:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2335 |
anItem enabled:true. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2336 |
anItem translateLabel:false. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2337 |
|
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2338 |
anItem itemValue notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2339 |
anItem itemValue:[ Transcript showCR:(anItem label) ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2340 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2341 |
anItem indication notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2342 |
indication isNil ifTrue:[ indication := true asValue ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2343 |
anItem indication:indication |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2344 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2345 |
anItem choice notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2346 |
choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2347 |
anItem choice:choice |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2348 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2349 |
anItem isMenuSlice ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2350 |
anItem submenuChannel:nil. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2351 |
anItem label:'... Slice Menu ...'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2352 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2353 |
anItem submenuChannel notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2354 |
anItem submenuChannel:nil. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2355 |
anItem submenu isNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2356 |
submenu isNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2357 |
submenu := Menu new. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2358 |
submenu addItem:(MenuItem labeled:'Linked Menu...'). |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2359 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2360 |
anItem submenu:submenu. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2361 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2362 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2363 |
retriever := anItem resourceRetriever. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2364 |
retriever notNil ifTrue:[ |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2365 |
retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ] |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2366 |
]. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2367 |
]. |
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:[ |
2862 | 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:[ |
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| |
|
2252 | 2583 |
selectors addAll:(el aspectSelectors). |
1614 | 2584 |
]. |
2585 |
^ selectors asOrderedCollection |
|
2586 |
! |
|
2587 |
||
2297 | 2588 |
doBrowseActionMethod |
2810 | 2589 |
"open a browser on the callback method (create if not yet existing)" |
2590 |
||
2591 |
self doBrowseApplicationMethodFor:#itemValue |
|
2592 |
||
2593 |
"Modified: / 21-10-2010 / 14:09:33 / cg" |
|
2594 |
! |
|
2595 |
||
2596 |
doBrowseApplicationMethodFor:aspect |
|
2297 | 2597 |
|selector cls category| |
2598 |
||
2810 | 2599 |
specClass isNil ifTrue:[ |
2600 |
self warn:(resources string:'Please define the application class first.'). |
|
2297 | 2601 |
^ self |
2602 |
]. |
|
2603 |
||
2810 | 2604 |
selector := (self aspectFor:aspect) value. |
2605 |
selector isEmptyOrNil ifTrue:[ |
|
2606 |
Dialog information:(resources string:'Please enter an action method name.'). |
|
2297 | 2607 |
^ self |
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:[ |
|
2810 | 2616 |
self warn:(resources string:'Class %1 does not exist!!' with:specClass asString). |
2297 | 2617 |
^ self |
2618 |
]. |
|
2619 |
||
2630
8d19a544d5da
changed: #doBrowseActionMethod
Claus Gittinger <cg@exept.de>
parents:
2593
diff
changeset
|
2620 |
(cls includesSelector:selector) ifFalse:[ |
2297 | 2621 |
category := UserPreferences current categoryForMenuActionsMethods. |
2622 |
||
2833
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2623 |
SmalltalkCodeGeneratorTool |
2297 | 2624 |
createActionMethodFor:selector in:cls |
2625 |
category:category |
|
2626 |
redefine:(self redefineAspectMethodsChannel value). |
|
2627 |
]. |
|
2628 |
||
2810 | 2629 |
UserPreferences current systemBrowserClass openInClass:cls selector:selector |
2630 |
||
2631 |
"Created: / 21-10-2010 / 14:07:32 / cg" |
|
2833
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2632 |
"Modified: / 31-01-2011 / 18:28:59 / cg" |
2810 | 2633 |
! |
2634 |
||
2635 |
doBrowseEnabledMethod |
|
2636 |
"open a browser on the enabled method (create if not yet existing)" |
|
2637 |
||
2638 |
self doBrowseApplicationMethodFor:#enabled |
|
2639 |
||
2640 |
"Created: / 21-10-2010 / 14:09:41 / cg" |
|
2641 |
! |
|
2642 |
||
2643 |
doBrowseVisibilityMethod |
|
2644 |
"open a browser on the visibility method (create if not yet existing)" |
|
2645 |
||
2646 |
self doBrowseApplicationMethodFor:#isVisible |
|
2647 |
||
2648 |
"Created: / 21-10-2010 / 14:09:56 / cg" |
|
2297 | 2649 |
! |
2650 |
||
1614 | 2651 |
doGenerateAspectMethods |
1805
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2652 |
"compile aspect and action methods" |
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2653 |
|
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2654 |
|cls redefineAspectMethods category| |
1614 | 2655 |
|
2151 | 2656 |
specClass isNil ifTrue:[ |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2657 |
self warn:'Define the class first !!'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2658 |
^ self |
1614 | 2659 |
]. |
1617 | 2660 |
redefineAspectMethods := self redefineAspectMethodsChannel value. |
1614 | 2661 |
|
2662 |
cls := self resolveName:specClass. |
|
2151 | 2663 |
cls isNil ifTrue:[ |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2664 |
self warn:'Class ', specClass asString, ' does not exist!!'. |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2665 |
^ self |
1614 | 2666 |
]. |
1617 | 2667 |
|
1805
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2668 |
category := UserPreferences current categoryForMenuActionsMethods. |
cf1a9d636bf7
category and comment flags now in Userprefs
Claus Gittinger <cg@exept.de>
parents:
1788
diff
changeset
|
2669 |
|
1617 | 2670 |
self collectActionSelectors do:[:aSelector| |
2833
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2671 |
SmalltalkCodeGeneratorTool |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2672 |
createActionMethodFor:aSelector in:cls |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2673 |
category:category |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2674 |
redefine:redefineAspectMethods. |
1614 | 2675 |
]. |
1617 | 2676 |
|
2677 |
self collectAspectSelectors do:[:anAspect| |
|
2833
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2678 |
SmalltalkCodeGeneratorTool |
2275
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2679 |
createAspectMethodFor:anAspect in:cls |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2680 |
category:category |
b0f6890e73cf
code generation in CodegeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2271
diff
changeset
|
2681 |
redefine:redefineAspectMethods |
1614 | 2682 |
]. |
2833
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2683 |
|
c4e0add90aaa
CodeGeneratorTool->SmalltalkCodeGeneratorTool
Claus Gittinger <cg@exept.de>
parents:
2810
diff
changeset
|
2684 |
"Modified: / 31-01-2011 / 18:29:06 / cg" |
1614 | 2685 |
! ! |
2686 |
||
1715 | 2687 |
!MenuEditor methodsFor:'user actions-building'! |
1606 | 2688 |
|
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2689 |
doChooseAMenu |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2690 |
"pick a menu and edit its spec method" |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2691 |
|
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2692 |
|view subSpec app bldr spec menuSelector1 menuSelector2 info| |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2693 |
|
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2694 |
self askForModification ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2695 |
view := Screen current viewFromUser. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2696 |
(view isNil or:[view == Screen current rootView]) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2697 |
^ self |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2698 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2699 |
view specClass == MenuPanelSpec ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2700 |
(app := view application) isNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2701 |
info := 'Could not figure out the application class.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2702 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2703 |
(bldr := app builder) isNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2704 |
info := 'Application has no builder.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2705 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2706 |
menuSelector1 := bldr namedComponents keyAtValue:view ifAbsent:nil. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2707 |
(spec := bldr spec) isNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2708 |
info := 'Cannot fetch spec from applications builder.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2709 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2710 |
subSpec := spec findSpecForWhich:[:subSpec | subSpec name = view name]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2711 |
subSpec isNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2712 |
info := 'Cannot find view-spec for ',view name asString,'.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2713 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2714 |
menuSelector2 := subSpec menu. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2715 |
] |
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 |
(menuSelector1 isNil and:[ menuSelector2 isNil ]) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2718 |
info := 'menu is probably not provided by a menuSelector.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2719 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2720 |
(app class respondsTo:menuSelector1) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2721 |
self loadFromClass:app class andSelector:menuSelector1. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2722 |
^ self. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2723 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2724 |
(app class respondsTo:menuSelector2) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2725 |
self loadFromClass:app class andSelector:menuSelector2. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2726 |
^ self. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2727 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2728 |
info := 'menu is probably not provided by a menuSelector.' |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2729 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2730 |
] |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2731 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2732 |
info notNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2733 |
app notNil ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2734 |
(Dialog confirm:(info,'\\Browse ?' withCRs)) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2735 |
app browse. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2736 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2737 |
] ifFalse:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2738 |
Dialog information:info. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2739 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2740 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2741 |
^ self. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2742 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2743 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2744 |
! |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2745 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2746 |
doNew |
1606 | 2747 |
"clear editing menu; start from scratch |
2748 |
" |
|
2749 |
super doNew ifTrue:[ self helpTool doNew ]. |
|
199 | 2750 |
! |
2751 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2752 |
doPickAMenu |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2753 |
"let user pick a menu and create a new spec" |
1971 | 2754 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2755 |
|view| |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2756 |
|
1244 | 2757 |
self askForModification ifTrue:[ |
2331
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2758 |
view := Screen current viewFromUser. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2759 |
(view isNil or:[view == Screen current rootView]) ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2760 |
^ self |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2761 |
]. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2762 |
view specClass == MenuPanelSpec ifTrue:[ |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2763 |
specSelector := #pickedMenu. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2764 |
self buildFromMenu:(view asMenu) selector:specSelector. |
938a31972544
choose from screen menu function
Claus Gittinger <cg@exept.de>
parents:
2297
diff
changeset
|
2765 |
]. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2766 |
]. |
888 | 2767 |
! |
2768 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2769 |
doSave |
1606 | 2770 |
"save current editing menu to |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2771 |
class: specClass |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2772 |
selector: specSelector |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2773 |
" |
2856 | 2774 |
|cls specCode mthd category code excla s| |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2775 |
|
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2776 |
self isEditingSpecOnly ifTrue:[ |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2777 |
savedSpec := self generateMenuSpec. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2778 |
hasSaved := true. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2779 |
self clearModified. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2780 |
^ self |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2781 |
]. |
199 | 2782 |
|
642 | 2783 |
super doSave ifFalse: [^nil]. |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2784 |
specCode := self generateMenuSpecString. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2785 |
specCode isNil ifTrue:[^ nil]. |
1606 | 2786 |
|
2787 |
cls := self resolveName:specClass. |
|
199 | 2788 |
|
2789 |
"/ if that method already exists, do not overwrite the category |
|
2790 |
||
576 | 2791 |
category := 'menu specs'. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2792 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2793 |
category := mthd category. |
199 | 2794 |
]. |
2795 |
||
2856 | 2796 |
s := '' writeStream. |
2797 |
||
2798 |
s nextPutChunkSeparator; |
|
2799 |
nextPutAll:(cls name); |
|
2800 |
nextPutAll:' class methodsFor:'; |
|
2801 |
nextPutAll:category storeString; |
|
2802 |
nextPutChunkSeparator; |
|
2803 |
cr; cr; |
|
2804 |
nextPutAll:specSelector; |
|
2805 |
cr; |
|
2806 |
nextPutAllAsChunk:(self class codeGenerationComment) withCRs; |
|
2807 |
cr; cr; |
|
2808 |
nextPutLine:' "'; |
|
2809 |
nextPutLine:(' MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector); |
|
2810 |
nextPutLine:(' (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp'); |
|
2811 |
nextPutLine:' "'; |
|
2812 |
cr; |
|
2813 |
nextPutLine:' <resource: #menu>'; |
|
2814 |
cr; |
|
2815 |
nextPutAll:' ^ '; |
|
2816 |
nextChunkPut:specCode; |
|
2817 |
space; |
|
2818 |
nextPutChunkSeparator; |
|
2819 |
cr. |
|
2820 |
||
2821 |
(ReadStream on:s contents) fileIn. |
|
199 | 2822 |
|
1669 | 2823 |
self isStandAlone ifTrue:[ |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2824 |
self helpTool doSave |
1669 | 2825 |
]. |
699 | 2826 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2827 |
self updateHistory. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2828 |
hasSaved := true. |
1971 | 2829 |
self clearModified. |
2856 | 2830 |
|
2858 | 2831 |
"Modified: / 24-08-2011 / 12:26:08 / cg" |
199 | 2832 |
! |
2833 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2834 |
doSaveAs |
1606 | 2835 |
"save current editing menu to class and selector |
2836 |
defined by the user. |
|
2837 |
" |
|
2838 |
super doSaveAs ifTrue:[ |
|
2839 |
listOfItems root rawLabel:specSelector |
|
2840 |
]. |
|
2841 |
! |
|
2842 |
||
2843 |
doShowMenuSpec |
|
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2844 |
"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
|
2845 |
|
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2846 |
|code| |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2847 |
|
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2848 |
code := self generateMenuSpecString. |
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2849 |
|
2862 | 2850 |
code notNil ifTrue:[ |
2569
b55aeaecefda
preps for menuSpec without a class
Claus Gittinger <cg@exept.de>
parents:
2448
diff
changeset
|
2851 |
CodeView openWith:code title: 'Menu Spec' |
1606 | 2852 |
]. |
2862 | 2853 |
|
2854 |
"Modified: / 29-11-2011 / 11:28:12 / cg" |
|
1971 | 2855 |
! |
2856 |
||
2857 |
save |
|
2858 |
self doSave |
|
1606 | 2859 |
! ! |
2860 |
||
1715 | 2861 |
!MenuEditor methodsFor:'user actions-creation'! |
1606 | 2862 |
|
2863 |
doCreateDelayedMenu:what |
|
2864 |
|selectedItem delayedItem| |
|
2865 |
||
2866 |
selectedItem := self selectedItem. |
|
2151 | 2867 |
selectedItem isNil ifTrue:[^ self]. |
1606 | 2868 |
|
2869 |
selectedItem canAddDelayedMenu ifFalse:[ ^ self ]. |
|
2870 |
self askForItemModification ifFalse:[ ^ self ]. |
|
2871 |
||
1633 | 2872 |
what == #menu ifTrue:[ delayedItem := RegularMenuItem new ] |
2862 | 2873 |
ifFalse:[ delayedItem := LinkedMenuItem new ]. |
1606 | 2874 |
|
2875 |
delayedItem setExpanded:true. |
|
2876 |
delayedItem := selectedItem add:delayedItem. |
|
2877 |
||
2862 | 2878 |
delayedItem notNil ifTrue:[ |
2879 |
self selectedItem:delayedItem. |
|
1606 | 2880 |
]. |
2862 | 2881 |
|
2882 |
"Modified: / 29-11-2011 / 11:28:09 / cg" |
|
1606 | 2883 |
! |
2884 |
||
2885 |
doCreateItem |
|
2886 |
"create a new Item |
|
2887 |
" |
|
1702 | 2888 |
self addAndSelectValueOf:[ ActionItem new translateLabel:true ]. |
1606 | 2889 |
! |
2890 |
||
2891 |
doCreateLinkedMenu |
|
2892 |
"create a new Linked Menu |
|
2893 |
" |
|
1702 | 2894 |
self addAndSelectValueOf:[ LinkedMenuItem new ]. |
1606 | 2895 |
! |
2896 |
||
2897 |
doCreateMenu |
|
2898 |
"create a new Menu |
|
2899 |
" |
|
1702 | 2900 |
self addAndSelectValueOf: |
2188 | 2901 |
[ |item| |
2902 |
item := RegularMenuItem new. |
|
2903 |
"/ --- do not add it expanded - because that makes it hard to add multipe menus |
|
2904 |
"/ item expand. |
|
2905 |
item |
|
2906 |
]. |
|
1606 | 2907 |
! |
2908 |
||
1844 | 2909 |
doCreateMenuSliceItem |
2910 |
"create a new MenuSlice Item |
|
2911 |
" |
|
2912 |
self addAndSelectValueOf:[ MenuSliceItem new ]. |
|
2913 |
! |
|
2914 |
||
1606 | 2915 |
doCreateSep |
2916 |
"create a new Separator Item |
|
2917 |
" |
|
1702 | 2918 |
self addAndSelectValueOf:[ SeparatorItem new ]. |
1606 | 2919 |
! |
2920 |
||
2921 |
doCreateStandardEditMenu |
|
2345 | 2922 |
"create a standard edit menu |
1606 | 2923 |
" |
1702 | 2924 |
self addAndSelectValueOf:[ |
2345 | 2925 |
RegularMenuItem menu:(self class standardEditMenu) labeled:'Edit' translateLabel:true |
1606 | 2926 |
]. |
218 | 2927 |
! |
199 | 2928 |
|
1606 | 2929 |
doCreateStandardFileMenu |
2345 | 2930 |
"create a standard file menu |
1606 | 2931 |
" |
1702 | 2932 |
self addAndSelectValueOf:[ |
2345 | 2933 |
RegularMenuItem menu:(self class standardFileMenu) labeled:'File' translateLabel:true |
1606 | 2934 |
]. |
2935 |
! |
|
2936 |
||
2937 |
doCreateStandardHelpMenu |
|
2345 | 2938 |
"create a standard help menu |
1606 | 2939 |
" |
2940 |
|item| |
|
2941 |
||
1702 | 2942 |
self addAndSelectValueOf:[ |
2345 | 2943 |
item := RegularMenuItem menu:(self class standardHelpMenu) labeled:'Help' translateLabel:true. |
2944 |
item aspectAt:#startGroup put:#conditionalRight. |
|
2945 |
item |
|
1606 | 2946 |
]. |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
2947 |
|
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
2948 |
"Modified: / 16-10-2006 / 12:49:27 / cg" |
1606 | 2949 |
! ! |
2950 |
||
1715 | 2951 |
!MenuEditor methodsFor:'user actions-editing'! |
1606 | 2952 |
|
2953 |
doCopy |
|
2954 |
"copy selected menuItems to the clipboard |
|
2955 |
" |
|
2956 |
|clip items| |
|
2957 |
||
2958 |
items := self selectedSuperItems. |
|
2959 |
items isEmpty ifTrue:[ ^ self ]. |
|
2960 |
||
2961 |
clip := OrderedCollection new. |
|
2962 |
items do:[:el| clip add:(el menuItem) ]. |
|
2963 |
||
2964 |
self clipboard:clip. |
|
2965 |
self updateAllToolInstances. |
|
2966 |
! |
|
2967 |
||
2968 |
doCut |
|
2969 |
"copy selected menuItems to the clipboard and delete |
|
2970 |
" |
|
2971 |
self doCopy. |
|
2972 |
self doDelete. |
|
2973 |
! |
|
2974 |
||
2975 |
doDelete |
|
2976 |
"delete selected menuItems |
|
2977 |
" |
|
2978 |
|selectedItem parent toDelete behind nextItem prevItem| |
|
2979 |
||
2980 |
toDelete := self selectedSuperItems. |
|
2981 |
toDelete isEmpty ifTrue:[ ^ self ]. |
|
2982 |
||
2983 |
self clearModified. |
|
2984 |
||
2985 |
selectedItem := toDelete first. |
|
2986 |
||
2987 |
selectedItem isRootItem ifTrue:[ |
|
2188 | 2988 |
^ selectedItem removeAll. |
1606 | 2989 |
]. |
2990 |
"/ compute the new selection |
|
2991 |
||
2992 |
prevItem := parent := selectedItem parent. |
|
2993 |
nextItem := nil. |
|
2994 |
||
2995 |
parent children size ~~ 1 ifTrue:[ |
|
2188 | 2996 |
behind := false. |
2997 |
||
2998 |
parent do:[:el| |
|
2999 |
behind ifTrue:[ |
|
3000 |
(nextItem notNil or:[toDelete includesIdentical:el]) ifFalse:[ nextItem := el ]. |
|
3001 |
] ifFalse:[ |
|
3002 |
behind := el == selectedItem. |
|
3003 |
(behind or:[toDelete includesIdentical:el]) ifFalse:[ prevItem := el ]. |
|
3004 |
] |
|
3005 |
] |
|
1606 | 3006 |
]. |
3007 |
self withoutNotifyDo:[ |
|
2188 | 3008 |
toDelete do:[:el| el remove ]. |
1606 | 3009 |
]. |
3010 |
self selectedItem:(nextItem ? prevItem). |
|
1971 | 3011 |
self setModified. |
1606 | 3012 |
self updateChannels. |
3013 |
! |
|
3014 |
||
3015 |
doPaste |
|
3016 |
"paste from clipboard |
|
3017 |
" |
|
3018 |
^ self doPaste:(self clipboard) |
|
218 | 3019 |
! |
3020 |
||
1606 | 3021 |
doPaste:aCollection |
3022 |
"paste collection of MenuItems |
|
3023 |
" |
|
3024 |
|item loMenuItems| |
|
3025 |
||
3026 |
aCollection size == 0 ifTrue:[ ^ self ]. |
|
3027 |
||
3028 |
item := self selectedItem. |
|
2151 | 3029 |
item isNil ifTrue:[ ^ self ]. |
1606 | 3030 |
|
3031 |
loMenuItems := OrderedCollection new. |
|
3032 |
aCollection do:[:el| |
|
2188 | 3033 |
(el askFor:#isMenuItem) ifTrue:[ loMenuItems add:el ]. |
1606 | 3034 |
]. |
3035 |
loMenuItems isEmpty ifTrue:[ ^ self ]. |
|
3036 |
||
1702 | 3037 |
self addAndSelectValueOf:[ |
2188 | 3038 |
loMenuItems collect:[:el| Item menuItem:el ] |
1606 | 3039 |
]. |
3040 |
! ! |
|
3041 |
||
1715 | 3042 |
!MenuEditor methodsFor:'user actions-hierarchy'! |
1606 | 3043 |
|
1958 | 3044 |
doMoveDown |
3045 |
"move selected item down" |
|
3046 |
||
3047 |
self doMoveUpOrDown:#down |
|
3048 |
! |
|
3049 |
||
1606 | 3050 |
doMoveIn:aDirection |
3051 |
"move selected item into the next (#inNext) or previous (#inPrev) item |
|
3052 |
" |
|
3053 |
|item idx parent toParent| |
|
3054 |
||
3055 |
item := self selectedItem. |
|
2151 | 3056 |
item isNil ifTrue:[^ self]. |
1606 | 3057 |
|
3058 |
aDirection == #inNext ifTrue:[ item canMoveInNext ifFalse:[^ self] ] |
|
2188 | 3059 |
ifFalse:[ item canMoveInAbove ifFalse:[^ self] ]. |
1606 | 3060 |
|
3061 |
self askForItemModification ifFalse:[ ^ self ]. |
|
3062 |
||
3063 |
parent := item parent. |
|
3064 |
idx := parent identityIndexOf:item. |
|
3065 |
||
3066 |
aDirection == #inNext ifTrue:[ toParent := parent at:(idx + 1) ifAbsent:nil ] |
|
2188 | 3067 |
ifFalse:[ toParent := parent at:(idx - 1) ifAbsent:nil ]. |
1606 | 3068 |
|
3069 |
self withoutNotifyDo:[ |
|
2188 | 3070 |
selectionHolder setValue:#(). |
3071 |
parent removeIndex:idx. |
|
3072 |
||
3073 |
aDirection == #inNext ifTrue:[ toParent addFirst:item ] |
|
3074 |
ifFalse:[ toParent addLast:item ]. |
|
3075 |
item makeVisible. |
|
1606 | 3076 |
]. |
3077 |
self selectedItem:item. |
|
1971 | 3078 |
self setModified. |
1468 | 3079 |
! |
3080 |
||
1958 | 3081 |
doMoveInNext |
3082 |
"move selected item into the next item" |
|
3083 |
||
3084 |
self doMoveIn:#inNext. |
|
3085 |
! |
|
3086 |
||
3087 |
doMoveInPrevious |
|
3088 |
"move selected item into the previous item" |
|
3089 |
||
3090 |
self doMoveIn:#inPrev. |
|
3091 |
! |
|
3092 |
||
1606 | 3093 |
doMoveOut |
3094 |
"move selected item out of current item |
|
3095 |
" |
|
3096 |
|item parent grandParent index| |
|
3097 |
||
3098 |
item := self selectedItem. |
|
2151 | 3099 |
item isNil ifTrue:[^ self]. |
1606 | 3100 |
item canMoveOut ifFalse:[^ self]. |
3101 |
||
3102 |
self askForItemModification ifFalse:[ ^ self ]. |
|
3103 |
||
3104 |
parent := item parent. |
|
3105 |
grandParent := parent parent. |
|
3106 |
index := grandParent identityIndexOf:parent. |
|
3107 |
||
3108 |
self withoutNotifyDo:[ |
|
2188 | 3109 |
selectionHolder setValue:#(). |
3110 |
parent remove:item. |
|
3111 |
index > grandParent size ifTrue:[ grandParent add:item ] |
|
3112 |
ifFalse:[ grandParent add:item afterIndex:index ] |
|
1606 | 3113 |
]. |
3114 |
self selectedItem:item. |
|
1971 | 3115 |
self setModified. |
218 | 3116 |
! |
3117 |
||
1958 | 3118 |
doMoveUp |
3119 |
"move selected item up" |
|
3120 |
||
3121 |
self doMoveUpOrDown:#up |
|
3122 |
! |
|
3123 |
||
2869 | 3124 |
doMoveUpOrDown:aDirectionSymbol |
3125 |
"move selected item up (#up) or down (#down)" |
|
3126 |
||
3127 |
|items itemsSortedByIndex index parent children| |
|
3128 |
||
3129 |
items := self selectedItems. |
|
3130 |
items isEmptyOrNil ifTrue:[^ self]. |
|
3131 |
(items conform:[:i | i canMoveUpOrDown]) ifFalse:[^ self]. |
|
1606 | 3132 |
|
3133 |
self askForItemModification ifFalse:[ ^ self ]. |
|
3134 |
||
3135 |
self withoutNotifyDo:[ |
|
2869 | 3136 |
itemsSortedByIndex := items copy. |
3137 |
(items collect:[:i | listOfItems identityIndexOf:i]) |
|
3138 |
sortWith:itemsSortedByIndex. |
|
3139 |
||
3140 |
aDirectionSymbol == #down ifTrue:[ |
|
3141 |
itemsSortedByIndex := itemsSortedByIndex reversed |
|
3142 |
]. |
|
3143 |
itemsSortedByIndex do:[:item | |
|
3144 |
parent := item parent. |
|
3145 |
children := parent children. |
|
3146 |
index := children identityIndexOf:item. |
|
3147 |
||
3148 |
selectionHolder setValue:#(). |
|
3149 |
children removeIndex:index. |
|
3150 |
||
3151 |
aDirectionSymbol == #up ifTrue:[ |
|
3152 |
index == 1 ifTrue:[ children add:item ] |
|
3153 |
ifFalse:[ children add:item beforeIndex:index - 1 ] |
|
3154 |
] ifFalse:[ |
|
3155 |
index > children size ifTrue:[ children addFirst:item ] |
|
3156 |
ifFalse:[ children add:item afterIndex:index ] |
|
3157 |
]. |
|
3158 |
parent childrenOrderChanged. |
|
3159 |
] |
|
1606 | 3160 |
]. |
2869 | 3161 |
self selectedItems:items. |
1971 | 3162 |
self setModified. |
2869 | 3163 |
|
3164 |
"Modified: / 18-01-2012 / 11:35:38 / cg" |
|
199 | 3165 |
! ! |
3166 |
||
1606 | 3167 |
!MenuEditor::Item class methodsFor:'defaults'! |
3168 |
||
3169 |
defaultLabel |
|
3170 |
^ self subclassResponsibility |
|
3171 |
! ! |
|
3172 |
||
3173 |
!MenuEditor::Item class methodsFor:'image specs'! |
|
3174 |
||
3175 |
iconDelayedLinkedMenu |
|
3176 |
"This resource specification was automatically generated |
|
3177 |
by the ImageEditor of ST/X." |
|
3178 |
||
3179 |
"Do not manually edit this!! If it is corrupted, |
|
3180 |
the ImageEditor may not be able to read the specification." |
|
3181 |
||
3182 |
" |
|
3183 |
self iconDelayedLinkedMenu inspect |
|
3184 |
ImageEditor openOnClass:self andSelector:#iconDelayedLinkedMenu |
|
3185 |
Icon flushCachedIcons |
|
3186 |
" |
|
3187 |
||
3188 |
<resource: #image> |
|
3189 |
||
3190 |
^Icon |
|
2270 | 3191 |
constantNamed:'MenuEditor::Item class iconDelayedLinkedMenu' |
3192 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3193 |
@@@@@@@@@@@@@@DQDQDQDQDQDR@AH"H"H"H"H"H0@@@BH"H"@@@BL@QDPBH"H"@@H#@DQDPBH@H"@"H0ADQDPBA@H"H"L@@@QDP@Q@@@@C@ADPQDQDQ@DQD: |
|
3194 |
@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 | 3195 |
! |
3196 |
||
3197 |
iconDelayedMenu |
|
3198 |
"This resource specification was automatically generated |
|
3199 |
by the ImageEditor of ST/X." |
|
3200 |
||
3201 |
"Do not manually edit this!! If it is corrupted, |
|
3202 |
the ImageEditor may not be able to read the specification." |
|
3203 |
||
3204 |
" |
|
3205 |
self iconDelayedMenu inspect |
|
3206 |
ImageEditor openOnClass:self andSelector:#iconDelayedMenu |
|
3207 |
Icon flushCachedIcons |
|
3208 |
" |
|
3209 |
||
3210 |
<resource: #image> |
|
3211 |
||
3212 |
^Icon |
|
2270 | 3213 |
constantNamed:'MenuEditor::Item class iconDelayedMenu' |
3214 |
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 | 3215 |
! |
3216 |
||
3217 |
iconItem |
|
3218 |
"This resource specification was automatically generated |
|
3219 |
by the ImageEditor of ST/X." |
|
3220 |
||
3221 |
"Do not manually edit this!! If it is corrupted, |
|
3222 |
the ImageEditor may not be able to read the specification." |
|
3223 |
||
3224 |
" |
|
3225 |
self iconItem inspect |
|
3226 |
ImageEditor openOnClass:self andSelector:#iconItem |
|
3227 |
Icon flushCachedIcons |
|
3228 |
" |
|
3229 |
||
3230 |
<resource: #image> |
|
3231 |
||
3232 |
^Icon |
|
2270 | 3233 |
constantNamed:'MenuEditor::Item class iconItem' |
3234 |
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 | 3235 |
! |
3236 |
||
3237 |
iconLinkedMenu |
|
3238 |
"This resource specification was automatically generated |
|
3239 |
by the ImageEditor of ST/X." |
|
3240 |
||
3241 |
"Do not manually edit this!! If it is corrupted, |
|
3242 |
the ImageEditor may not be able to read the specification." |
|
3243 |
||
3244 |
" |
|
3245 |
self iconLinkedMenu inspect |
|
3246 |
ImageEditor openOnClass:self andSelector:#iconLinkedMenu |
|
3247 |
Icon flushCachedIcons |
|
3248 |
" |
|
3249 |
||
3250 |
<resource: #image> |
|
3251 |
||
3252 |
^Icon |
|
2270 | 3253 |
constantNamed:'MenuEditor::Item class iconLinkedMenu' |
3254 |
ifAbsentPut:[(Depth4Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
1606 | 3255 |
@@@@@@@@@@@@@@QDQDQDQDQDQA@DH"H"H"H"H"HPABH@@@H"H"H"D@PQ@3L0DQDQDQ@D@@L3L0@@@@@PADPCL3L0PCADD@P"@@@3L0@3@!!@DH"H"@3L3L3@P |
2270 | 3256 |
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 | 3257 |
! |
3258 |
||
3259 |
iconMenu |
|
3260 |
"This resource specification was automatically generated |
|
3261 |
by the ImageEditor of ST/X." |
|
3262 |
||
3263 |
"Do not manually edit this!! If it is corrupted, |
|
3264 |
the ImageEditor may not be able to read the specification." |
|
3265 |
||
3266 |
" |
|
3267 |
self iconMenu inspect |
|
3268 |
ImageEditor openOnClass:self andSelector:#iconMenu |
|
3269 |
Icon flushCachedIcons |
|
3270 |
" |
|
3271 |
||
3272 |
<resource: #image> |
|
3273 |
||
3274 |
^Icon |
|
2270 | 3275 |
constantNamed:'MenuEditor::Item class iconMenu' |
3276 |
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 | 3277 |
! |
3278 |
||
3279 |
iconSeparator |
|
3280 |
"This resource specification was automatically generated |
|
3281 |
by the ImageEditor of ST/X." |
|
3282 |
||
3283 |
"Do not manually edit this!! If it is corrupted, |
|
3284 |
the ImageEditor may not be able to read the specification." |
|
3285 |
||
3286 |
" |
|
3287 |
self iconSeparator inspect |
|
3288 |
ImageEditor openOnClass:self andSelector:#iconSeparator |
|
3289 |
Icon flushCachedIcons |
|
3290 |
" |
|
3291 |
||
3292 |
<resource: #image> |
|
3293 |
||
3294 |
^Icon |
|
2270 | 3295 |
constantNamed:'MenuEditor::Item class iconSeparator' |
3296 |
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 | 3297 |
! |
3298 |
||
3299 |
iconSliceMenu |
|
3300 |
"This resource specification was automatically generated |
|
3301 |
by the ImageEditor of ST/X." |
|
3302 |
||
3303 |
"Do not manually edit this!! If it is corrupted, |
|
3304 |
the ImageEditor may not be able to read the specification." |
|
3305 |
||
3306 |
" |
|
3307 |
self iconSliceMenu inspect |
|
3308 |
ImageEditor openOnClass:self andSelector:#iconSliceMenu |
|
3309 |
Icon flushCachedIcons |
|
3310 |
" |
|
3311 |
||
3312 |
<resource: #image> |
|
3313 |
||
3314 |
^Icon |
|
2270 | 3315 |
constantNamed:'MenuEditor::Item class iconSliceMenu' |
3316 |
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 | 3317 |
! ! |
3318 |
||
3319 |
!MenuEditor::Item class methodsFor:'instance creation'! |
|
3320 |
||
3321 |
classFor:aMenuItem |
|
3322 |
||
1631 | 3323 |
aMenuItem isNil ifTrue:[ ^ nil ]. |
3324 |
||
3325 |
aMenuItem itemValue isNil ifTrue:[ |
|
2188 | 3326 |
aMenuItem isMenuSlice ifTrue:[ ^ MenuEditor::MenuSliceItem ]. |
3327 |
aMenuItem submenu notNil ifTrue:[ ^ MenuEditor::RegularMenuItem ]. |
|
3328 |
aMenuItem submenuChannel notNil ifTrue:[ ^ MenuEditor::LinkedMenuItem ]. |
|
3329 |
||
3330 |
(self separatorTypeOf:(aMenuItem rawLabel)) notNil ifTrue:[ |
|
3331 |
^ MenuEditor::SeparatorItem |
|
3332 |
] |
|
1606 | 3333 |
]. |
1631 | 3334 |
^ MenuEditor::ActionItem |
1454 | 3335 |
! |
3336 |
||
1606 | 3337 |
menuItem:aMenuItem |
3338 |
|item cls| |
|
3339 |
||
3340 |
cls := self classFor:aMenuItem. |
|
2151 | 3341 |
cls isNil ifTrue:[^ nil]. |
1606 | 3342 |
|
3343 |
item := cls new. |
|
3344 |
item menuItem:aMenuItem. |
|
2151 | 3345 |
^ item |
1606 | 3346 |
! ! |
3347 |
||
1668 | 3348 |
!MenuEditor::Item class methodsFor:'interface specs'! |
1606 | 3349 |
|
3350 |
detailsEditSpec |
|
3351 |
"This resource specification was automatically generated |
|
3352 |
by the UIPainter of ST/X." |
|
3353 |
||
3354 |
"Do not manually edit this!! If it is corrupted, |
|
3355 |
the UIPainter may not be able to read the specification." |
|
3356 |
||
3357 |
" |
|
3358 |
UIPainter new openOnClass:MenuEditor::Item andSelector:#detailsEditSpec |
|
3359 |
" |
|
3360 |
||
3361 |
<resource: #canvas> |
|
3362 |
||
2810 | 3363 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3364 |
#(FullSpec |
2189 | 3365 |
name: detailsEditSpec |
2810 | 3366 |
window: |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3367 |
(WindowSpec |
2189 | 3368 |
label: 'Details Edit' |
3369 |
name: 'Details Edit' |
|
3370 |
min: (Point 10 10) |
|
3371 |
bounds: (Rectangle 0 0 407 291) |
|
3372 |
) |
|
2810 | 3373 |
component: |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
3374 |
(SpecCollection |
2189 | 3375 |
collection: ( |
3376 |
(LabelSpec |
|
3377 |
label: 'Accelerator:' |
|
3378 |
name: 'shortcutKeyLabel' |
|
3379 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
3380 |
activeHelpKey: detailsAccelerator |
|
3381 |
translateLabel: true |
|
3382 |
resizeForLabel: true |
|
3383 |
adjust: right |
|
3384 |
) |
|
3385 |
(InputFieldSpec |
|
3386 |
name: 'shortcutKeyField' |
|
3387 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
3388 |
activeHelpKey: detailsAccelerator |
|
3389 |
tabable: true |
|
3390 |
model: shortcutKeyCharacter |
|
3391 |
group: inputGroup |
|
3392 |
type: symbolOrNil |
|
3393 |
immediateAccept: false |
|
3394 |
acceptOnReturn: true |
|
3395 |
acceptOnTab: true |
|
3396 |
acceptChannel: acceptChannel |
|
3397 |
modifiedChannel: modifiedChannel |
|
3398 |
acceptOnPointerLeave: false |
|
3399 |
) |
|
3400 |
(LabelSpec |
|
3401 |
label: 'Enabled:' |
|
3402 |
name: 'enabledLabel' |
|
3403 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
3404 |
activeHelpKey: detailsEnabled |
|
3405 |
translateLabel: true |
|
3406 |
resizeForLabel: true |
|
3407 |
adjust: right |
|
3408 |
) |
|
3409 |
(InputFieldSpec |
|
3410 |
name: 'enabledField' |
|
2810 | 3411 |
layout: (LayoutFrame 110 0 40 0 -25 1.0 62 0) |
2189 | 3412 |
activeHelpKey: detailsEnabled |
3413 |
tabable: true |
|
3414 |
model: enabled |
|
3415 |
group: inputGroup |
|
3416 |
type: symbolOrBooleanOrNil |
|
3417 |
immediateAccept: false |
|
3418 |
acceptOnReturn: true |
|
3419 |
acceptOnTab: true |
|
3420 |
acceptChannel: acceptChannel |
|
3421 |
modifiedChannel: modifiedChannel |
|
3422 |
acceptOnPointerLeave: false |
|
3423 |
) |
|
2810 | 3424 |
(ActionButtonSpec |
3425 |
label: 'browseActionImage' |
|
3426 |
name: 'Button1' |
|
3427 |
layout: (LayoutFrame -25 1 40 0 -5 1 62 0) |
|
3428 |
activeHelpKey: browseMethod |
|
3429 |
hasCharacterOrientedLabel: false |
|
3430 |
translateLabel: true |
|
3431 |
resizeForLabel: true |
|
3432 |
tabable: true |
|
3433 |
model: doBrowseEnabledMethod |
|
3434 |
) |
|
2189 | 3435 |
(LabelSpec |
3436 |
label: 'Visibility:' |
|
3437 |
name: 'visibilityLabel' |
|
3438 |
layout: (AlignmentOrigin 107 0 76 0 1 0.5) |
|
3439 |
activeHelpKey: detailsVisibility |
|
3440 |
translateLabel: true |
|
3441 |
resizeForLabel: true |
|
3442 |
adjust: right |
|
3443 |
) |
|
3444 |
(InputFieldSpec |
|
3445 |
name: 'isVisibleInputField' |
|
2810 | 3446 |
layout: (LayoutFrame 110 0 65 0 -25 1.0 87 0) |
2189 | 3447 |
activeHelpKey: detailsVisibility |
3448 |
tabable: true |
|
3449 |
model: isVisible |
|
3450 |
group: inputGroup |
|
3451 |
type: symbolOrBooleanOrNil |
|
3452 |
immediateAccept: false |
|
3453 |
acceptOnReturn: true |
|
3454 |
acceptOnTab: true |
|
3455 |
acceptChannel: acceptChannel |
|
3456 |
modifiedChannel: modifiedChannel |
|
3457 |
acceptOnPointerLeave: false |
|
3458 |
) |
|
2810 | 3459 |
(ActionButtonSpec |
3460 |
label: 'browseActionImage' |
|
3461 |
name: 'Button2' |
|
3462 |
layout: (LayoutFrame -25 1 65 0 -5 1 87 0) |
|
3463 |
activeHelpKey: browseMethod |
|
3464 |
hasCharacterOrientedLabel: false |
|
3465 |
translateLabel: true |
|
3466 |
resizeForLabel: true |
|
3467 |
tabable: true |
|
3468 |
model: doBrowseVisibilityMethod |
|
3469 |
) |
|
2189 | 3470 |
(LabelSpec |
3471 |
label: 'Aux Value' |
|
3472 |
name: 'auxLabel' |
|
3473 |
layout: (AlignmentOrigin 107 0 101 0 1 0.5) |
|
3474 |
activeHelpKey: detailsAuxValue |
|
3475 |
translateLabel: true |
|
3476 |
resizeForLabel: true |
|
3477 |
adjust: right |
|
3478 |
) |
|
3479 |
(InputFieldSpec |
|
3480 |
name: 'auxInputField' |
|
3481 |
layout: (LayoutFrame 110 0 90 0 -5 1.0 112 0) |
|
3482 |
activeHelpKey: detailsAuxValue |
|
3483 |
tabable: true |
|
3484 |
model: auxValue |
|
3485 |
group: inputGroup |
|
3486 |
type: smalltalkObjectOrNil |
|
3487 |
immediateAccept: false |
|
3488 |
acceptOnReturn: true |
|
3489 |
acceptOnTab: true |
|
3490 |
acceptChannel: acceptChannel |
|
3491 |
modifiedChannel: modifiedChannel |
|
3492 |
acceptOnPointerLeave: false |
|
3493 |
) |
|
3494 |
(LabelSpec |
|
3495 |
label: 'Start Group:' |
|
3496 |
name: 'StartGroupLabel' |
|
3497 |
layout: (AlignmentOrigin 107 0 139 0 1 0.5) |
|
3498 |
activeHelpKey: detailsStartGroup |
|
3499 |
translateLabel: true |
|
3500 |
resizeForLabel: true |
|
3501 |
adjust: right |
|
3502 |
) |
|
3503 |
(PopUpListSpec |
|
3504 |
label: 'left' |
|
3505 |
name: 'StartGroupPopUp' |
|
3506 |
layout: (LayoutFrame 110 0 128 0 -5 1.0 150 0) |
|
3507 |
activeHelpKey: detailsStartGroup |
|
3508 |
tabable: true |
|
3509 |
model: startGroup |
|
2810 | 3510 |
menu: |
3511 |
(Array |
|
3512 |
left right |
|
3513 |
conditionalRight |
|
3514 |
) |
|
2189 | 3515 |
) |
3516 |
(LabelSpec |
|
3517 |
label: 'Access Character Position:' |
|
3518 |
name: 'accessCharLabel' |
|
3519 |
layout: (AlignmentOrigin 217 0 170 0 1 0.5) |
|
3520 |
translateLabel: true |
|
3521 |
resizeForLabel: true |
|
3522 |
adjust: right |
|
3523 |
) |
|
3524 |
(InputFieldSpec |
|
3525 |
name: 'accessCharField' |
|
3526 |
layout: (LayoutFrame 220 0 159 0 -5 1.0 181 0) |
|
3527 |
activeHelpKey: detailsAccessCharaterPosition |
|
3528 |
tabable: true |
|
3529 |
model: accessCharacterPosition |
|
3530 |
group: inputGroup |
|
3531 |
type: numberOrNil |
|
3532 |
immediateAccept: false |
|
3533 |
acceptOnReturn: true |
|
3534 |
acceptOnTab: true |
|
3535 |
acceptChannel: acceptChannel |
|
3536 |
modifiedChannel: modifiedChannel |
|
3537 |
acceptOnPointerLeave: false |
|
3538 |
) |
|
3539 |
(CheckBoxSpec |
|
3540 |
label: 'Ignore Accelerator (i.e. Display Only)' |
|
3541 |
name: 'ignoreShortcutKeysInItem' |
|
3542 |
layout: (AlignmentOrigin 42 0 204 0 0 0.5) |
|
3543 |
activeHelpKey: detailsIgnoreAcceleratorKeys |
|
3544 |
visibilityChannel: hasNoSubmenu |
|
3545 |
model: ignoreShortcutKeys |
|
3546 |
translateLabel: true |
|
3547 |
resizeForLabel: true |
|
3548 |
) |
|
3549 |
(CheckBoxSpec |
|
3550 |
label: 'Ignore Accelerators in Submenu' |
|
3551 |
name: 'ignoreShortcutKeys' |
|
3552 |
layout: (AlignmentOrigin 42 0 204 0 0 0.5) |
|
3553 |
activeHelpKey: detailsIgnoreAcceleratorKeys |
|
3554 |
visibilityChannel: hasSubmenu |
|
3555 |
model: ignoreShortcutKeys |
|
3556 |
translateLabel: true |
|
3557 |
resizeForLabel: true |
|
3558 |
) |
|
3559 |
(CheckBoxSpec |
|
3560 |
label: 'Ignore Mnemonics in Submenu' |
|
3561 |
name: 'ignoreMnemonicKeys' |
|
3562 |
layout: (AlignmentOrigin 42 0 232 0 0 0.5) |
|
3563 |
activeHelpKey: detailsIgnoreMnemonicKeys |
|
3564 |
visibilityChannel: hasSubmenu |
|
3565 |
model: ignoreMnemonicKeys |
|
3566 |
translateLabel: true |
|
3567 |
resizeForLabel: true |
|
3568 |
) |
|
3569 |
(LabelSpec |
|
3570 |
label: 'Font:' |
|
3571 |
name: 'fontLabel' |
|
3572 |
layout: (AlignmentOrigin 107 0 271 0 1 0.5) |
|
3573 |
translateLabel: true |
|
3574 |
resizeForLabel: true |
|
3575 |
adjust: right |
|
3576 |
) |
|
3577 |
(FontMenuSpec |
|
3578 |
name: 'fontMenu' |
|
3579 |
layout: (LayoutFrame 110 0 260 0 -5 1.0 282 0) |
|
3580 |
activeHelpKey: fontMenu |
|
3581 |
model: font |
|
2810 | 3582 |
allowSymbolicFonts: true |
2189 | 3583 |
) |
3584 |
) |
|
2810 | 3585 |
|
2189 | 3586 |
) |
1454 | 3587 |
) |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
3588 |
|
2810 | 3589 |
"Modified: / 21-10-2010 / 14:15:09 / cg" |
1454 | 3590 |
! ! |
3591 |
||
1725 | 3592 |
!MenuEditor::Item class methodsFor:'interface-editor'! |
3593 |
||
3594 |
addBindingsTo:aspects for:aMenuEditor |
|
3595 |
"add additional bindings to the aspects |
|
3596 |
" |
|
2341 | 3597 |
aspects at:#notDelayedMenu ifAbsentPut:[true asValue]. |
3598 |
aspects at:#hasSubmenu ifAbsentPut:[false asValue]. |
|
3599 |
aspects at:#hasNoSubmenu ifAbsentPut:[true asValue]. |
|
1725 | 3600 |
! ! |
3601 |
||
1606 | 3602 |
!MenuEditor::Item class methodsFor:'testing'! |
3603 |
||
3604 |
separatorTypeOf:aString |
|
3605 |
|size first| |
|
3606 |
||
3607 |
size := aString size. |
|
3608 |
||
3609 |
size == 0 ifTrue:[ ^ #blank ]. |
|
3610 |
||
3611 |
size == 1 ifTrue:[ |
|
3612 |
first := aString first. |
|
3613 |
first == $- ifTrue:[ ^ #single ]. |
|
3614 |
first == $= ifTrue:[ ^ #double ]. |
|
3615 |
first == (Character space) ifTrue:[ ^ #blank ]. |
|
3616 |
]. |
|
3617 |
^ nil |
|
1454 | 3618 |
! ! |
3619 |
||
3620 |
!MenuEditor::Item methodsFor:'accessing'! |
|
3621 |
||
1606 | 3622 |
children |
3623 |
"optimize access; do not ask the model for unspecified children |
|
3624 |
" |
|
3625 |
^ children |
|
3626 |
! |
|
3627 |
||
3628 |
menuItem |
|
3629 |
"returns self as a MenuItem |
|
3630 |
" |
|
2168 | 3631 |
^ MenuItem decodeFromLiteralArray:(menuItem literalArrayEncoding). |
3632 |
||
3633 |
"Modified: / 27-03-2007 / 08:43:14 / cg" |
|
1606 | 3634 |
! |
3635 |
||
3636 |
menuItem:aMenuItem |
|
3637 |
"rebuild self from a MenuItem |
|
3638 |
" |
|
3639 |
|value| |
|
3640 |
||
3641 |
menuItem := MenuItem labeled:(self rawLabel). |
|
3642 |
||
3643 |
MenuEditor aspects do:[:aKey| |
|
2188 | 3644 |
value := self validateValue:(aMenuItem perform:aKey). |
3645 |
||
3646 |
value notNil ifTrue:[ |
|
3647 |
self aspectAt:aKey put:value. |
|
3648 |
]. |
|
1606 | 3649 |
]. |
3650 |
! |
|
3651 |
||
3652 |
rawLabel |
|
3653 |
"returns the label assigned to the item |
|
3654 |
" |
|
3655 |
^ menuItem rawLabel |
|
3656 |
! |
|
3657 |
||
3658 |
rawLabel:aValue |
|
3659 |
"set the label assigned to the item |
|
3660 |
" |
|
3661 |
aValue isString ifTrue:[ |
|
2188 | 3662 |
"/ KLUDGE alarm: '-' and '' indicate a separator |
3663 |
"/ (there is no separate menuItem class for them) |
|
3664 |
||
3665 |
(self isKindOfMenu or:[(self class separatorTypeOf:aValue) isNil]) ifTrue:[ |
|
3666 |
menuItem rawLabel:aValue |
|
3667 |
] |
|
1606 | 3668 |
]. |
3669 |
! |
|
3670 |
||
3671 |
slices |
|
3672 |
"returns a sequence of supported slices |
|
3673 |
" |
|
3674 |
^ self subclassResponsibility |
|
1454 | 3675 |
! |
3676 |
||
1606 | 3677 |
submenu |
3678 |
"returns the submenu (of class Menu) or nil |
|
3679 |
" |
|
3680 |
^ nil |
|
1631 | 3681 |
! |
3682 |
||
3683 |
translateLabel:aBoolean |
|
3684 |
menuItem translateLabel:aBoolean |
|
1606 | 3685 |
! ! |
3686 |
||
3687 |
!MenuEditor::Item methodsFor:'aspects'! |
|
3688 |
||
3689 |
aspectAt:aKey put:aValue |
|
2075 | 3690 |
"set a specific aspect named aKey to the aValue" |
3691 |
||
1606 | 3692 |
aKey == #rawLabel ifTrue:[ ^ self rawLabel:aValue ]. |
3693 |
aKey == #submenuChannel ifTrue:[ ^ self ]. |
|
3694 |
menuItem perform:((aKey, ':') asSymbol) with:aValue. |
|
2075 | 3695 |
|
3696 |
"Modified: / 05-09-2006 / 17:47:19 / cg" |
|
1606 | 3697 |
! |
3698 |
||
3699 |
fromAspects:aspects |
|
3700 |
"read values from aspects |
|
3701 |
" |
|
3702 |
MenuEditor aspects do:[:aKey| |
|
2189 | 3703 |
self aspectAt:aKey put:((aspects at:aKey) value). |
1606 | 3704 |
]. |
2189 | 3705 |
self validateMenuItem. |
1606 | 3706 |
self changed. |
3707 |
! |
|
3708 |
||
3709 |
toAspects:aspects |
|
3710 |
"write values to aspects |
|
3711 |
" |
|
3712 |
MenuEditor aspects do:[:aKey| |
|
2188 | 3713 |
(aspects at:aKey) value:(menuItem perform:aKey) |
1606 | 3714 |
]. |
3715 |
(aspects at:#notDelayedMenu) value:(self isDelayedMenu not). |
|
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
3716 |
(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
|
3717 |
(aspects at:#hasNoSubmenu) value:(self isKindOfMenu not ). |
2189 | 3718 |
! |
3719 |
||
3720 |
validateMenuItem |
|
3721 |
"validate the menuItem for correctness" |
|
3722 |
||
3723 |
menuItem isNil ifTrue:[^ self]. |
|
3724 |
||
3725 |
menuItem choice isEmptyOrNil ifTrue:[ |
|
3726 |
menuItem choice:nil. |
|
3727 |
menuItem choiceValue:nil. |
|
3728 |
]. |
|
1606 | 3729 |
! ! |
3730 |
||
3731 |
!MenuEditor::Item methodsFor:'displaying'! |
|
3732 |
||
3733 |
displayLabel |
|
3734 |
"returns the label on default displayed on the screen |
|
3735 |
" |
|
3736 |
^ menuItem rawLabel |
|
3737 |
! |
|
3738 |
||
3739 |
displayOn:aGC x:x y:y h:h |
|
3740 |
"display the item in the graphicsContext, aGC. |
|
3741 |
" |
|
3742 |
|label| |
|
3743 |
||
3744 |
label := self displayLabel. |
|
3745 |
||
3746 |
label notNil ifTrue:[ |
|
3747 |
self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h |
|
3748 |
]. |
|
3749 |
! |
|
3750 |
||
3751 |
heightOn:aGC |
|
3752 |
"returns the height of the label on a GC |
|
3753 |
" |
|
2151 | 3754 |
height isNil ifTrue:[ height := parent heightOn:aGC ]. |
3755 |
^ height |
|
1454 | 3756 |
! |
3757 |
||
3758 |
label |
|
1606 | 3759 |
"get the rawLabel assigned to the item |
3760 |
" |
|
3761 |
^ menuItem rawLabel |
|
1454 | 3762 |
! |
3763 |
||
1606 | 3764 |
label:aLabel |
3765 |
"set the rawLabel assigned to the item |
|
3766 |
" |
|
3767 |
self rawLabel:aLabel |
|
1454 | 3768 |
! |
3769 |
||
1606 | 3770 |
widthOn:aGC |
3771 |
"returns the height of the displayLabel on a GC |
|
3772 |
" |
|
2151 | 3773 |
width isNil ifTrue:[ width := self widthOf:(self displayLabel) on:aGC ]. |
3774 |
^ width |
|
1454 | 3775 |
! ! |
3776 |
||
1606 | 3777 |
!MenuEditor::Item methodsFor:'initialization'! |
3778 |
||
3779 |
initialize |
|
3780 |
super initialize. |
|
3781 |
menuItem := MenuItem label:(self class defaultLabel). |
|
1454 | 3782 |
! ! |
3783 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3784 |
!MenuEditor::Item methodsFor:'private'! |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3785 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3786 |
validateValue:aValue |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3787 |
"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
|
3788 |
a block model, .... |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3789 |
" |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3790 |
aValue notNil ifTrue:[ |
2188 | 3791 |
aValue isBlock ifTrue:[ ^ #block ]. |
3792 |
aValue isValueModel ifTrue:[ ^ #valueModel ]. |
|
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3793 |
]. |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3794 |
^ aValue |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3795 |
! ! |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
3796 |
|
1454 | 3797 |
!MenuEditor::Item methodsFor:'queries'! |
3798 |
||
1606 | 3799 |
isAction |
3800 |
"returns true if the item is an Action |
|
3801 |
" |
|
3802 |
^ false |
|
3803 |
! |
|
3804 |
||
3805 |
isDelayedMenu |
|
3806 |
"returns true if the item is a Delayed (Linked) Menu |
|
3807 |
" |
|
3808 |
^ parent isAction |
|
3809 |
! |
|
3810 |
||
3811 |
isKindOfMenu |
|
3812 |
"returns true if the item is a Linked Menu or Menu |
|
3813 |
" |
|
3814 |
^ false |
|
3815 |
! |
|
3816 |
||
1633 | 3817 |
isMenuEditItem |
3818 |
^ true |
|
3819 |
! |
|
3820 |
||
1606 | 3821 |
isRootItem |
3822 |
"returns true if the item is the root item |
|
3823 |
" |
|
3824 |
^ false |
|
3825 |
! ! |
|
3826 |
||
1660 | 3827 |
!MenuEditor::Item methodsFor:'queries-editor'! |
1614 | 3828 |
|
3829 |
actionSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3830 |
"return my action selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3831 |
|
1614 | 3832 |
|value| |
3833 |
||
3834 |
value := menuItem value. |
|
3835 |
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
|
3836 |
^ #() |
1614 | 3837 |
! |
3838 |
||
3839 |
aspectSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3840 |
"return my aspect selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3841 |
|
1614 | 3842 |
|aspects| |
3843 |
||
3844 |
aspects := OrderedCollection new. |
|
3845 |
||
3846 |
#( indication choice enabled isVisible ) do:[:aKey| |sel| |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3847 |
sel := menuItem perform:aKey. |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
3848 |
sel isSymbol ifTrue:[ aspects add:sel ] |
2188 | 3849 |
]. |
1614 | 3850 |
^ aspects |
3851 |
! ! |
|
3852 |
||
1660 | 3853 |
!MenuEditor::Item methodsFor:'queries-operation'! |
1606 | 3854 |
|
3855 |
canAddChildren |
|
3856 |
"returns true if children can be added |
|
3857 |
" |
|
3858 |
^ false |
|
3859 |
! |
|
3860 |
||
3861 |
canAddDelayedMenu |
|
3862 |
"returns true if a delayed menu can be added; |
|
3863 |
on default false is returned |
|
3864 |
" |
|
3865 |
^ false |
|
3866 |
! |
|
3867 |
||
3868 |
canMoveInAbove |
|
3869 |
"returns true if the item can become a child of its previous sibling |
|
3870 |
" |
|
3871 |
|siblings index nextItem| |
|
3872 |
||
3873 |
siblings := parent children. |
|
3874 |
siblings size > 1 ifFalse:[ ^ false ]. |
|
3875 |
||
3876 |
index := siblings identityIndexOf:self. |
|
3877 |
nextItem := siblings at:(index - 1) ifAbsent:nil. |
|
3878 |
||
2151 | 3879 |
nextItem isNil ifTrue:[^ false]. |
3880 |
^ nextItem canAddChildren |
|
1454 | 3881 |
! |
3882 |
||
1606 | 3883 |
canMoveInNext |
3884 |
"returns true if the item can become a child of its next sibling |
|
3885 |
" |
|
3886 |
|siblings index nextItem| |
|
3887 |
||
3888 |
siblings := parent children. |
|
3889 |
siblings size > 1 ifFalse:[ ^ false ]. |
|
3890 |
||
3891 |
index := siblings identityIndexOf:self. |
|
3892 |
nextItem := siblings at:(index + 1) ifAbsent:nil. |
|
3893 |
||
2151 | 3894 |
nextItem isNil ifTrue:[^ false]. |
3895 |
^ nextItem canAddChildren |
|
1606 | 3896 |
! |
3897 |
||
3898 |
canMoveOut |
|
3899 |
"returns true if the item can be moved out from its current parent |
|
3900 |
" |
|
3901 |
self isDelayedMenu ifTrue:[^ false]. |
|
3902 |
parent isDelayedMenu ifTrue:[^ false]. |
|
3903 |
||
3904 |
^ parent parent notNil |
|
1454 | 3905 |
! |
3906 |
||
1606 | 3907 |
canMoveUpOrDown |
3908 |
"returns true if the item can change its vertical order in its sibling |
|
3909 |
" |
|
3910 |
^ parent children size > 1 |
|
3911 |
! ! |
|
3912 |
||
2850
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3913 |
!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
|
3914 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3915 |
windowSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3916 |
"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
|
3917 |
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
|
3918 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3919 |
"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
|
3920 |
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
|
3921 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3922 |
" |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3923 |
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
|
3924 |
MenuEditor::ImageResourceEditor new openInterface:#windowSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3925 |
MenuEditor::ImageResourceEditor open |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3926 |
" |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3927 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3928 |
<resource: #canvas> |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3929 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3930 |
^ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3931 |
#(FullSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3932 |
name: windowSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3933 |
window: |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3934 |
(WindowSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3935 |
label: 'Image Item' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3936 |
name: 'Image Item' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3937 |
min: (Point 10 10) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3938 |
bounds: (Rectangle 0 0 303 304) |
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 |
component: |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3941 |
(SpecCollection |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3942 |
collection: ( |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3943 |
(LabelSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3944 |
label: 'Retriever:' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3945 |
name: 'retrieverLabel' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3946 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3947 |
activeHelpKey: imageRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3948 |
translateLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3949 |
resizeForLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3950 |
adjust: right |
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 |
(ComboBoxSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3953 |
name: 'retrieverHolder' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3954 |
layout: (LayoutFrame 110 0 15 0 -2 1.0 37 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3955 |
activeHelpKey: imageRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3956 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3957 |
model: retrieverHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3958 |
type: symbolOrNil |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3959 |
immediateAccept: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3960 |
acceptOnReturn: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3961 |
acceptOnTab: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3962 |
acceptOnPointerLeave: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3963 |
entryCompletionBlock: entryCompletionForRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3964 |
comboList: retrieverList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3965 |
isFilenameBox: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3966 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3967 |
(LabelSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3968 |
label: 'Selector:' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3969 |
name: 'iconLabel' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3970 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3971 |
activeHelpKey: imageSelector |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3972 |
translateLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3973 |
resizeForLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3974 |
adjust: right |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3975 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3976 |
(InputFieldSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3977 |
name: 'selectorHolder' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3978 |
layout: (LayoutFrame 110 0 40 0 -24 1.0 62 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3979 |
activeHelpKey: imageSelector |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3980 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3981 |
model: selectorHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3982 |
group: inputGroup |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3983 |
type: symbolOrNil |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3984 |
immediateAccept: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3985 |
acceptOnReturn: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3986 |
acceptOnTab: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3987 |
modifiedChannel: modifiedChannel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3988 |
acceptOnPointerLeave: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3989 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3990 |
(ActionButtonSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3991 |
label: '...' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3992 |
name: 'browseButton' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3993 |
layout: (LayoutFrame -22 1 40 0 -2 1 62 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3994 |
activeHelpKey: browseResource |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3995 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3996 |
model: doBrowseForImageResource |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3997 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3998 |
(DividerSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
3999 |
name: 'Separator1' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4000 |
layout: (LayoutFrame 0 0.0 66 0 0 1.0 70 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4001 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4002 |
(ViewSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4003 |
name: 'SelectorFilterBox2' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4004 |
layout: (LayoutFrame 0 0.0 74 0 0 1.0 96 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4005 |
activeHelpKey: selectorFilter |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4006 |
component: |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4007 |
(SpecCollection |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4008 |
collection: ( |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4009 |
(LabelSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4010 |
label: 'Filter:' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4011 |
name: 'Label1' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4012 |
layout: (AlignmentOrigin 107 0 11 0 1 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4013 |
activeHelpKey: selectorFilter |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4014 |
translateLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4015 |
resizeForLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4016 |
adjust: right |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4017 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4018 |
(InputFieldSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4019 |
name: 'EntryField1' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4020 |
layout: (LayoutFrame 110 0 0 0 -2 1 22 0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4021 |
model: selectorFilterHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4022 |
immediateAccept: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4023 |
acceptOnLeave: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4024 |
acceptOnReturn: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4025 |
acceptOnTab: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4026 |
acceptOnPointerLeave: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4027 |
activeHelpKey: selectorFilter |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4028 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4029 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4030 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4031 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4032 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4033 |
(HierarchicalListViewSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4034 |
name: 'imageList' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4035 |
layout: (LayoutFrame 2 0.0 100 0 -2 1.0 -60 1.0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4036 |
activeHelpKey: imageImageList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4037 |
model: imageHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4038 |
menu: menuEditImage |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4039 |
hasHorizontalScrollBar: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4040 |
hasVerticalScrollBar: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4041 |
miniScrollerHorizontal: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4042 |
listModel: imageList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4043 |
useIndex: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4044 |
highlightMode: label |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4045 |
postBuildCallback: postBuildImageViewer: |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4046 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4047 |
(ViewSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4048 |
name: 'Box1' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4049 |
layout: (LayoutFrame 20 0.0 -60 1.0 -20 1.0 0 1.0) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4050 |
level: 0 |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4051 |
component: |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4052 |
(SpecCollection |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4053 |
collection: ( |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4054 |
(CheckBoxSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4055 |
label: 'Image & Label' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4056 |
name: 'iconAndLabelCheckBox' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4057 |
layout: (AlignmentOrigin 0 0 17 0 0 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4058 |
activeHelpKey: imageImageAndLabel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4059 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4060 |
model: iconAndLabelHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4061 |
translateLabel: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4062 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4063 |
(ActionButtonSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4064 |
label: 'Image Editor' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4065 |
name: 'imageEditorButton' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4066 |
layout: (AlignmentOrigin -69 1.0 17 0 0 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4067 |
activeHelpKey: imageImageEditor |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4068 |
hasCharacterOrientedLabel: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4069 |
foregroundColor: (Color 0.0 0.0 66.9993133440146) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4070 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4071 |
model: doEditImage |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4072 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4073 |
(ActionButtonSpec |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4074 |
label: 'Browse' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4075 |
name: 'Button1' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4076 |
layout: (AlignmentOrigin -69 1.0 41 0 0 0.5) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4077 |
activeHelpKey: imageBrowseImageClass |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4078 |
hasCharacterOrientedLabel: false |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4079 |
foregroundColor: (Color 0.0 0.0 66.9993133440146) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4080 |
tabable: true |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4081 |
model: doBrowseImageClass |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4082 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4083 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4084 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4085 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4086 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4087 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4088 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4089 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4090 |
) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4091 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4092 |
"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
|
4093 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4094 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4095 |
!MenuEditor::ImageResourceEditor methodsFor:'accessing'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4096 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4097 |
resourceRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4098 |
|rcv sel cls clsName| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4099 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4100 |
sel := selectorHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4101 |
sel size == 0 ifTrue:[ ^ nil ]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4102 |
cls := self retrieverClass. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4103 |
cls notNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4104 |
clsName := retrieverHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4105 |
clsName isEmptyOrNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4106 |
clsName := cls name. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4107 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4108 |
clsName := clsName asSymbol. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4109 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4110 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4111 |
rcv := ResourceRetriever new. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4112 |
rcv className:clsName. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4113 |
rcv selector:sel. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4114 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4115 |
iconAndLabelHolder value ifTrue:[ rcv labelText:'' ]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4116 |
^ rcv |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4117 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4118 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4119 |
resourceRetriever:aResourceRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4120 |
|className sel isOn| |
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 |
aResourceRetriever notNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4123 |
className := aResourceRetriever className. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4124 |
className isBehavior ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4125 |
className := className name asSymbol |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4126 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4127 |
sel := aResourceRetriever selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4128 |
isOn := aResourceRetriever labelText notNil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4129 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4130 |
className := sel := nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4131 |
isOn := false. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4132 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4133 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4134 |
retrieverHolder value:className. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4135 |
selectorHolder value:sel. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4136 |
iconAndLabelHolder value:isOn. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4137 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4138 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4139 |
retrieverClass |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4140 |
|clsName cls| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4141 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4142 |
clsName := retrieverHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4143 |
clsName notEmptyOrNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4144 |
cls := Smalltalk at:clsName ifAbsent:nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4145 |
(cls isBehavior) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4146 |
^ cls |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4147 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4148 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4149 |
^ nil |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4150 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4151 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4152 |
!MenuEditor::ImageResourceEditor methodsFor:'actions'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4153 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4154 |
doBrowseForImageResource |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4155 |
"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
|
4156 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4157 |
|classAndSelector| |
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 |
classAndSelector := ResourceSelectionBrowser |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4160 |
request:'Use Image From Class' |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4161 |
onSuperclass:nil |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4162 |
andClass:(self retrieverClass) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4163 |
andSelector:(selectorHolder value) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4164 |
withResourceTypes:#(image fileImage programImage). |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4165 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4166 |
classAndSelector isNil ifTrue:[ ^ self ]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4167 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4168 |
retrieverHolder value:(classAndSelector methodClass) name. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4169 |
selectorHolder value:(classAndSelector methodSelector). |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4170 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4171 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4172 |
doBrowseImageClass |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4173 |
|cls sel image| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4174 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4175 |
(cls := retrieverHolder value) isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4176 |
Dialog warn:'No resource retriever is defined.'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4177 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4178 |
sel := selectorHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4179 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4180 |
cls := Smalltalk classNamed:cls. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4181 |
cls isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4182 |
Dialog warn:'No such resource retriever class.'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4183 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4184 |
(cls respondsTo:#visualFor:) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4185 |
image := cls visualFor:sel. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4186 |
image ~~ (cls perform:sel) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4187 |
self warn:'The image is resolved via #visualFor: from some unknown class'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4188 |
sel := #visualFor:. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4189 |
]. |
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 |
UserPreferences current systemBrowserClass openInClass:cls class selector:sel |
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 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4194 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4195 |
"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
|
4196 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4197 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4198 |
doEditImage |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4199 |
|sel cls item image| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4200 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4201 |
item := imageHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4202 |
item notNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4203 |
item doEdit. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4204 |
^ self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4205 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4206 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4207 |
sel := selectorHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4208 |
sel isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4209 |
Dialog warn:'No selector is defined.'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4210 |
^ self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4211 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4212 |
cls := retrieverHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4213 |
cls isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4214 |
Dialog warn:'No resource retriever is defined.'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4215 |
^ self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4216 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4217 |
cls := Smalltalk classNamed:cls. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4218 |
cls isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4219 |
Dialog warn:'No such resource retriever class.'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4220 |
^ self. |
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 |
(cls respondsTo:#visualFor:) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4223 |
image := cls visualFor:sel. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4224 |
image ~~ (cls perform:sel ifNotUnderstood:nil) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4225 |
self warn:'The image is resolved via #visualFor: from some unknown class'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4226 |
image notNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4227 |
ImageEditor openOnImage:image. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4228 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4229 |
^ self. |
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 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4232 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4233 |
ImageEditor openOnClass:cls andSelector:sel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4234 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4235 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4236 |
!MenuEditor::ImageResourceEditor methodsFor:'aspects'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4237 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4238 |
entryCompletionForRetriever |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4239 |
^ DoWhatIMeanSupport classNameEntryCompletionBlock. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4240 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4241 |
"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
|
4242 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4243 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4244 |
iconAndLabelHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4245 |
^ iconAndLabelHolder |
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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4248 |
imageHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4249 |
^ imageHolder. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4250 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4251 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4252 |
imageList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4253 |
^ imageList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4254 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4255 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4256 |
modifiedChannel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4257 |
^ builder booleanValueAspectFor: #modifiedChannel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4258 |
! |
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 |
modifiedChannel:aChannel |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4261 |
builder aspectAt:#modifiedChannel put:aChannel. |
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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4264 |
retrieverHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4265 |
^ retrieverHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4266 |
! |
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 |
retrieverList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4269 |
|list cls| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4270 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4271 |
list := builder bindingAt:#retrieverList. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4272 |
list isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4273 |
list := MenuEditor imageRetrieverClasses asList. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4274 |
builder aspectAt:#retrieverList put:list. |
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 |
(masterApplication notNil |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4277 |
and:[(cls := masterApplication specClass) notNil]) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4278 |
list := list copyWithFirst:cls. |
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 |
^ list |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4281 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4282 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4283 |
selectorFilterHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4284 |
^ selectorFilterHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4285 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4286 |
"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
|
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 |
selectorHolder |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4290 |
^ selectorHolder. |
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 |
!MenuEditor::ImageResourceEditor methodsFor:'change & update'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4294 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4295 |
retrieverChanged |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4296 |
|retriever list name| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4297 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4298 |
retriever := self retrieverClass. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4299 |
imageHolder setValue:nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4300 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4301 |
self updateImageList. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4302 |
self updateSelectedImage. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4303 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4304 |
(retriever notNil and:[imageList size ~~ 0]) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4305 |
list := self retrieverList. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4306 |
name := retriever name. |
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 |
(list includes:name) ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4309 |
list add:(name asSymbol). |
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 |
]. |
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 |
"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
|
4314 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4315 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4316 |
selectorChanged |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4317 |
self updateSelectedImage. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4318 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4319 |
"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
|
4320 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4321 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4322 |
selectorFilterChanged |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4323 |
self updateImageList. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4324 |
self updateSelectedImage. |
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 |
"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
|
4327 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4328 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4329 |
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
|
4330 |
|item| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4331 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4332 |
self modifiedChannel value:true. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4333 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4334 |
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
|
4335 |
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
|
4336 |
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
|
4337 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4338 |
aModel == imageHolder ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4339 |
item := imageHolder value. |
2862 | 4340 |
item notNil ifTrue:[ |
2850
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4341 |
selectorHolder value:(item label) |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4342 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4343 |
^ self |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4344 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4345 |
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
|
4346 |
|
2862 | 4347 |
"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
|
4348 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4349 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4350 |
updateImageList |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4351 |
|retriever selectorFilterString filter| |
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 |
retriever := self retrieverClass. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4354 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4355 |
filter := [:sel | true]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4356 |
(selectorFilterString := selectorFilterHolder value) notEmptyOrNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4357 |
selectorFilterString includesMatchCharacters ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4358 |
filter := [:sel | selectorFilterString match:sel ignoreCase:true]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4359 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4360 |
filter := [:sel | sel includesString:selectorFilterString]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4361 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4362 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4363 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4364 |
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
|
4365 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4366 |
"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
|
4367 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4368 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4369 |
updateSelectedImage |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4370 |
"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
|
4371 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4372 |
|item selector line| |
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 |
imageList isEmpty ifTrue:[^ self]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4375 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4376 |
selector := selectorHolder value. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4377 |
selector isEmptyOrNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4378 |
imageHolder value:nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4379 |
^ self |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4380 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4381 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4382 |
item := nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4383 |
selector := selector asSymbol. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4384 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4385 |
imageList do:[:anItem| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4386 |
|sel| |
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 |
sel := anItem selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4389 |
selector == sel ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4390 |
imageHolder value:anItem. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4391 |
^ self |
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 |
item isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4394 |
(sel startsWith:selector) ifTrue:[ item := anItem ] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4395 |
] |
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 |
imageHolder value:nil. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4398 |
|
2862 | 4399 |
item notNil ifTrue:[ |
2850
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4400 |
line := imageList identityIndexOf:item. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4401 |
line ~~ 0 ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4402 |
"/ imageListView scrollToLine:line |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4403 |
imageListView makeLineVisible:line |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4404 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4405 |
]. |
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 |
"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
|
4408 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4409 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4410 |
!MenuEditor::ImageResourceEditor methodsFor:'initialization'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4411 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4412 |
initialize |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4413 |
super initialize. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4414 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4415 |
iconAndLabelHolder := true asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4416 |
iconAndLabelHolder addDependent:self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4417 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4418 |
imageHolder := nil asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4419 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4420 |
selectorHolder := nil asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4421 |
selectorHolder addDependent:self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4422 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4423 |
imageList := HierarchicalList new. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4424 |
imageList application:self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4425 |
imageList root:(ImageResourceEditorItem new). |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4426 |
imageList showRoot:false. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4427 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4428 |
imageHolder := nil asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4429 |
imageHolder addDependent:self. |
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 |
retrieverHolder := nil asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4432 |
retrieverHolder addDependent:self. |
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 |
selectorFilterHolder := '' asValue. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4435 |
selectorFilterHolder addDependent:self. |
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 |
"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
|
4438 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4439 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4440 |
postBuildImageViewer:aWidget |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4441 |
imageListView := aWidget. |
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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4444 |
!MenuEditor::ImageResourceEditor::ImageResourceEditorItem methodsFor:'accessing'! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4445 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4446 |
icon |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4447 |
^ icon |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4448 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4449 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4450 |
label |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4451 |
^ selector |
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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4454 |
selector |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4455 |
^ selector |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4456 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4457 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4458 |
!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
|
4459 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4460 |
forClass:aClass selector:aSelector |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4461 |
|w h magnify iconOrSymbol| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4462 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4463 |
selector := aSelector asSymbol. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4464 |
selector numArgs == 0 ifFalse:[^ self]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4465 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4466 |
"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
|
4467 |
(aClass respondsTo:#visualFor:) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4468 |
iconOrSymbol := aClass visualFor:selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4469 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4470 |
iconOrSymbol isNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4471 |
iconOrSymbol := aClass perform:selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4472 |
]. |
2948 | 4473 |
iconOrSymbol isNil ifTrue:[^ self]. |
4474 |
||
2850
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4475 |
iconOrSymbol isSymbol ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4476 |
icon := ToolbarIconLibrary perform:iconOrSymbol. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4477 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4478 |
icon := iconOrSymbol. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4479 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4480 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4481 |
w := icon width. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4482 |
h := icon height. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4483 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4484 |
w > 32 ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4485 |
magnify := 32 / w. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4486 |
h > 32 ifTrue:[ magnify := (32 / h) max:magnify ]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4487 |
] ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4488 |
h > 32 ifFalse:[^ self]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4489 |
magnify := 32 / h. |
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 |
icon := icon magnifiedBy: magnify. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4492 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4493 |
"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
|
4494 |
"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
|
4495 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4496 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4497 |
initialize |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4498 |
super initialize. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4499 |
children := #(). |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4500 |
! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4501 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4502 |
updateFromClass:aClass selectorFilter:aFilterBlock |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4503 |
|r item| |
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 |
(aClass notNil and:[aClass isBehavior]) ifFalse:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4506 |
^ self collapse. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4507 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4508 |
"/ aClass == selector ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4509 |
"/ ^ self expand |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4510 |
"/ ]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4511 |
self collapse. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4512 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4513 |
selector := aClass. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4514 |
children := OrderedCollection new. |
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 |
self application withWaitCursorDo:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4517 |
aClass withAllSuperclassesDo:[:aClass| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4518 |
aClass class selectorsAndMethodsDo:[:sel :m| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4519 |
(aFilterBlock value:sel) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4520 |
m hasResource ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4521 |
r := m resources. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4522 |
r notEmptyOrNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4523 |
((r includesKey:#image) or:[r includesKey:#programImage]) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4524 |
item := self class new forClass:aClass selector:sel. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4525 |
item parent:self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4526 |
children add:item |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4527 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4528 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4529 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4530 |
] |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4531 |
] |
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 |
children sort:[:a :b | a label < b label ]. |
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 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4537 |
"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
|
4538 |
! ! |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4539 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4540 |
!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
|
4541 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4542 |
doEdit |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4543 |
"open image browser on self" |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4544 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4545 |
|parent aClass image| |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4546 |
|
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4547 |
parent := self parent. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4548 |
parent notNil ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4549 |
aClass := parent selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4550 |
(aClass respondsTo:#visualFor:) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4551 |
image := aClass visualFor:selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4552 |
image ~~ (aClass perform:selector) ifTrue:[ |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4553 |
self warn:'The image is resolved via #visualFor: from some unknown class'. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4554 |
ImageEditor openOnImage:image. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4555 |
^ self. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4556 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4557 |
]. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4558 |
ImageEditor openOnClass:aClass andSelector:selector. |
3a5c3b8eedff
added a selector filter (to the image resource tab)
Claus Gittinger <cg@exept.de>
parents:
2843
diff
changeset
|
4559 |
]. |
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 |
|
1631 | 4562 |
!MenuEditor::ActionItem class methodsFor:'defaults'! |
1606 | 4563 |
|
4564 |
defaultLabel |
|
4565 |
^ 'Action' |
|
4566 |
! ! |
|
4567 |
||
1668 | 4568 |
!MenuEditor::ActionItem class methodsFor:'interface specs'! |
1606 | 4569 |
|
4570 |
basicsEditSpec |
|
4571 |
"This resource specification was automatically generated |
|
4572 |
by the UIPainter of ST/X." |
|
4573 |
||
4574 |
"Do not manually edit this!! If it is corrupted, |
|
4575 |
the UIPainter may not be able to read the specification." |
|
4576 |
||
4577 |
" |
|
1634 | 4578 |
UIPainter new openOnClass:MenuEditor::ActionItem andSelector:#basicsEditSpec |
1606 | 4579 |
" |
4580 |
||
4581 |
<resource: #canvas> |
|
4582 |
||
2297 | 4583 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4584 |
#(FullSpec |
2189 | 4585 |
name: basicsEditSpec |
2297 | 4586 |
window: |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4587 |
(WindowSpec |
2189 | 4588 |
label: 'basicsEditSpec' |
4589 |
name: 'basicsEditSpec' |
|
4590 |
min: (Point 10 10) |
|
4591 |
bounds: (Rectangle 0 0 340 340) |
|
4592 |
) |
|
2297 | 4593 |
component: |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
4594 |
(SpecCollection |
2189 | 4595 |
collection: ( |
4596 |
(LabelSpec |
|
4597 |
label: 'Name Key:' |
|
4598 |
name: 'nameKeyLabel' |
|
4599 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
4600 |
activeHelpKey: basicsKey |
|
4601 |
translateLabel: true |
|
4602 |
resizeForLabel: true |
|
4603 |
adjust: right |
|
4604 |
) |
|
4605 |
(InputFieldSpec |
|
4606 |
name: 'nameKeyField' |
|
4607 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
4608 |
activeHelpKey: basicsKey |
|
4609 |
tabable: true |
|
4610 |
model: nameKey |
|
4611 |
group: inputGroup |
|
4612 |
type: symbolOrNil |
|
4613 |
immediateAccept: false |
|
4614 |
acceptOnLeave: false |
|
4615 |
acceptOnReturn: true |
|
4616 |
acceptOnTab: true |
|
4617 |
acceptOnLostFocus: false |
|
4618 |
acceptChannel: acceptChannel |
|
4619 |
modifiedChannel: modifiedChannel |
|
4620 |
acceptOnPointerLeave: false |
|
4621 |
) |
|
4622 |
(LabelSpec |
|
4623 |
label: 'Label:' |
|
4624 |
name: 'labelLabel' |
|
4625 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4626 |
activeHelpKey: basicsLabel |
|
4627 |
translateLabel: true |
|
4628 |
resizeForLabel: true |
|
4629 |
adjust: right |
|
4630 |
) |
|
4631 |
(InputFieldSpec |
|
4632 |
name: 'labelField' |
|
4633 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
4634 |
activeHelpKey: basicsLabel |
|
4635 |
tabable: true |
|
4636 |
model: rawLabel |
|
4637 |
group: inputGroup |
|
4638 |
immediateAccept: false |
|
4639 |
acceptOnReturn: true |
|
4640 |
acceptOnTab: true |
|
4641 |
acceptOnLostFocus: false |
|
4642 |
acceptChannel: acceptChannel |
|
4643 |
modifiedChannel: modifiedChannel |
|
4644 |
acceptOnPointerLeave: false |
|
4645 |
) |
|
4646 |
(LabelSpec |
|
4647 |
label: 'Action:' |
|
4648 |
name: 'valueLabel' |
|
4649 |
layout: (AlignmentOrigin 107 0 82 0 1 0.5) |
|
4650 |
activeHelpKey: basicsAction |
|
4651 |
translateLabel: true |
|
4652 |
resizeForLabel: true |
|
4653 |
adjust: right |
|
4654 |
) |
|
4655 |
(InputFieldSpec |
|
4656 |
name: 'valueField' |
|
2297 | 4657 |
layout: (LayoutFrame 110 0 71 0 -25 1.0 93 0) |
2189 | 4658 |
activeHelpKey: basicsAction |
4659 |
tabable: true |
|
4660 |
model: itemValue |
|
4661 |
group: inputGroup |
|
4662 |
type: symbolOrNil |
|
4663 |
immediateAccept: false |
|
4664 |
acceptOnLeave: true |
|
4665 |
acceptOnReturn: true |
|
4666 |
acceptOnTab: true |
|
4667 |
acceptOnLostFocus: true |
|
4668 |
acceptChannel: acceptChannel |
|
4669 |
modifiedChannel: modifiedChannel |
|
4670 |
acceptOnPointerLeave: true |
|
4671 |
) |
|
2297 | 4672 |
(ActionButtonSpec |
4673 |
label: 'browseActionImage' |
|
4674 |
name: 'Button1' |
|
4675 |
layout: (LayoutFrame -25 1 71 0 -5 1 93 0) |
|
4676 |
hasCharacterOrientedLabel: false |
|
4677 |
translateLabel: true |
|
4678 |
resizeForLabel: true |
|
4679 |
tabable: true |
|
4680 |
model: doBrowseActionMethod |
|
2810 | 4681 |
activeHelpKey: browseMethod |
2297 | 4682 |
) |
2189 | 4683 |
(LabelSpec |
4684 |
label: 'Argument:' |
|
4685 |
name: 'argumentLabel' |
|
4686 |
layout: (AlignmentOrigin 107 0 107 0 1 0.5) |
|
4687 |
activeHelpKey: basicsArgument |
|
4688 |
translateLabel: true |
|
4689 |
resizeForLabel: true |
|
4690 |
adjust: right |
|
4691 |
) |
|
4692 |
(InputFieldSpec |
|
4693 |
name: 'argumentField' |
|
4694 |
layout: (LayoutFrame 110 0 96 0 -5 1.0 118 0) |
|
4695 |
activeHelpKey: basicsArgument |
|
4696 |
tabable: true |
|
4697 |
model: argument |
|
4698 |
group: inputGroup |
|
4699 |
type: smalltalkObjectOrNil |
|
4700 |
immediateAccept: false |
|
4701 |
acceptOnReturn: true |
|
4702 |
acceptOnTab: true |
|
4703 |
acceptOnLostFocus: false |
|
4704 |
acceptChannel: acceptChannel |
|
4705 |
modifiedChannel: modifiedChannel |
|
4706 |
acceptOnPointerLeave: false |
|
4707 |
) |
|
4708 |
(LabelSpec |
|
4709 |
label: 'Indication:' |
|
4710 |
name: 'indicationLabel' |
|
4711 |
layout: (AlignmentOrigin 107 0 138 0 1 0.5) |
|
4712 |
activeHelpKey: basicsIndication |
|
4713 |
translateLabel: true |
|
4714 |
resizeForLabel: true |
|
4715 |
adjust: right |
|
4716 |
) |
|
4717 |
(InputFieldSpec |
|
4718 |
name: 'indicationField' |
|
4719 |
layout: (LayoutFrame 110 0 127 0 -5 1.0 149 0) |
|
4720 |
activeHelpKey: basicsIndication |
|
4721 |
enableChannel: indicationEnabled |
|
4722 |
tabable: true |
|
4723 |
model: indication |
|
4724 |
group: inputGroup |
|
4725 |
type: symbolOrNil |
|
4726 |
immediateAccept: true |
|
4727 |
acceptOnReturn: false |
|
4728 |
acceptOnTab: false |
|
4729 |
acceptOnLostFocus: false |
|
4730 |
modifiedChannel: modifiedChannel |
|
4731 |
acceptOnPointerLeave: false |
|
4732 |
) |
|
4733 |
(LabelSpec |
|
4734 |
label: 'Choice:' |
|
4735 |
name: 'choiceLabel' |
|
4736 |
layout: (AlignmentOrigin 107 0 163 0 1 0.5) |
|
4737 |
activeHelpKey: basicsChoice |
|
4738 |
translateLabel: true |
|
4739 |
resizeForLabel: true |
|
4740 |
adjust: right |
|
4741 |
) |
|
4742 |
(InputFieldSpec |
|
4743 |
name: 'choiceField' |
|
4744 |
layout: (LayoutFrame 110 0 152 0 -5 1.0 174 0) |
|
4745 |
activeHelpKey: basicsChoice |
|
4746 |
enableChannel: choiceEnabled |
|
4747 |
tabable: true |
|
4748 |
model: choice |
|
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 |
(LabelSpec |
|
4759 |
label: 'Value:' |
|
4760 |
name: 'choiceValueLabel' |
|
4761 |
layout: (AlignmentOrigin 107 0 188 0 1 0.5) |
|
4762 |
activeHelpKey: basicsChoiceValue |
|
4763 |
translateLabel: true |
|
4764 |
resizeForLabel: true |
|
4765 |
adjust: right |
|
4766 |
) |
|
4767 |
(InputFieldSpec |
|
4768 |
name: 'choiceValueField' |
|
4769 |
layout: (LayoutFrame 110 0 177 0 -5 1.0 199 0) |
|
4770 |
activeHelpKey: basicsChoiceValue |
|
4771 |
enableChannel: choiceValueEnabled |
|
4772 |
tabable: true |
|
4773 |
model: choiceValue |
|
4774 |
group: inputGroup |
|
4775 |
type: smalltalkObjectOrNil |
|
4776 |
immediateAccept: false |
|
4777 |
acceptOnLeave: false |
|
4778 |
acceptOnReturn: true |
|
4779 |
acceptOnTab: true |
|
4780 |
acceptOnLostFocus: false |
|
4781 |
acceptChannel: acceptChannel |
|
4782 |
modifiedChannel: modifiedChannel |
|
4783 |
acceptOnPointerLeave: false |
|
4784 |
) |
|
4785 |
(CheckBoxSpec |
|
4786 |
label: 'Translate Label' |
|
4787 |
name: 'translateLabelCheckBox' |
|
4788 |
layout: (AlignmentOrigin 7 0 213 0 0 0) |
|
4789 |
activeHelpKey: basicsTranslateLabel |
|
4790 |
tabable: true |
|
4791 |
model: translateLabel |
|
4792 |
translateLabel: true |
|
4793 |
) |
|
4794 |
(CheckBoxSpec |
|
4795 |
label: 'Is Button' |
|
4796 |
name: 'isButtonCheckBox' |
|
4797 |
layout: (AlignmentOrigin 7 0 238 0 0 0) |
|
4798 |
activeHelpKey: basicsIsButton |
|
4799 |
tabable: true |
|
4800 |
model: isButton |
|
4801 |
translateLabel: true |
|
4802 |
) |
|
4803 |
(CheckBoxSpec |
|
4804 |
label: 'Hide Menu after Activation' |
|
4805 |
name: 'hideMenuOnActivated' |
|
4806 |
layout: (AlignmentOrigin 7 0 263 0 0 0) |
|
4807 |
activeHelpKey: hideMenuOnActivated |
|
4808 |
tabable: true |
|
4809 |
model: hideMenuOnActivated |
|
4810 |
translateLabel: true |
|
4811 |
) |
|
4812 |
(CheckBoxSpec |
|
4813 |
label: 'BusyCursor while Active' |
|
4814 |
name: 'showBusyCursorWhilePerforming' |
|
4815 |
layout: (AlignmentOrigin 7 0 288 0 0 0) |
|
4816 |
activeHelpKey: showBusyCursorWhilePerforming |
|
4817 |
tabable: true |
|
4818 |
model: showBusyCursorWhilePerforming |
|
4819 |
translateLabel: true |
|
4820 |
) |
|
4821 |
(CheckBoxSpec |
|
4822 |
label: 'Trigger On Down' |
|
4823 |
name: 'triggerOnDown' |
|
4824 |
layout: (AlignmentOrigin 25 0.5 238 0 0 0) |
|
4825 |
activeHelpKey: triggerOnDown |
|
4826 |
enableChannel: hasNoDelayedMenuValue |
|
4827 |
tabable: true |
|
4828 |
model: triggerOnDown |
|
4829 |
translateLabel: true |
|
4830 |
) |
|
4831 |
(CheckBoxSpec |
|
4832 |
label: 'Send To Originating Widget' |
|
4833 |
name: 'sendToOriginator' |
|
4834 |
layout: (AlignmentOrigin 7 0 313 0 0 0) |
|
4835 |
activeHelpKey: sendToOriginator |
|
4836 |
enableChannel: hasItemValue |
|
4837 |
tabable: true |
|
4838 |
model: sendToOriginator |
|
4839 |
translateLabel: true |
|
4840 |
) |
|
4841 |
) |
|
2297 | 4842 |
|
2189 | 4843 |
) |
1606 | 4844 |
) |
2810 | 4845 |
|
4846 |
"Modified: / 21-10-2010 / 14:14:49 / cg" |
|
199 | 4847 |
! ! |
4848 |
||
1725 | 4849 |
!MenuEditor::ActionItem class methodsFor:'interface-editor'! |
4850 |
||
4851 |
addBindingsTo:aspects for:aMenuEditor |
|
4852 |
"add additional bindings to the aspects |
|
4853 |
" |
|
2341 | 4854 |
aspects |
4855 |
at:#indicationEnabled |
|
4856 |
ifAbsentPut:[ BlockValue with:[:a | a size == 0 ] argument:(aspects at:#choice)]. |
|
4857 |
||
4858 |
aspects |
|
4859 |
at:#choiceEnabled |
|
4860 |
ifAbsentPut:[ BlockValue with:[:a | a size == 0 ] argument:(aspects at:#indication)]. |
|
4861 |
||
4862 |
aspects |
|
4863 |
at:#choiceValueEnabled |
|
4864 |
ifAbsentPut:[ BlockValue with:[:a | a size ~~ 0 ] argument:(aspects at:#choice)]. |
|
4865 |
||
4866 |
aspects |
|
4867 |
at:#hasNoDelayedMenuValue |
|
4868 |
ifAbsentPut:[true asValue]. |
|
1725 | 4869 |
! ! |
4870 |
||
1631 | 4871 |
!MenuEditor::ActionItem methodsFor:'accessing'! |
1606 | 4872 |
|
4873 |
menuItem |
|
4874 |
|item| |
|
4875 |
||
4876 |
item := super menuItem. |
|
4877 |
self hasDelayedMenu ifTrue:[ |
|
2188 | 4878 |
children first setDelayedAttributesTo:item. |
4879 |
||
4880 |
menuItem value isNil ifTrue:[ |
|
4881 |
menuItem value:#unspecified |
|
4882 |
] |
|
199 | 4883 |
]. |
1606 | 4884 |
^ item |
199 | 4885 |
! |
4886 |
||
213 | 4887 |
menuItem:anItem |
1606 | 4888 |
|submenu item| |
4889 |
||
4890 |
super menuItem:anItem. |
|
4891 |
submenu := anItem submenu. |
|
4892 |
||
4893 |
submenu notNil ifTrue:[ |
|
2188 | 4894 |
item := MenuEditor::RegularMenuItem new |
1606 | 4895 |
] ifFalse:[ |
2188 | 4896 |
anItem submenuChannel isNil ifTrue:[ |
4897 |
^ self |
|
4898 |
]. |
|
4899 |
item := MenuEditor::LinkedMenuItem new |
|
1606 | 4900 |
]. |
4901 |
item getDelayedAttributesFrom:anItem. |
|
4902 |
self add:item. |
|
199 | 4903 |
! |
4904 |
||
1606 | 4905 |
slices |
4906 |
^ #( |
|
4907 |
(Basics basicsEditSpec ) |
|
4908 |
(Details detailsEditSpec) |
|
4909 |
(Image image ) |
|
4910 |
(Help help) |
|
4911 |
) |
|
199 | 4912 |
! ! |
4913 |
||
1631 | 4914 |
!MenuEditor::ActionItem methodsFor:'adding & removing'! |
1606 | 4915 |
|
2188 | 4916 |
add:anItem |
1606 | 4917 |
"add an item; test whether the item is a delayed menu and |
2075 | 4918 |
not already a delayed menu exists." |
2188 | 4919 |
|
2075 | 4920 |
(anItem isKindOfMenu and:[ self canAddDelayedMenu ]) ifFalse:[ |
2188 | 4921 |
^ nil |
853 | 4922 |
]. |
2188 | 4923 |
|
1606 | 4924 |
menuItem triggerOnDown:false. |
2075 | 4925 |
anItem argument:(menuItem argument). |
1606 | 4926 |
isExpanded := false. |
4927 |
anItem parent:self. |
|
4928 |
children := Array with:anItem. |
|
4929 |
self expand. |
|
2075 | 4930 |
^ anItem |
4931 |
||
4932 |
"Modified: / 05-09-2006 / 17:49:57 / cg" |
|
199 | 4933 |
! ! |
4934 |
||
1631 | 4935 |
!MenuEditor::ActionItem methodsFor:'aspects'! |
1606 | 4936 |
|
4937 |
aspectAt:aKey put:aValue |
|
2075 | 4938 |
"set a specific aspect named aKey to the aValue" |
4939 |
||
1606 | 4940 |
aKey == #argument ifTrue:[ |
2189 | 4941 |
self hasDelayedMenu ifTrue:[ |
4942 |
children first argument:aValue |
|
4943 |
]. |
|
4944 |
menuItem argument:aValue. |
|
4945 |
^ self |
|
1606 | 4946 |
]. |
1778
32befdc61270
support ignoreShortcutKeys and ignoreMnemonicKeys in Editor
ca
parents:
1775
diff
changeset
|
4947 |
|
1623 | 4948 |
aKey == #triggerOnDown ifTrue:[ |
2189 | 4949 |
|triggerOnDown| |
4950 |
||
4951 |
self hasDelayedMenu ifTrue:[ |
|
4952 |
triggerOnDown := false |
|
4953 |
] ifFalse:[ |
|
4954 |
triggerOnDown := aValue |
|
4955 |
]. |
|
4956 |
menuItem triggerOnDown:triggerOnDown. |
|
4957 |
^ self. |
|
1623 | 4958 |
]. |
1606 | 4959 |
super aspectAt:aKey put:aValue. |
2055 | 4960 |
|
2075 | 4961 |
"Modified: / 05-09-2006 / 17:47:24 / cg" |
1606 | 4962 |
! |
4963 |
||
4964 |
toAspects:aspects |
|
4965 |
"write values to aspects |
|
4966 |
" |
|
1623 | 4967 |
|hasDelayedMenu| |
4968 |
||
1606 | 4969 |
super toAspects:aspects. |
4970 |
||
1623 | 4971 |
hasDelayedMenu := self hasDelayedMenu. |
4972 |
(aspects at:#hasNoDelayedMenuValue) value:(hasDelayedMenu not). |
|
4973 |
||
4974 |
hasDelayedMenu ifTrue:[ |
|
2188 | 4975 |
(aspects at:#triggerOnDown) value:false |
1623 | 4976 |
]. |
356 | 4977 |
! ! |
4978 |
||
1631 | 4979 |
!MenuEditor::ActionItem methodsFor:'displaying'! |
1606 | 4980 |
|
4981 |
icon |
|
4982 |
^ self class iconItem |
|
4983 |
! ! |
|
4984 |
||
1631 | 4985 |
!MenuEditor::ActionItem methodsFor:'initialization'! |
199 | 4986 |
|
4987 |
initialize |
|
4988 |
super initialize. |
|
1606 | 4989 |
isExpanded := true. |
4990 |
! ! |
|
4991 |
||
1631 | 4992 |
!MenuEditor::ActionItem methodsFor:'queries'! |
1606 | 4993 |
|
4994 |
canCollapse |
|
4995 |
^ false |
|
4996 |
! |
|
4997 |
||
4998 |
hasDelayedMenu |
|
4999 |
"returns true if a delayed menu exists |
|
5000 |
" |
|
5001 |
^ children size ~~ 0 |
|
5002 |
! |
|
5003 |
||
5004 |
hasIndicator |
|
5005 |
^ false |
|
5006 |
! |
|
5007 |
||
5008 |
isAction |
|
5009 |
^ true |
|
5010 |
! ! |
|
5011 |
||
1660 | 5012 |
!MenuEditor::ActionItem methodsFor:'queries-operation'! |
1606 | 5013 |
|
5014 |
canAddDelayedMenu |
|
1623 | 5015 |
"returns true if a delayed menu can be added |
1606 | 5016 |
" |
1623 | 5017 |
^ self hasDelayedMenu not |
1606 | 5018 |
! ! |
5019 |
||
1631 | 5020 |
!MenuEditor::LinkedMenuItem class methodsFor:'defaults'! |
1606 | 5021 |
|
5022 |
defaultLabel |
|
5023 |
^ 'Linked Menu' |
|
199 | 5024 |
! ! |
5025 |
||
1668 | 5026 |
!MenuEditor::LinkedMenuItem class methodsFor:'interface specs'! |
1606 | 5027 |
|
5028 |
basicsEditSpec |
|
5029 |
"This resource specification was automatically generated |
|
5030 |
by the UIPainter of ST/X." |
|
5031 |
||
5032 |
"Do not manually edit this!! If it is corrupted, |
|
5033 |
the UIPainter may not be able to read the specification." |
|
5034 |
||
5035 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5036 |
UIPainter new openOnClass:MenuEditor::LinkedMenuItem andSelector:#basicsEditSpec |
1606 | 5037 |
" |
5038 |
||
5039 |
<resource: #canvas> |
|
5040 |
||
2188 | 5041 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5042 |
#(FullSpec |
2189 | 5043 |
name: basicsEditSpec |
5044 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5045 |
(WindowSpec |
2189 | 5046 |
label: 'basicsEditSpec' |
5047 |
name: 'basicsEditSpec' |
|
5048 |
min: (Point 10 10) |
|
5049 |
bounds: (Rectangle 0 0 340 340) |
|
5050 |
) |
|
5051 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5052 |
(SpecCollection |
2189 | 5053 |
collection: ( |
5054 |
(LabelSpec |
|
5055 |
label: 'Name Key:' |
|
5056 |
name: 'nameKeyLabel' |
|
5057 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
5058 |
activeHelpKey: basicsKey |
|
5059 |
visibilityChannel: notDelayedMenu |
|
5060 |
translateLabel: true |
|
5061 |
resizeForLabel: true |
|
5062 |
adjust: right |
|
5063 |
) |
|
5064 |
(InputFieldSpec |
|
5065 |
name: 'nameKeyField' |
|
5066 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5067 |
activeHelpKey: basicsKey |
|
5068 |
visibilityChannel: notDelayedMenu |
|
5069 |
tabable: true |
|
5070 |
model: nameKey |
|
5071 |
group: inputGroup |
|
5072 |
type: symbolOrNil |
|
5073 |
immediateAccept: false |
|
5074 |
acceptOnLeave: false |
|
5075 |
acceptOnReturn: true |
|
5076 |
acceptOnTab: true |
|
5077 |
acceptOnLostFocus: false |
|
5078 |
acceptChannel: acceptChannel |
|
5079 |
modifiedChannel: modifiedChannel |
|
5080 |
acceptOnPointerLeave: false |
|
5081 |
) |
|
5082 |
(LabelSpec |
|
5083 |
label: 'Label:' |
|
5084 |
name: 'labelLabel' |
|
5085 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
5086 |
activeHelpKey: basicsLabel |
|
5087 |
visibilityChannel: notDelayedMenu |
|
5088 |
translateLabel: true |
|
5089 |
resizeForLabel: true |
|
5090 |
adjust: right |
|
5091 |
) |
|
5092 |
(InputFieldSpec |
|
5093 |
name: 'labelField' |
|
5094 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
5095 |
activeHelpKey: basicsLabel |
|
5096 |
visibilityChannel: notDelayedMenu |
|
5097 |
tabable: true |
|
5098 |
model: rawLabel |
|
5099 |
group: inputGroup |
|
5100 |
immediateAccept: false |
|
5101 |
acceptOnReturn: true |
|
5102 |
acceptOnTab: true |
|
5103 |
acceptOnLostFocus: false |
|
5104 |
acceptChannel: acceptChannel |
|
5105 |
modifiedChannel: modifiedChannel |
|
5106 |
acceptOnPointerLeave: false |
|
5107 |
) |
|
5108 |
(LabelSpec |
|
5109 |
label: 'Menu:' |
|
5110 |
name: 'menuLabel' |
|
5111 |
layout: (AlignmentOrigin 107 0 90 0 1 0.5) |
|
5112 |
activeHelpKey: basicsLabel |
|
5113 |
translateLabel: true |
|
5114 |
resizeForLabel: true |
|
5115 |
adjust: right |
|
5116 |
) |
|
5117 |
(InputFieldSpec |
|
5118 |
name: 'menuField' |
|
5119 |
layout: (LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
5120 |
activeHelpKey: basicsMenu |
|
5121 |
tabable: true |
|
5122 |
model: submenuChannel |
|
5123 |
group: inputGroup |
|
5124 |
type: symbolOrNil |
|
5125 |
immediateAccept: false |
|
5126 |
acceptOnReturn: true |
|
5127 |
acceptOnTab: true |
|
5128 |
acceptOnLostFocus: false |
|
5129 |
acceptChannel: acceptChannel |
|
5130 |
modifiedChannel: modifiedChannel |
|
5131 |
acceptOnPointerLeave: false |
|
5132 |
) |
|
5133 |
(LabelSpec |
|
5134 |
label: 'Argument:' |
|
5135 |
name: 'argumentLabel' |
|
5136 |
layout: (AlignmentOrigin 107 0 115 0 1 0.5) |
|
5137 |
activeHelpKey: basicsLabel |
|
5138 |
translateLabel: true |
|
5139 |
resizeForLabel: true |
|
5140 |
adjust: right |
|
5141 |
) |
|
5142 |
(InputFieldSpec |
|
5143 |
name: 'argumentField' |
|
5144 |
layout: (LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
5145 |
activeHelpKey: basicsMenuArgument |
|
5146 |
enableChannel: notDelayedMenu |
|
5147 |
tabable: true |
|
5148 |
model: argument |
|
5149 |
group: inputGroup |
|
5150 |
type: smalltalkObjectOrNil |
|
5151 |
immediateAccept: false |
|
5152 |
acceptOnReturn: true |
|
5153 |
acceptOnTab: true |
|
5154 |
acceptOnLostFocus: false |
|
5155 |
acceptChannel: acceptChannel |
|
5156 |
modifiedChannel: modifiedChannel |
|
5157 |
acceptOnPointerLeave: false |
|
5158 |
) |
|
5159 |
(CheckBoxSpec |
|
5160 |
label: 'Translate Label' |
|
5161 |
name: 'translateLabelCheckBox' |
|
5162 |
layout: (Point 20 213) |
|
5163 |
activeHelpKey: basicsTranslateLabel |
|
5164 |
visibilityChannel: notDelayedMenu |
|
5165 |
tabable: true |
|
5166 |
model: translateLabel |
|
5167 |
translateLabel: true |
|
5168 |
) |
|
5169 |
(CheckBoxSpec |
|
5170 |
label: 'Is Button' |
|
5171 |
name: 'isButtonCheckBox' |
|
5172 |
layout: (Point 20 238) |
|
5173 |
activeHelpKey: basicsIsButton |
|
5174 |
visibilityChannel: notDelayedMenu |
|
5175 |
tabable: true |
|
5176 |
model: isButton |
|
5177 |
translateLabel: true |
|
5178 |
) |
|
5179 |
(CheckBoxSpec |
|
5180 |
label: 'Horizontal Layout' |
|
5181 |
name: 'horizontalLayout' |
|
5182 |
layout: (Point 20 263) |
|
5183 |
activeHelpKey: horizontalLayout |
|
5184 |
tabable: true |
|
5185 |
model: horizontalLayout |
|
5186 |
translateLabel: true |
|
5187 |
) |
|
5188 |
(CheckBoxSpec |
|
5189 |
label: 'Do not Destroy Linked Menu' |
|
5190 |
name: 'keepLinkedMenu' |
|
5191 |
layout: (Point 20 288) |
|
5192 |
activeHelpKey: keepLinkedMenu |
|
5193 |
tabable: true |
|
5194 |
model: keepLinkedMenu |
|
5195 |
translateLabel: true |
|
5196 |
) |
|
5197 |
) |
|
5198 |
||
5199 |
) |
|
1606 | 5200 |
) |
5201 |
! ! |
|
5202 |
||
1631 | 5203 |
!MenuEditor::LinkedMenuItem methodsFor:'accessing'! |
1606 | 5204 |
|
5205 |
argument:aValue |
|
5206 |
menuItem argument:aValue. |
|
5207 |
! |
|
5208 |
||
5209 |
menuItem |
|
5210 |
"returns self as a MenuItem |
|
5211 |
" |
|
5212 |
|item| |
|
5213 |
||
5214 |
item := super menuItem. |
|
5215 |
item submenuChannel:(self submenuChannel). |
|
5216 |
^ item |
|
5217 |
! |
|
5218 |
||
5219 |
slices |
|
5220 |
self isDelayedMenu ifTrue:[ |
|
2188 | 5221 |
^ #( |
5222 |
(Basics basicsEditSpec ) |
|
5223 |
) |
|
1389 | 5224 |
]. |
5225 |
||
1606 | 5226 |
^ #( |
2188 | 5227 |
(Basics basicsEditSpec ) |
5228 |
(Details detailsEditSpec) |
|
5229 |
(Image image ) |
|
5230 |
(Help help) |
|
1606 | 5231 |
) |
5232 |
! |
|
5233 |
||
5234 |
submenuChannel |
|
5235 |
^ menuItem submenuChannel ? #unspecified |
|
5236 |
! |
|
5237 |
||
5238 |
submenuChannel:aValue |
|
5239 |
menuItem submenuChannel:aValue. |
|
5240 |
! ! |
|
5241 |
||
1631 | 5242 |
!MenuEditor::LinkedMenuItem methodsFor:'aspects'! |
1606 | 5243 |
|
5244 |
aspectAt:aKey put:aValue |
|
2075 | 5245 |
"set a specific aspect named aKey to the aValue" |
5246 |
||
1606 | 5247 |
aKey == #submenuChannel ifTrue:[ ^ self submenuChannel:aValue ]. |
5248 |
super aspectAt:aKey put:aValue. |
|
2075 | 5249 |
|
5250 |
"Modified: / 05-09-2006 / 17:47:39 / cg" |
|
1606 | 5251 |
! |
5252 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5253 |
getDelayedAttributesFrom:anItem |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5254 |
|
1606 | 5255 |
menuItem rawLabel:'Delayed'. |
5256 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5257 |
menuItem submenuChannel:(self validateValue:(anItem submenuChannel)). |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5258 |
menuItem horizontalLayout:(self validateValue:(anItem horizontalLayout)). |
1881
dde52f4278c0
horizontalLayout flag bug fixed
Claus Gittinger <cg@exept.de>
parents:
1867
diff
changeset
|
5259 |
menuItem keepLinkedMenu:(self validateValue:(anItem keepLinkedMenu)). |
1389 | 5260 |
! |
5261 |
||
1606 | 5262 |
setDelayedAttributesTo:aMenuItem |
5263 |
aMenuItem submenuChannel:(self submenuChannel). |
|
5264 |
aMenuItem horizontalLayout:(menuItem horizontalLayout). |
|
5265 |
aMenuItem keepLinkedMenu:(menuItem keepLinkedMenu). |
|
5266 |
! ! |
|
5267 |
||
1631 | 5268 |
!MenuEditor::LinkedMenuItem methodsFor:'displaying'! |
1606 | 5269 |
|
5270 |
displayLabel |
|
5271 |
"returns the label dependent on is delayed or not |
|
5272 |
" |
|
5273 |
self isDelayedMenu ifTrue:[ ^ self submenuChannel ]. |
|
5274 |
^ menuItem rawLabel |
|
199 | 5275 |
! |
5276 |
||
1606 | 5277 |
icon |
5278 |
self isDelayedMenu ifTrue:[ ^ self class iconDelayedLinkedMenu ]. |
|
5279 |
^ self class iconLinkedMenu |
|
5280 |
! ! |
|
5281 |
||
1780
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5282 |
!MenuEditor::LinkedMenuItem methodsFor:'initialization'! |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5283 |
|
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5284 |
initialize |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5285 |
"setup default values on the item |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5286 |
" |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5287 |
super initialize. |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5288 |
|
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5289 |
"setting default values |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5290 |
" |
2334
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5291 |
"/ CG: Thu, 08 May 2008 11:16:54 GMT |
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5292 |
"/ I think having keepLinkedMenu true by default |
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5293 |
"/ will confuse newcomers (even me occasionally) |
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5294 |
"/ (will search, why the menu is not updated...) |
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5295 |
|
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5296 |
"/ menuItem keepLinkedMenu:true. |
dc1388cc7160
keepLinkedMenu is now FALSE by default.
Claus Gittinger <cg@exept.de>
parents:
2331
diff
changeset
|
5297 |
menuItem keepLinkedMenu:false. |
1780
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5298 |
! ! |
5f831e1fc839
set #keepLinkedMenu for linked menus on default to true (do not destroy)
ca
parents:
1778
diff
changeset
|
5299 |
|
1631 | 5300 |
!MenuEditor::LinkedMenuItem methodsFor:'queries'! |
1606 | 5301 |
|
5302 |
isKindOfMenu |
|
5303 |
^ true |
|
5304 |
! ! |
|
5305 |
||
1844 | 5306 |
!MenuEditor::MenuSliceItem class methodsFor:'defaults'! |
5307 |
||
5308 |
defaultLabel |
|
5309 |
^ 'Menu Slice' |
|
5310 |
! ! |
|
5311 |
||
5312 |
!MenuEditor::MenuSliceItem class methodsFor:'interface specs'! |
|
5313 |
||
5314 |
basicsEditSpec |
|
5315 |
"This resource specification was automatically generated |
|
5316 |
by the UIPainter of ST/X." |
|
5317 |
||
5318 |
"Do not manually edit this!! If it is corrupted, |
|
5319 |
the UIPainter may not be able to read the specification." |
|
5320 |
||
5321 |
" |
|
5322 |
UIPainter new openOnClass:MenuEditor::MenuSliceItem andSelector:#basicsEditSpec |
|
5323 |
" |
|
5324 |
||
5325 |
<resource: #canvas> |
|
5326 |
||
2188 | 5327 |
^ |
1844 | 5328 |
#(FullSpec |
2189 | 5329 |
name: basicsEditSpec |
5330 |
window: |
|
1844 | 5331 |
(WindowSpec |
2189 | 5332 |
label: 'basicsEditSpec' |
5333 |
name: 'basicsEditSpec' |
|
5334 |
min: (Point 10 10) |
|
5335 |
bounds: (Rectangle 0 0 344 146) |
|
5336 |
) |
|
5337 |
component: |
|
1844 | 5338 |
(SpecCollection |
2189 | 5339 |
collection: ( |
5340 |
(LabelSpec |
|
5341 |
label: 'Name Key:' |
|
5342 |
name: 'nameKeyLabel' |
|
5343 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
5344 |
activeHelpKey: basicsKey |
|
5345 |
visibilityChannel: notDelayedMenu |
|
5346 |
translateLabel: true |
|
5347 |
resizeForLabel: true |
|
5348 |
adjust: right |
|
5349 |
) |
|
5350 |
(InputFieldSpec |
|
5351 |
name: 'nameKeyField' |
|
5352 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5353 |
activeHelpKey: basicsKey |
|
5354 |
visibilityChannel: notDelayedMenu |
|
5355 |
tabable: true |
|
5356 |
model: nameKey |
|
5357 |
group: inputGroup |
|
5358 |
type: symbolOrNil |
|
5359 |
immediateAccept: false |
|
5360 |
acceptOnLeave: false |
|
5361 |
acceptOnReturn: true |
|
5362 |
acceptOnTab: true |
|
5363 |
acceptOnLostFocus: false |
|
5364 |
acceptChannel: acceptChannel |
|
5365 |
modifiedChannel: modifiedChannel |
|
5366 |
acceptOnPointerLeave: false |
|
5367 |
) |
|
5368 |
(LabelSpec |
|
5369 |
label: 'Label:' |
|
5370 |
name: 'labelLabel' |
|
5371 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
5372 |
activeHelpKey: basicsLabel |
|
5373 |
visibilityChannel: notDelayedMenu |
|
5374 |
translateLabel: true |
|
5375 |
resizeForLabel: true |
|
5376 |
adjust: right |
|
5377 |
) |
|
5378 |
(InputFieldSpec |
|
5379 |
name: 'labelField' |
|
5380 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
5381 |
activeHelpKey: basicsLabel |
|
5382 |
visibilityChannel: notDelayedMenu |
|
5383 |
tabable: true |
|
5384 |
model: rawLabel |
|
5385 |
group: inputGroup |
|
5386 |
immediateAccept: false |
|
5387 |
acceptOnReturn: true |
|
5388 |
acceptOnTab: true |
|
5389 |
acceptOnLostFocus: false |
|
5390 |
acceptChannel: acceptChannel |
|
5391 |
modifiedChannel: modifiedChannel |
|
5392 |
acceptOnPointerLeave: false |
|
5393 |
) |
|
5394 |
(LabelSpec |
|
5395 |
label: 'Menu:' |
|
5396 |
name: 'menuLabel' |
|
5397 |
layout: (AlignmentOrigin 107 0 90 0 1 0.5) |
|
5398 |
activeHelpKey: basicsLabel |
|
5399 |
translateLabel: true |
|
5400 |
resizeForLabel: true |
|
5401 |
adjust: right |
|
5402 |
) |
|
5403 |
(InputFieldSpec |
|
5404 |
name: 'menuField' |
|
5405 |
layout: (LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
5406 |
activeHelpKey: basicsMenu |
|
5407 |
tabable: true |
|
5408 |
model: submenuChannel |
|
5409 |
group: inputGroup |
|
5410 |
type: symbolOrNil |
|
5411 |
immediateAccept: false |
|
5412 |
acceptOnReturn: true |
|
5413 |
acceptOnTab: true |
|
5414 |
acceptOnLostFocus: false |
|
5415 |
acceptChannel: acceptChannel |
|
5416 |
modifiedChannel: modifiedChannel |
|
5417 |
acceptOnPointerLeave: false |
|
5418 |
) |
|
5419 |
(LabelSpec |
|
5420 |
label: 'Argument:' |
|
5421 |
name: 'argumentLabel' |
|
5422 |
layout: (AlignmentOrigin 107 0 115 0 1 0.5) |
|
5423 |
activeHelpKey: basicsLabel |
|
5424 |
translateLabel: true |
|
5425 |
resizeForLabel: true |
|
5426 |
adjust: right |
|
5427 |
) |
|
5428 |
(InputFieldSpec |
|
5429 |
name: 'argumentField' |
|
5430 |
layout: (LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
5431 |
activeHelpKey: basicsMenuArgument |
|
5432 |
enableChannel: notDelayedMenu |
|
5433 |
tabable: true |
|
5434 |
model: argument |
|
5435 |
group: inputGroup |
|
5436 |
type: smalltalkObjectOrNil |
|
5437 |
immediateAccept: false |
|
5438 |
acceptOnReturn: true |
|
5439 |
acceptOnTab: true |
|
5440 |
acceptOnLostFocus: false |
|
5441 |
acceptChannel: acceptChannel |
|
5442 |
modifiedChannel: modifiedChannel |
|
5443 |
acceptOnPointerLeave: false |
|
5444 |
) |
|
5445 |
) |
|
5446 |
||
5447 |
) |
|
1844 | 5448 |
) |
5449 |
! ! |
|
5450 |
||
5451 |
!MenuEditor::MenuSliceItem methodsFor:'accessing'! |
|
5452 |
||
5453 |
icon |
|
5454 |
^ self class iconSliceMenu |
|
5455 |
! |
|
5456 |
||
5457 |
menuItem |
|
5458 |
"returns self as a MenuItem |
|
5459 |
" |
|
5460 |
|item| |
|
5461 |
||
5462 |
item := super menuItem. |
|
5463 |
item submenuChannel:(self submenuChannel). |
|
5464 |
item isMenuSlice:true. |
|
5465 |
^ item |
|
5466 |
! |
|
5467 |
||
5468 |
slices |
|
5469 |
^ #( |
|
2188 | 5470 |
(Basics basicsEditSpec) |
1844 | 5471 |
) |
5472 |
! ! |
|
5473 |
||
5474 |
!MenuEditor::MenuSliceItem methodsFor:'aspects'! |
|
5475 |
||
5476 |
argument:aValue |
|
5477 |
menuItem argument:aValue. |
|
5478 |
! |
|
5479 |
||
5480 |
aspectAt:aKey put:aValue |
|
2075 | 5481 |
"set a specific aspect named aKey to the aValue" |
5482 |
||
1844 | 5483 |
aKey == #submenuChannel ifTrue:[ ^ self submenuChannel:aValue ]. |
5484 |
aKey == #isSliceMenu ifTrue:[ ^ self ]. |
|
5485 |
||
5486 |
super aspectAt:aKey put:aValue. |
|
2075 | 5487 |
|
5488 |
"Modified: / 05-09-2006 / 17:47:42 / cg" |
|
1844 | 5489 |
! |
5490 |
||
5491 |
submenuChannel |
|
5492 |
^ menuItem submenuChannel ? #unspecified |
|
5493 |
! |
|
5494 |
||
5495 |
submenuChannel:aValue |
|
5496 |
menuItem submenuChannel:aValue. |
|
5497 |
! ! |
|
5498 |
||
1633 | 5499 |
!MenuEditor::RegularMenuItem class methodsFor:'defaults'! |
1606 | 5500 |
|
5501 |
defaultDelayedLabel |
|
5502 |
^ 'delayed' |
|
199 | 5503 |
! |
5504 |
||
1606 | 5505 |
defaultLabel |
5506 |
^ 'Menu' |
|
5507 |
! ! |
|
5508 |
||
1633 | 5509 |
!MenuEditor::RegularMenuItem class methodsFor:'instance creation'! |
1606 | 5510 |
|
5511 |
menu:aMenu labeled:aString |
|
5512 |
|item| |
|
5513 |
||
5514 |
item := self new. |
|
5515 |
item menu:aMenu labeled:aString. |
|
1631 | 5516 |
^ item |
5517 |
! |
|
5518 |
||
5519 |
menu:aMenu labeled:aString translateLabel:translateLabel |
|
5520 |
|item| |
|
5521 |
||
5522 |
item := self new. |
|
5523 |
item menu:aMenu labeled:aString. |
|
5524 |
item translateLabel:translateLabel. |
|
5525 |
^ item |
|
1606 | 5526 |
! ! |
5527 |
||
1668 | 5528 |
!MenuEditor::RegularMenuItem class methodsFor:'interface specs'! |
1606 | 5529 |
|
5530 |
basicsEditSpec |
|
5531 |
"This resource specification was automatically generated |
|
5532 |
by the UIPainter of ST/X." |
|
5533 |
||
5534 |
"Do not manually edit this!! If it is corrupted, |
|
5535 |
the UIPainter may not be able to read the specification." |
|
5536 |
||
5537 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5538 |
UIPainter new openOnClass:MenuEditor::RegularMenuItem andSelector:#basicsEditSpec |
1606 | 5539 |
" |
5540 |
||
5541 |
<resource: #canvas> |
|
5542 |
||
2188 | 5543 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5544 |
#(FullSpec |
2188 | 5545 |
name: basicsEditSpec |
5546 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5547 |
(WindowSpec |
2188 | 5548 |
label: 'basicsEditSpec' |
5549 |
name: 'basicsEditSpec' |
|
5550 |
min: (Point 10 10) |
|
5551 |
bounds: (Rectangle 0 0 340 340) |
|
5552 |
) |
|
5553 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5554 |
(SpecCollection |
2188 | 5555 |
collection: ( |
5556 |
(LabelSpec |
|
5557 |
label: 'Name Key:' |
|
5558 |
name: 'nameKeyLabel' |
|
5559 |
layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
5560 |
activeHelpKey: basicsKey |
|
5561 |
visibilityChannel: notDelayedMenu |
|
5562 |
translateLabel: true |
|
5563 |
resizeForLabel: true |
|
5564 |
adjust: right |
|
5565 |
) |
|
5566 |
(InputFieldSpec |
|
5567 |
name: 'nameKeyField' |
|
5568 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5569 |
activeHelpKey: basicsKey |
|
5570 |
visibilityChannel: notDelayedMenu |
|
5571 |
tabable: true |
|
5572 |
model: nameKey |
|
5573 |
group: inputGroup |
|
5574 |
type: symbolOrNil |
|
5575 |
immediateAccept: false |
|
5576 |
acceptOnLeave: false |
|
5577 |
acceptOnReturn: true |
|
5578 |
acceptOnTab: true |
|
5579 |
acceptOnLostFocus: false |
|
5580 |
acceptChannel: acceptChannel |
|
5581 |
modifiedChannel: modifiedChannel |
|
5582 |
acceptOnPointerLeave: false |
|
5583 |
) |
|
5584 |
(LabelSpec |
|
5585 |
label: 'Label:' |
|
5586 |
name: 'labelLabel' |
|
5587 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
5588 |
activeHelpKey: basicsLabel |
|
5589 |
visibilityChannel: notDelayedMenu |
|
5590 |
translateLabel: true |
|
5591 |
resizeForLabel: true |
|
5592 |
adjust: right |
|
5593 |
) |
|
5594 |
(InputFieldSpec |
|
5595 |
name: 'labelField' |
|
5596 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
5597 |
activeHelpKey: basicsLabel |
|
5598 |
visibilityChannel: notDelayedMenu |
|
5599 |
tabable: true |
|
5600 |
model: rawLabel |
|
5601 |
group: inputGroup |
|
5602 |
immediateAccept: false |
|
5603 |
acceptOnReturn: true |
|
5604 |
acceptOnTab: true |
|
5605 |
acceptOnLostFocus: false |
|
5606 |
acceptChannel: acceptChannel |
|
5607 |
modifiedChannel: modifiedChannel |
|
5608 |
acceptOnPointerLeave: false |
|
5609 |
) |
|
5610 |
(CheckBoxSpec |
|
5611 |
label: 'Translate Label' |
|
5612 |
name: 'translateLabelCheckBox' |
|
5613 |
layout: (Point 20 213) |
|
5614 |
activeHelpKey: basicsTranslateLabel |
|
5615 |
visibilityChannel: notDelayedMenu |
|
5616 |
tabable: true |
|
5617 |
model: translateLabel |
|
5618 |
translateLabel: true |
|
5619 |
) |
|
5620 |
(CheckBoxSpec |
|
5621 |
label: 'Is Button' |
|
5622 |
name: 'isButtonCheckBox' |
|
5623 |
layout: (Point 20 238) |
|
5624 |
activeHelpKey: basicsIsButton |
|
5625 |
visibilityChannel: notDelayedMenu |
|
5626 |
tabable: true |
|
5627 |
model: isButton |
|
5628 |
translateLabel: true |
|
5629 |
) |
|
5630 |
(CheckBoxSpec |
|
5631 |
label: 'Horizontal Layout' |
|
5632 |
name: 'horizontalLayout' |
|
5633 |
layout: (Point 20 263) |
|
5634 |
activeHelpKey: horizontalLayout |
|
5635 |
tabable: true |
|
5636 |
model: horizontalLayout |
|
5637 |
translateLabel: true |
|
5638 |
) |
|
5639 |
) |
|
5640 |
||
5641 |
) |
|
1606 | 5642 |
) |
5643 |
! ! |
|
5644 |
||
1633 | 5645 |
!MenuEditor::RegularMenuItem methodsFor:'accessing'! |
1606 | 5646 |
|
5647 |
argument:aValue |
|
5648 |
"/ ignorred. |
|
218 | 5649 |
! |
5650 |
||
1606 | 5651 |
menu:aMenu labeled:aString |
5652 |
|expanded item menu| |
|
5653 |
||
5654 |
self criticalDo:[ |
|
2448 | 5655 |
self isRootItem ifTrue:[ expanded := true ] |
5656 |
ifFalse:[ expanded := isExpanded ]. |
|
5657 |
||
5658 |
self removeAll. |
|
5659 |
self rawLabel:aString. |
|
5660 |
||
5661 |
menu := aMenu value. |
|
5662 |
||
5663 |
(menu isNil or:[menu isString]) ifTrue:[ |
|
5664 |
menu := nil |
|
5665 |
] ifFalse:[ |
|
5666 |
aMenu isCollection ifTrue:[ menu := Menu decodeFromLiteralArray:aMenu ] |
|
5667 |
ifFalse:[ menu := aMenu ]. |
|
5668 |
||
5669 |
menu hasItems ifFalse:[ |
|
5670 |
menu := nil |
|
5671 |
]. |
|
5672 |
]. |
|
2862 | 5673 |
menu notNil ifTrue:[ |
2448 | 5674 |
isExpanded := false. "/ discard change notifications |
5675 |
children := OrderedCollection new. |
|
5676 |
||
5677 |
menu itemsDo:[:el| |
|
5678 |
item := self class menuItem:el. |
|
5679 |
item parent:self. |
|
5680 |
children add:item. |
|
5681 |
]. |
|
5682 |
expanded ifTrue:[ self expand ]. |
|
5683 |
]. |
|
5684 |
isExpanded := expanded. |
|
2188 | 5685 |
]. |
1606 | 5686 |
self changed |
2168 | 5687 |
|
2862 | 5688 |
"Modified: / 29-11-2011 / 11:28:33 / cg" |
199 | 5689 |
! |
5690 |
||
1606 | 5691 |
menuItem |
5692 |
"returns self as a MenuItem |
|
5693 |
" |
|
5694 |
|item| |
|
5695 |
||
5696 |
item := super menuItem. |
|
5697 |
item submenu:(self submenu). |
|
5698 |
^ item |
|
199 | 5699 |
! |
5700 |
||
1606 | 5701 |
menuItem:anItem |
5702 |
||
5703 |
super menuItem:anItem. |
|
5704 |
self menu:(anItem submenu) labeled:nil. |
|
5705 |
! |
|
5706 |
||
5707 |
slices |
|
5708 |
self isDelayedMenu ifTrue:[ |
|
2188 | 5709 |
^ #( |
5710 |
(Basics basicsEditSpec ) |
|
5711 |
) |
|
1606 | 5712 |
]. |
5713 |
||
5714 |
^ #( |
|
2188 | 5715 |
(Basics basicsEditSpec ) |
5716 |
(Details detailsEditSpec) |
|
5717 |
(Image image ) |
|
5718 |
(Help help) |
|
1606 | 5719 |
) |
5720 |
! |
|
5721 |
||
5722 |
submenu |
|
5723 |
|menu| |
|
5724 |
||
5725 |
menu := Menu new. |
|
5726 |
||
5727 |
children size ~~ 0 ifTrue:[ |
|
5728 |
children do:[:el| menu addItem:(el menuItem) ]. |
|
5729 |
]. |
|
5730 |
^ menu |
|
5731 |
! ! |
|
5732 |
||
1633 | 5733 |
!MenuEditor::RegularMenuItem methodsFor:'aspects'! |
1606 | 5734 |
|
5735 |
getDelayedAttributesFrom:aMenuItem |
|
5736 |
||
1653
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5737 |
|menu| |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5738 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5739 |
menu := self validateValue:(aMenuItem submenu value). |
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5740 |
|
1798c7bcb787
test whether attributes from MenuItem are not a block or model
ca
parents:
1645
diff
changeset
|
5741 |
self menu:menu labeled:nil. |
1606 | 5742 |
menuItem horizontalLayout:(aMenuItem horizontalLayout). |
5743 |
! |
|
5744 |
||
5745 |
setDelayedAttributesTo:aMenuItem |
|
5746 |
aMenuItem submenu:(self submenu). |
|
5747 |
aMenuItem horizontalLayout:(menuItem horizontalLayout). |
|
5748 |
! ! |
|
5749 |
||
1633 | 5750 |
!MenuEditor::RegularMenuItem methodsFor:'displaying'! |
1606 | 5751 |
|
5752 |
displayLabel |
|
5753 |
"returns the label dependent on is delayed or not |
|
5754 |
" |
|
5755 |
self isDelayedMenu ifTrue:[ ^ self class defaultDelayedLabel ]. |
|
5756 |
^ menuItem rawLabel |
|
5757 |
! |
|
5758 |
||
5759 |
icon |
|
5760 |
self isDelayedMenu ifTrue:[ ^ self class iconDelayedMenu ]. |
|
5761 |
^ self class iconMenu |
|
5762 |
! ! |
|
5763 |
||
1633 | 5764 |
!MenuEditor::RegularMenuItem methodsFor:'queries'! |
1606 | 5765 |
|
5766 |
canAddChildren |
|
5767 |
"children can be added |
|
5768 |
" |
|
5769 |
^ true |
|
5770 |
! |
|
5771 |
||
5772 |
canExpand |
|
5773 |
"returns true if the item is expandable |
|
5774 |
" |
|
5775 |
^ isExpanded == false |
|
5776 |
! |
|
5777 |
||
5778 |
hasIndicator |
|
5779 |
^ true |
|
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
5780 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
5781 |
|
1606 | 5782 |
isKindOfMenu |
5783 |
^ true |
|
5784 |
! ! |
|
5785 |
||
1631 | 5786 |
!MenuEditor::RootItem class methodsFor:'defaults'! |
5787 |
||
5788 |
defaultLabel |
|
5789 |
^ MenuEditor resourceType |
|
5790 |
! ! |
|
5791 |
||
1668 | 5792 |
!MenuEditor::RootItem class methodsFor:'interface specs'! |
1631 | 5793 |
|
5794 |
basicsEditSpec |
|
5795 |
"This resource specification was automatically generated |
|
5796 |
by the UIPainter of ST/X." |
|
5797 |
||
5798 |
"Do not manually edit this!! If it is corrupted, |
|
5799 |
the UIPainter may not be able to read the specification." |
|
5800 |
||
5801 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5802 |
UIPainter new openOnClass:MenuEditor::RootItem andSelector:#basicsEditSpec |
1631 | 5803 |
" |
5804 |
||
5805 |
<resource: #canvas> |
|
5806 |
||
2188 | 5807 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5808 |
#(FullSpec |
2188 | 5809 |
name: basicsEditSpec |
5810 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5811 |
(WindowSpec |
2188 | 5812 |
label: 'basicsEditSpec' |
5813 |
name: 'basicsEditSpec' |
|
5814 |
min: (Point 10 10) |
|
5815 |
bounds: (Rectangle 0 0 260 46) |
|
5816 |
) |
|
5817 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5818 |
(SpecCollection |
2188 | 5819 |
collection: ( |
5820 |
(LabelSpec |
|
5821 |
label: 'Selector:' |
|
5822 |
name: 'selectorLabel' |
|
5823 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
5824 |
activeHelpKey: basicsSelector |
|
5825 |
translateLabel: true |
|
5826 |
resizeForLabel: true |
|
5827 |
adjust: right |
|
5828 |
) |
|
5829 |
(InputFieldSpec |
|
5830 |
name: 'selectorField' |
|
5831 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
5832 |
activeHelpKey: basicsSelector |
|
5833 |
tabable: true |
|
5834 |
model: rawLabel |
|
5835 |
group: inputGroup |
|
5836 |
type: string |
|
5837 |
immediateAccept: false |
|
5838 |
acceptOnReturn: true |
|
5839 |
acceptOnTab: true |
|
5840 |
acceptChannel: acceptChannel |
|
5841 |
modifiedChannel: modifiedChannel |
|
5842 |
acceptOnPointerLeave: false |
|
5843 |
) |
|
5844 |
) |
|
5845 |
||
5846 |
) |
|
1631 | 5847 |
) |
5848 |
! ! |
|
5849 |
||
1725 | 5850 |
!MenuEditor::RootItem class methodsFor:'interface-editor'! |
5851 |
||
5852 |
addBindingsTo:aspects for:aMenuEditor |
|
5853 |
"add additional bindings to the aspects |
|
5854 |
" |
|
5855 |
! ! |
|
5856 |
||
1631 | 5857 |
!MenuEditor::RootItem methodsFor:'accessing'! |
5858 |
||
5859 |
menuItem:aMenuItem |
|
5860 |
"rebuild self from a MenuItem |
|
5861 |
" |
|
5862 |
|submenu selector| |
|
5863 |
||
5864 |
aMenuItem notNil ifTrue:[ |
|
5865 |
submenu := aMenuItem submenu. |
|
5866 |
selector := aMenuItem rawLabel. |
|
5867 |
] ifFalse:[ |
|
5868 |
selector := submenu := nil. |
|
5869 |
]. |
|
5870 |
self menu:submenu labeled:selector. |
|
5871 |
! |
|
5872 |
||
5873 |
rawLabel:aValue |
|
5874 |
"set the label assigned to the item |
|
5875 |
" |
|
5876 |
|value| |
|
5877 |
||
5878 |
aValue isString ifTrue:[ |
|
2188 | 5879 |
value := aValue withoutSeparators. |
5880 |
||
5881 |
(value notEmpty and:[value first isLetter]) ifTrue:[ |
|
5882 |
menuItem rawLabel:(value asSymbol) |
|
5883 |
]. |
|
1631 | 5884 |
]. |
5885 |
! |
|
5886 |
||
5887 |
slices |
|
5888 |
^ #( |
|
5889 |
(Basics basicsEditSpec) |
|
5890 |
) |
|
5891 |
! ! |
|
5892 |
||
5893 |
!MenuEditor::RootItem methodsFor:'adding & removing'! |
|
5894 |
||
5895 |
remove |
|
5896 |
"cannot remove the root item; delete all my children |
|
5897 |
" |
|
5898 |
self removeAll. |
|
5899 |
! ! |
|
5900 |
||
5901 |
!MenuEditor::RootItem methodsFor:'aspects'! |
|
5902 |
||
5903 |
aspectAt:aKey put:aValue |
|
2075 | 5904 |
"ignore all aspects other than the rawLabel" |
5905 |
||
1631 | 5906 |
aKey == #rawLabel ifTrue:[ self rawLabel:aValue ]. |
2075 | 5907 |
|
5908 |
"Modified: / 05-09-2006 / 17:48:01 / cg" |
|
1631 | 5909 |
! ! |
5910 |
||
5911 |
!MenuEditor::RootItem methodsFor:'displaying'! |
|
5912 |
||
5913 |
heightOn:aGC |
|
2151 | 5914 |
height isNil ifTrue:[ height := aGC font heightOn:aGC device ]. |
5915 |
^ height |
|
1631 | 5916 |
! ! |
5917 |
||
5918 |
!MenuEditor::RootItem methodsFor:'initialization'! |
|
5919 |
||
5920 |
initialize |
|
5921 |
super initialize. |
|
5922 |
isExpanded := true. |
|
5923 |
! ! |
|
5924 |
||
5925 |
!MenuEditor::RootItem methodsFor:'queries'! |
|
5926 |
||
5927 |
canCollapse |
|
5928 |
^ false |
|
5929 |
! |
|
5930 |
||
5931 |
hasIndicator |
|
5932 |
^ false |
|
5933 |
! |
|
5934 |
||
5935 |
isDelayedMenu |
|
5936 |
^ false |
|
5937 |
! |
|
5938 |
||
5939 |
isRootItem |
|
5940 |
^ true |
|
5941 |
! ! |
|
5942 |
||
1660 | 5943 |
!MenuEditor::RootItem methodsFor:'queries-editor'! |
1631 | 5944 |
|
5945 |
actionSelectors |
|
2232
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5946 |
"return my action selectors" |
1613b21d0095
ca's english language and wierd indentation code cleanup
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5947 |
|
1631 | 5948 |
^ #() |
5949 |
! |
|
5950 |
||
5951 |
aspectSelectors |
|
5952 |
"returns my aspect selectors |
|
5953 |
" |
|
5954 |
^ #() |
|
5955 |
! ! |
|
5956 |
||
1660 | 5957 |
!MenuEditor::RootItem methodsFor:'queries-operation'! |
1631 | 5958 |
|
5959 |
canMoveInAbove |
|
5960 |
^ false |
|
5961 |
! |
|
5962 |
||
5963 |
canMoveInNext |
|
5964 |
^ false |
|
5965 |
! |
|
5966 |
||
5967 |
canMoveOut |
|
5968 |
^ false |
|
5969 |
! |
|
5970 |
||
5971 |
canMoveUpOrDown |
|
5972 |
^ false |
|
5973 |
! ! |
|
5974 |
||
1668 | 5975 |
!MenuEditor::SeparatorItem class methodsFor:'interface specs'! |
1631 | 5976 |
|
5977 |
basicsEditSpec |
|
5978 |
"This resource specification was automatically generated |
|
5979 |
by the UIPainter of ST/X." |
|
5980 |
||
5981 |
"Do not manually edit this!! If it is corrupted, |
|
5982 |
the UIPainter may not be able to read the specification." |
|
5983 |
||
5984 |
" |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5985 |
UIPainter new openOnClass:MenuEditor::SeparatorItem andSelector:#basicsEditSpec |
1631 | 5986 |
" |
5987 |
||
5988 |
<resource: #canvas> |
|
5989 |
||
2188 | 5990 |
^ |
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5991 |
#(FullSpec |
2188 | 5992 |
name: basicsEditSpec |
5993 |
window: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
5994 |
(WindowSpec |
2188 | 5995 |
label: 'basicsEditSpec' |
5996 |
name: 'basicsEditSpec' |
|
5997 |
min: (Point 10 10) |
|
5998 |
bounds: (Rectangle 0 0 260 245) |
|
5999 |
) |
|
6000 |
component: |
|
1737
de6abd3c55d2
Delete #max: (- windowsize) in windowSpecs
Stefan Vogel <sv@exept.de>
parents:
1730
diff
changeset
|
6001 |
(SpecCollection |
2188 | 6002 |
collection: ( |
6003 |
(LabelSpec |
|
6004 |
label: 'Separator:' |
|
6005 |
name: 'separatorLabel' |
|
6006 |
layout: (AlignmentOrigin 107 0 26 0 1 0.5) |
|
6007 |
translateLabel: true |
|
6008 |
resizeForLabel: true |
|
6009 |
adjust: right |
|
6010 |
) |
|
6011 |
(ComboListSpec |
|
6012 |
name: 'seperatorList' |
|
6013 |
layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
6014 |
activeHelpKey: basicsSeparatorType |
|
6015 |
tabable: true |
|
6016 |
model: seperatorSelection |
|
6017 |
comboList: seperatorList |
|
6018 |
useIndex: true |
|
6019 |
) |
|
6020 |
(LabelSpec |
|
6021 |
label: 'Visibility:' |
|
6022 |
name: 'visibilityLabel' |
|
6023 |
layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
6024 |
translateLabel: true |
|
6025 |
resizeForLabel: true |
|
6026 |
adjust: right |
|
6027 |
) |
|
6028 |
(InputFieldSpec |
|
6029 |
name: 'visibilityInputField' |
|
6030 |
layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
6031 |
activeHelpKey: detailsVisibility |
|
6032 |
tabable: true |
|
6033 |
model: isVisible |
|
6034 |
group: inputGroup |
|
6035 |
type: symbolOrBooleanOrNil |
|
6036 |
immediateAccept: false |
|
6037 |
acceptOnReturn: true |
|
6038 |
acceptOnTab: true |
|
6039 |
acceptChannel: acceptChannel |
|
6040 |
modifiedChannel: modifiedChannel |
|
6041 |
acceptOnPointerLeave: false |
|
6042 |
) |
|
6043 |
(LabelSpec |
|
6044 |
label: 'Start Group:' |
|
6045 |
name: 'startGroupLabel' |
|
6046 |
layout: (AlignmentOrigin 107 0 88 0 1 0.5) |
|
6047 |
translateLabel: true |
|
6048 |
resizeForLabel: true |
|
6049 |
adjust: right |
|
6050 |
) |
|
6051 |
(PopUpListSpec |
|
6052 |
label: 'left' |
|
6053 |
name: 'startGroupPopUp' |
|
6054 |
layout: (LayoutFrame 110 0 77 0 -5 1.0 99 0) |
|
6055 |
activeHelpKey: detailsStartGroup |
|
6056 |
tabable: true |
|
6057 |
model: startGroup |
|
6058 |
menu: (left right conditionalRight) |
|
6059 |
) |
|
6060 |
) |
|
6061 |
||
6062 |
) |
|
1631 | 6063 |
) |
2122
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
6064 |
|
417dabd716d5
new startGroup value: #conditionalRight
Claus Gittinger <cg@exept.de>
parents:
2118
diff
changeset
|
6065 |
"Modified: / 16-10-2006 / 12:48:30 / cg" |
1631 | 6066 |
! ! |
6067 |
||
1725 | 6068 |
!MenuEditor::SeparatorItem class methodsFor:'interface-editor'! |
6069 |
||
6070 |
addBindingsTo:aspects for:aMenuEditor |
|
6071 |
"add additional bindings to the aspects |
|
6072 |
" |
|
6073 |
|holder| |
|
6074 |
||
2188 | 6075 |
aspects |
6076 |
at:#seperatorList |
|
6077 |
ifAbsentPut: |
|
6078 |
[ |
|
6079 |
|l| |
|
6080 |
||
6081 |
l := self separatorSlices collect:[:el| el last ]. |
|
6082 |
l := l collect:[:s | self classResources string:s ]. |
|
6083 |
l |
|
6084 |
]. |
|
1725 | 6085 |
|
6086 |
aspects at:#seperatorSelection ifAbsentPut:[ |
|
2188 | 6087 |
holder := 0 asValue. |
6088 |
holder addDependent:aMenuEditor. |
|
6089 |
holder |
|
1725 | 6090 |
]. |
6091 |
! |
|
6092 |
||
6093 |
defaultLabel |
|
6094 |
^ '-' |
|
6095 |
! |
|
6096 |
||
6097 |
separatorSlices |
|
6098 |
"get the list of menu spec values of the corresponding separator types |
|
6099 |
" |
|
6100 |
^ #( |
|
6101 |
( #blank '' 'blank' ) |
|
6102 |
( #single '-' 'single line') |
|
6103 |
( #double '=' 'double line') |
|
6104 |
) |
|
6105 |
! ! |
|
6106 |
||
1631 | 6107 |
!MenuEditor::SeparatorItem methodsFor:'accessing'! |
6108 |
||
6109 |
icon |
|
6110 |
^ self class iconSeparator |
|
6111 |
! |
|
6112 |
||
6113 |
rawLabel:aValue |
|
6114 |
|value| |
|
6115 |
||
6116 |
aValue isString ifTrue:[ |
|
2862 | 6117 |
value := aValue withoutSeparators. |
6118 |
||
6119 |
(self class separatorTypeOf:value) notNil ifTrue:[ |
|
6120 |
menuItem rawLabel:value |
|
6121 |
] |
|
1631 | 6122 |
]. |
2862 | 6123 |
|
6124 |
"Modified: / 29-11-2011 / 11:28:39 / cg" |
|
1631 | 6125 |
! |
6126 |
||
6127 |
separatorType |
|
6128 |
^ self class separatorTypeOf:(menuItem rawLabel). |
|
6129 |
! |
|
6130 |
||
6131 |
slices |
|
6132 |
^ #( |
|
6133 |
(Basics basicsEditSpec) |
|
6134 |
) |
|
6135 |
! ! |
|
6136 |
||
6137 |
!MenuEditor::SeparatorItem methodsFor:'aspects'! |
|
6138 |
||
6139 |
fromAspects:aspects |
|
6140 |
"put my values into the values of aspects |
|
6141 |
" |
|
6142 |
|index slice| |
|
6143 |
||
6144 |
index := (aspects at:#seperatorSelection) value ? 0. |
|
6145 |
slice := self class separatorSlices at:index ifAbsent:nil. |
|
6146 |
||
2862 | 6147 |
slice notNil ifTrue:[ slice := slice at:2 ]. |
1631 | 6148 |
|
6149 |
(aspects at:#rawLabel) value:slice. |
|
6150 |
^ super fromAspects:aspects. |
|
2862 | 6151 |
|
6152 |
"Modified: / 29-11-2011 / 11:28:36 / cg" |
|
1631 | 6153 |
! |
6154 |
||
6155 |
toAspects:aspects |
|
6156 |
"put my values into the values of aspects |
|
6157 |
" |
|
6158 |
|index type| |
|
6159 |
||
6160 |
type := self separatorType. |
|
6161 |
index := self class separatorSlices findFirst:[:el| el first == type ]. |
|
6162 |
||
6163 |
(aspects at:#seperatorSelection) value:index. |
|
6164 |
^ super toAspects:aspects. |
|
6165 |
! ! |
|
6166 |
||
6167 |
!MenuEditor::SeparatorItem methodsFor:'displaying'! |
|
6168 |
||
6169 |
displayOn:aGC x:x y:y h:h |
|
6170 |
"draw the receiver in the graphicsContext, aGC. |
|
6171 |
" |
|
6172 |
|x1 y0 type| |
|
6173 |
||
6174 |
type := self separatorType. |
|
6175 |
type == #blank ifTrue:[ ^ self ]. |
|
6176 |
||
6177 |
x1 := x + (self widthOn:aGC). |
|
6178 |
y0 := y + (h // 2) - 1. |
|
6179 |
||
6180 |
type == #double ifTrue:[ |
|
6181 |
y0 := y0 + 1. |
|
6182 |
aGC displayLineFromX:x y:y0 toX:x1 y:y0. |
|
6183 |
y0 := y0 - 2 |
|
6184 |
]. |
|
6185 |
aGC displayLineFromX:x y:y0 toX:x1 y:y0 |
|
6186 |
! |
|
6187 |
||
6188 |
widthOn:aGC |
|
2151 | 6189 |
width isNil ifTrue:[ width := 60 ]. |
6190 |
^ width |
|
1631 | 6191 |
! ! |
6192 |
||
2019 | 6193 |
!MenuEditor class methodsFor:'documentation'! |
199 | 6194 |
|
6195 |
version |
|
6196 |
^ '$Header$' |
|
2589 | 6197 |
! |
6198 |
||
6199 |
version_CVS |
|
6200 |
^ '$Header$' |
|
199 | 6201 |
! ! |
1606 | 6202 |
|
2946 | 6203 |
|
1462
02fe22d76582
change layout of image viewer, support of adding new image retriever
ca
parents:
1454
diff
changeset
|
6204 |
MenuEditor initialize! |