author | Claus Gittinger <cg@exept.de> |
Fri, 23 May 2014 09:19:21 +0200 | |
changeset 3340 | 96d5a7df1639 |
parent 3254 | 8c2680e496c9 |
child 3355 | 214c2aa60193 |
permissions | -rw-r--r-- |
1354 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
|
7 |
inclusion of the above copyright notice. This software may not |
|
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 |
" |
|
1367 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
2854
d37c539b59ad
inherit from model, for cheap dependents.
Claus Gittinger <cg@exept.de>
parents:
2814
diff
changeset
|
14 |
Model subclass:#Menu |
579 | 15 |
instanceVariableNames:'items groupSizes receiver' |
451 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'Views-Support' |
|
19 |
! |
|
20 |
||
21 |
!Menu class methodsFor:'documentation'! |
|
22 |
||
1354 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
||
36 |
||
37 |
! |
|
38 |
||
451 | 39 |
documentation |
40 |
" |
|
41 |
not yet finished Menu class - this will eventually replace |
|
42 |
most of the MenuView and PopUpMenu stuff. |
|
43 |
(and hopefully be ST-80 compatible ...) |
|
44 |
||
45 |
For now, only a subset of the full protocol is implemented. |
|
46 |
||
47 |
[author:] |
|
740 | 48 |
Claus Gittinger |
451 | 49 |
|
50 |
[see also:] |
|
740 | 51 |
MenuItem |
52 |
PopUpMenu |
|
451 | 53 |
" |
54 |
! ! |
|
55 |
||
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
56 |
!Menu class methodsFor:'instance creation'! |
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
57 |
|
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
58 |
labelArray:arrayOfString lines:linesArray values:valueArrayOrNil |
737 | 59 |
"return a menu with menu items built with labels from arrayOfString (not Symbols). |
60 |
The linesArray describes which menu items are the last menu item in their group. |
|
61 |
The valueArray contains value objects for each menu item |
|
62 |
(or is nil if no value objects are specified)." |
|
63 |
||
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
64 |
|nLabel valueArray menuItems groupLengths| |
737 | 65 |
|
66 |
nLabel := arrayOfString size. |
|
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
67 |
|
737 | 68 |
valueArrayOrNil isNil ifTrue:[ |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
69 |
(valueArray := arrayOfString isEmpty) ifTrue: [ |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
70 |
valueArray := #() |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
71 |
] ifFalse:[ |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
72 |
valueArray := (1 to:nLabel) |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
73 |
] |
737 | 74 |
] ifFalse:[ |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
75 |
valueArray := valueArrayOrNil |
737 | 76 |
]. |
77 |
||
78 |
nLabel ~~ valueArray size ifTrue: [ |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
79 |
^ self error: 'illegal menu combination' |
737 | 80 |
]. |
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
81 |
|
737 | 82 |
menuItems := Array new:nLabel. |
83 |
1 to:nLabel do:[:i | |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
84 |
|mi v| |
737 | 85 |
|
3222 | 86 |
mi := MenuItem label:(arrayOfString at:i) asString. |
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
87 |
v := valueArray at:i. |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
88 |
(v isKindOf:Menu) ifTrue:[mi submenu:v]. |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
89 |
menuItems at:i put:mi |
737 | 90 |
]. |
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
91 |
|
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
92 |
(linesArray size == 0) ifTrue:[ |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
93 |
groupLengths := (menuItems isEmpty) |
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
94 |
ifTrue: [Array new:0] |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
95 |
ifFalse: [Array with:menuItems size] |
737 | 96 |
] ifFalse:[ |
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
97 |
groupLengths := Array new:(linesArray size + 1). |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
98 |
groupLengths at:1 put:linesArray first. |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
99 |
2 to:linesArray size do: [:i | |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
100 |
groupLengths at:i put:((linesArray at:i) - (linesArray at:i - 1)) |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
101 |
]. |
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
102 |
groupLengths at:groupLengths size put:(menuItems size - linesArray last). |
737 | 103 |
]. |
104 |
||
105 |
^ self new |
|
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
106 |
menuItems:menuItems |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
107 |
menuItemGroups:groupLengths |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
108 |
values:valueArray |
737 | 109 |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
110 |
"Modified: / 19.4.1998 / 11:30:18 / cg" |
696 | 111 |
! |
112 |
||
1174
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
113 |
labelArray:arrayOfString values:valueArrayOrNil |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
114 |
"return a menu with menu items built with labels from arrayOfString (not Symbols). |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
115 |
The valueArray contains value objects for each menu item |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
116 |
(or is nil if no value objects are specified)." |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
117 |
|
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
118 |
^ self |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
119 |
labelArray:arrayOfString |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
120 |
lines:nil |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
121 |
values: valueArrayOrNil |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
122 |
|
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
123 |
! |
f58d5c8cee82
added #labelArray:values: (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1116
diff
changeset
|
124 |
|
696 | 125 |
labelList:arrayOfGroupStrings values:valueArrayOrNil |
126 |
|labels lines| |
|
127 |
||
128 |
lines := arrayOfGroupStrings collect:[:each | each size]. |
|
2017 | 129 |
labels := arrayOfGroupStrings collectAll:[:eachGroup | eachGroup]. |
696 | 130 |
^ self labelArray:labels lines:lines values:valueArrayOrNil |
131 |
||
132 |
"Modified: 20.6.1997 / 10:46:45 / cg" |
|
133 |
"Created: 13.9.1997 / 10:35:46 / cg" |
|
737 | 134 |
! |
135 |
||
738 | 136 |
labels:aString lines:linesArray values:valueArrayOrNil |
737 | 137 |
^ self |
740 | 138 |
labelArray:(aString asCollectionOfLines) |
139 |
lines:linesArray |
|
140 |
values:valueArrayOrNil |
|
737 | 141 |
|
142 |
"Created: / 31.10.1997 / 03:12:20 / cg" |
|
738 | 143 |
"Modified: / 31.10.1997 / 03:23:42 / cg" |
1525 | 144 |
! |
145 |
||
146 |
labels:aString values:valueArrayOrNil |
|
147 |
^ self |
|
148 |
labelArray:(aString asCollectionOfLines) |
|
149 |
lines:#() |
|
150 |
values:valueArrayOrNil |
|
151 |
||
152 |
"Modified: / 31.10.1997 / 03:23:42 / cg" |
|
153 |
"Created: / 12.11.2001 / 16:06:36 / cg" |
|
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
154 |
! ! |
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
155 |
|
1764 | 156 |
!Menu methodsFor:'Compatibility-ST80'! |
724 | 157 |
|
2126 | 158 |
addLine |
159 |
self addSeparator |
|
160 |
! |
|
161 |
||
724 | 162 |
indexOfMenuItem:anItem |
2433 | 163 |
^ items indexOf:anItem |
724 | 164 |
|
2433 | 165 |
"Created: / 27.10.1997 / 16:34:19 / cg" |
166 |
! |
|
167 |
||
168 |
indexOfMenuItemForWhich:aBlock |
|
169 |
^ items findFirst:aBlock |
|
724 | 170 |
|
171 |
"Created: / 27.10.1997 / 16:34:19 / cg" |
|
172 |
! |
|
173 |
||
174 |
menuButtons |
|
175 |
"ST-80 seems to use a special menuButton class here. |
|
176 |
Here, kludge a collection of menuItems." |
|
177 |
||
178 |
^ items |
|
179 |
||
180 |
"Created: / 27.10.1997 / 16:33:35 / cg" |
|
181 |
! ! |
|
182 |
||
1782 | 183 |
!Menu methodsFor:'Compatibility-Squeak'! |
184 |
||
2764 | 185 |
add:label target:target selector:selector |
3185 | 186 |
self addItem:(MenuItem label:label itemValue:[target perform:selector]). |
2764 | 187 |
! |
188 |
||
189 |
balloonTextForLastItem:aString |
|
190 |
items last helpText:aString |
|
191 |
! |
|
192 |
||
1782 | 193 |
labels:labels lines:lines selections:selections |
194 |
|labelArray| |
|
195 |
||
196 |
labels isString ifTrue:[ |
|
197 |
labelArray := labels asCollectionOfLines. |
|
198 |
] ifFalse:[ |
|
199 |
labelArray := labels. |
|
200 |
]. |
|
201 |
||
202 |
1 to:labelArray size do:[:idx | |
|
203 |
|item| |
|
204 |
||
205 |
item := MenuItem new. |
|
206 |
item label:(labelArray at:idx). |
|
3022 | 207 |
item itemValue:(selections at:idx). |
1782 | 208 |
self addItem:item. |
209 |
||
210 |
(lines includes:idx) ifTrue:[ |
|
211 |
self addSeparator. |
|
212 |
]. |
|
213 |
]. |
|
3022 | 214 |
|
215 |
"Modified: / 09-09-2012 / 13:08:55 / cg" |
|
1782 | 216 |
! ! |
217 |
||
451 | 218 |
!Menu methodsFor:'accessing'! |
219 |
||
2916
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
220 |
atMenuItemLabeled:aString putSubmenu:aMenu visible:visible |
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
221 |
(self menuItemLabeled:aString) |
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
222 |
submenu:aMenu; |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
223 |
isVisible:visible |
2916
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
224 |
|
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
225 |
"Created: / 30-06-2011 / 10:30:22 / cg" |
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
226 |
! |
ff96b6187a5f
added: #atMenuItemLabeled:putSubmenu:visible:
Claus Gittinger <cg@exept.de>
parents:
2908
diff
changeset
|
227 |
|
696 | 228 |
atNameKey:aNameKey |
724 | 229 |
"return the menuItem for the given nameKey; nil if no such item is in the menu. |
230 |
Searches in allItems (i.e. also in subMenus)" |
|
696 | 231 |
|
724 | 232 |
self allItemsDo:[:anItem| |
740 | 233 |
anItem nameKey == aNameKey ifTrue:[^ anItem] |
724 | 234 |
]. |
696 | 235 |
^ nil |
236 |
||
724 | 237 |
"Modified: / 27.10.1997 / 15:12:00 / cg" |
696 | 238 |
! |
239 |
||
3340 | 240 |
atNameKey:aNameKey ifPresentDo:aBlock |
241 |
"look for a menuItem withthe given nameKey. If one is found, aBlock is evaluated for it. |
|
242 |
If not, nothing is done. |
|
243 |
Searches in allItems (i.e. also in subMenus). |
|
244 |
Returns the item or nil." |
|
245 |
||
246 |
|item| |
|
247 |
||
248 |
(item := self atNameKey:aNameKey) notNil ifTrue:[ |
|
249 |
aBlock value:item. |
|
250 |
]. |
|
251 |
^ item |
|
252 |
! |
|
253 |
||
578 | 254 |
groupSizes |
1500 | 255 |
^ groupSizes |
256 |
! |
|
578 | 257 |
|
258 |
groupSizes:something |
|
1500 | 259 |
groupSizes := something. |
260 |
! |
|
578 | 261 |
|
1986 | 262 |
items |
263 |
^ items |
|
264 |
! |
|
265 |
||
584 | 266 |
labelAt:anIndex |
267 |
"gets the label of the menu item at the given index or nil |
|
268 |
" |
|
269 |
|item| |
|
270 |
||
271 |
(item := self menuItemAt:anIndex) notNil ifTrue:[ |
|
801 | 272 |
^ item label |
584 | 273 |
]. |
801 | 274 |
^ nil |
584 | 275 |
|
801 | 276 |
"Modified: / 2.2.1998 / 13:28:32 / cg" |
584 | 277 |
! |
278 |
||
279 |
labelAtValue:aValue |
|
280 |
"gets the label of the menu item assigned to value |
|
281 |
" |
|
282 |
|item| |
|
283 |
||
801 | 284 |
item := self menuAndSubmenusDetectItem:[:anItem | anItem value == aValue ]. |
584 | 285 |
|
286 |
item notNil ifTrue:[ |
|
801 | 287 |
^ item label |
584 | 288 |
]. |
801 | 289 |
^ nil |
584 | 290 |
|
801 | 291 |
"Modified: / 2.2.1998 / 13:28:28 / cg" |
584 | 292 |
! |
293 |
||
451 | 294 |
labels |
295 |
"return a collection of labels from my items" |
|
296 |
||
977
e07277070839
return valid collection in #labels.
Claus Gittinger <cg@exept.de>
parents:
972
diff
changeset
|
297 |
items isNil ifTrue:[^ #()]. |
451 | 298 |
^ items collect:[:anItem | anItem label] |
299 |
||
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
300 |
"Created: / 25.2.1997 / 19:47:53 / cg" |
977
e07277070839
return valid collection in #labels.
Claus Gittinger <cg@exept.de>
parents:
972
diff
changeset
|
301 |
"Modified: / 19.6.1998 / 02:36:22 / cg" |
451 | 302 |
! |
303 |
||
940 | 304 |
lastItem |
2584 | 305 |
"returns the last item or nil, if there are none" |
306 |
||
307 |
^ items isEmptyOrNil |
|
308 |
ifTrue:[nil] |
|
309 |
ifFalse:[items last] |
|
940 | 310 |
! |
311 |
||
489 | 312 |
lines |
737 | 313 |
"return the indexes of the menu items that are the last menu item in their group (except the very last)." |
489 | 314 |
|
801 | 315 |
|lines groupSz| |
737 | 316 |
|
801 | 317 |
(groupSz := groupSizes size) <= 1 ifTrue: [^ Array new]. |
318 |
lines := Array new:(groupSz - 1). |
|
319 |
lines at:1 put:groupSizes first. |
|
320 |
2 to:(groupSz-1) do:[:i | |
|
321 |
lines at:i put:(lines at:(i - 1)) + (groupSizes at:i) |
|
322 |
]. |
|
323 |
^ lines |
|
489 | 324 |
|
801 | 325 |
"Modified: / 2.2.1998 / 13:28:19 / cg" |
489 | 326 |
! |
327 |
||
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
328 |
menuItemAt:index |
584 | 329 |
"gets the menu item at the given index. When the index is out of bounds |
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
330 |
nil is returned" |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
331 |
|
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
332 |
(index > 0 and:[ index <= items size ]) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
333 |
^ items at:index |
584 | 334 |
]. |
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
335 |
^ nil |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
336 |
|
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
337 |
"Modified: / 30-06-2011 / 10:51:39 / cg" |
489 | 338 |
! |
339 |
||
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
340 |
menuItemLabeled:anItemLabel |
724 | 341 |
"return the menuItem for the given nameKey; nil if no such item is in the menu. |
342 |
Searches all items (i.e. also submenu items)" |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
343 |
|
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
344 |
self |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
345 |
allItemsDo:[:anItem | |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
346 |
|l| |
724 | 347 |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
348 |
((l := anItem label) sameAs:anItemLabel) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
349 |
^ anItem |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
350 |
]. |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
351 |
(l includes:$&) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
352 |
((l copyWithout:$&) sameAs:anItemLabel) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
353 |
^ anItem |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
354 |
] |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
355 |
] |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
356 |
]. |
724 | 357 |
^ nil |
358 |
||
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
359 |
"Created: / 13-09-1997 / 10:25:16 / cg" |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
360 |
"Modified: / 30-06-2011 / 10:51:44 / cg" |
724 | 361 |
! |
362 |
||
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
363 |
menuItemWithArgument:aValue |
2908
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
364 |
"return the menuItem for the given value; nil if no such item is in the menu. |
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
365 |
Searches all items (i.e. also submenu items)" |
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
366 |
|
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
367 |
self |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
368 |
allItemsDo:[:anItem | |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
369 |
|l| |
2908
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
370 |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
371 |
(anItem argument = aValue) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
372 |
^ anItem |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
373 |
]. |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
374 |
]. |
2908
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
375 |
^ nil |
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
376 |
|
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
377 |
"Created: / 19-04-2011 / 14:42:18 / cg" |
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
378 |
"Modified: / 30-06-2011 / 10:51:50 / cg" |
2908
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
379 |
! |
e21010b76553
added: #menuItemWithArgument:
Claus Gittinger <cg@exept.de>
parents:
2867
diff
changeset
|
380 |
|
2952
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
381 |
menuItemWithKey:aValue |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
382 |
"return the menuItem for the given key; nil if no such item is in the menu. |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
383 |
Searches all items (i.e. also submenu items)" |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
384 |
|
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
385 |
self |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
386 |
allItemsDo:[:anItem | |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
387 |
|
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
388 |
(anItem nameKey = aValue) ifTrue:[ |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
389 |
^ anItem |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
390 |
]. |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
391 |
]. |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
392 |
^ nil |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
393 |
|
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
394 |
"Created: / 19-04-2011 / 14:42:18 / cg" |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
395 |
"Modified: / 30-06-2011 / 10:51:50 / cg" |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
396 |
"Created: / 07-10-2011 / 15:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
397 |
! |
1cedbbc95433
added: #menuItemWithKey:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2918
diff
changeset
|
398 |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
399 |
menuItemWithValue:aValue |
1652 | 400 |
"return the menuItem for the given value; nil if no such item is in the menu. |
401 |
Searches all items (i.e. also submenu items)" |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
402 |
|
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
403 |
self |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
404 |
allItemsDo:[:anItem | |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
405 |
|l| |
1652 | 406 |
|
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
407 |
(anItem value == aValue) ifTrue:[ |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
408 |
^ anItem |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
409 |
]. |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
410 |
]. |
1652 | 411 |
^ nil |
412 |
||
2918
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
413 |
"Created: / 13-09-1997 / 10:25:16 / cg" |
44a68f3ffba5
fixes for Jan's menu rewriting in NewSystemBrowser
Claus Gittinger <cg@exept.de>
parents:
2917
diff
changeset
|
414 |
"Modified: / 30-06-2011 / 10:51:56 / cg" |
1652 | 415 |
! |
416 |
||
489 | 417 |
menuItems |
1327
b0b482a84570
menuItems always returns a collection (never nil)
Claus Gittinger <cg@exept.de>
parents:
1308
diff
changeset
|
418 |
^ items ? #() |
489 | 419 |
! |
420 |
||
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
421 |
menuItems:aCollectionOfMenuItems menuItemGroups:sizes values:values |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
422 |
|n| |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
423 |
|
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
424 |
items := groupSizes := nil. |
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
425 |
|
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
426 |
aCollectionOfMenuItems size == 0 ifTrue:[ ^ self ]. |
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
427 |
|
451 | 428 |
items := aCollectionOfMenuItems. |
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
429 |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
430 |
sizes size > 0 ifTrue:[ |
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
431 |
groupSizes := sizes. |
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
432 |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
433 |
n := sizes inject:0 into:[:sumSoFar :this | sumSoFar + this]. |
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
434 |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
435 |
n = items size ifTrue:[ |
3117
3c7f6b69b2c5
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3028
diff
changeset
|
436 |
groupSizes := sizes copyButLast:1 |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
437 |
] |
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
438 |
]. |
451 | 439 |
|
579 | 440 |
values notNil ifTrue:[ |
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
441 |
items with:values do:[:anItem :aValue |anItem value:aValue] |
454 | 442 |
]. |
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
443 |
|
900
aa93395cdb55
care for empty group at the end (avoid line at end of menu)
Claus Gittinger <cg@exept.de>
parents:
801
diff
changeset
|
444 |
"Modified: / 19.4.1998 / 11:47:34 / cg" |
451 | 445 |
! |
446 |
||
1116 | 447 |
menuPerformer:something |
448 |
"set the receiver of the menu messages" |
|
449 |
||
450 |
receiver := something. |
|
451 |
||
452 |
"Modified: / 2.2.1998 / 13:26:29 / cg" |
|
453 |
! |
|
454 |
||
494 | 455 |
numberOfItems |
801 | 456 |
"return the number of items in this menu" |
457 |
||
494 | 458 |
^ items size |
459 |
||
801 | 460 |
"Created: / 6.3.1997 / 15:15:53 / cg" |
461 |
"Modified: / 2.2.1998 / 13:26:40 / cg" |
|
494 | 462 |
! |
463 |
||
579 | 464 |
receiver |
801 | 465 |
"return the receiver of the menu messages" |
579 | 466 |
|
801 | 467 |
^ receiver |
468 |
||
469 |
"Modified: / 2.2.1998 / 13:26:20 / cg" |
|
470 |
! |
|
579 | 471 |
|
472 |
receiver:something |
|
801 | 473 |
"set the receiver of the menu messages" |
579 | 474 |
|
801 | 475 |
receiver := something. |
476 |
||
477 |
"Modified: / 2.2.1998 / 13:26:29 / cg" |
|
478 |
! |
|
579 | 479 |
|
451 | 480 |
valueAt:index |
481 |
"return a collection of values from my items" |
|
482 |
||
483 |
^ (items at:index) value |
|
484 |
||
485 |
"Created: 25.2.1997 / 19:49:41 / cg" |
|
486 |
! |
|
487 |
||
494 | 488 |
valueAt:anIndex put:aValue |
489 |
"put value an an index" |
|
490 |
||
491 |
(items at:anIndex) value:aValue |
|
492 |
||
493 |
"Created: 6.3.1997 / 15:15:48 / cg" |
|
494 |
! |
|
495 |
||
451 | 496 |
values |
497 |
"return a collection of values from my items" |
|
498 |
||
499 |
^ items collect:[:anItem | anItem value] |
|
500 |
||
501 |
"Created: 25.2.1997 / 19:49:29 / cg" |
|
724 | 502 |
! |
503 |
||
504 |
values:aCollectionOfValues |
|
505 |
"return a collection of values from my items" |
|
506 |
||
507 |
|s| |
|
508 |
||
509 |
s := aCollectionOfValues readStream. |
|
510 |
self itemsDo:[:item | |
|
1111 | 511 |
|val| |
724 | 512 |
|
1111 | 513 |
val := s next. |
514 |
item value:val |
|
724 | 515 |
]. |
1111 | 516 |
s atEnd ifFalse:[ |
2092 | 517 |
self error:'not enough elements in the value collection' mayProceed:true |
1111 | 518 |
] |
724 | 519 |
|
520 |
"Created: / 27.10.1997 / 15:15:47 / cg" |
|
521 |
! |
|
522 |
||
523 |
visibleMenuItemGroups |
|
801 | 524 |
|itemGroups visibleItemGroups nextItem| |
724 | 525 |
|
801 | 526 |
itemGroups := OrderedCollection new. |
527 |
nextItem := 1. |
|
528 |
groupSizes do:[:groupSize | |
|
529 |
itemGroups addLast: (items copyFrom:nextItem to:nextItem + groupSize - 1). |
|
530 |
nextItem := nextItem + groupSize |
|
531 |
]. |
|
532 |
self hasHiddenItems ifFalse:[^ itemGroups]. |
|
724 | 533 |
|
801 | 534 |
"Remove the hidden items." |
535 |
visibleItemGroups := OrderedCollection new. |
|
536 |
itemGroups do:[:eachItemGroup | |
|
537 |
|visibleItemGroup| |
|
538 |
||
539 |
visibleItemGroup := eachItemGroup reject:[:eachMenuItem | eachMenuItem hidden]. |
|
2129 | 540 |
visibleItemGroup notEmpty ifTrue:[ |
801 | 541 |
visibleItemGroups addLast: visibleItemGroup |
542 |
] |
|
543 |
]. |
|
544 |
^ visibleItemGroups |
|
724 | 545 |
|
546 |
"Created: / 27.10.1997 / 15:07:50 / cg" |
|
801 | 547 |
"Modified: / 2.2.1998 / 13:25:52 / cg" |
451 | 548 |
! ! |
549 |
||
1397 | 550 |
!Menu methodsFor:'accessing-resource'! |
582 | 551 |
|
584 | 552 |
findGuiResourcesIn:aResourceContainerOrApplication |
2269
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
553 |
"setup a resource owner" |
1986 | 554 |
|
555 |
receiver isNil ifTrue:[ |
|
556 |
receiver := aResourceContainerOrApplication |
|
557 |
]. |
|
2269
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
558 |
^ self |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
559 |
findGuiResourcesIn:aResourceContainerOrApplication |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
560 |
rememberResourcesIn:(ValueHolder new) |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
561 |
|
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
562 |
"Modified: / 26-10-2006 / 16:37:57 / cg" |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
563 |
! |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
564 |
|
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
565 |
findGuiResourcesIn:aResourceContainerOrApplication rememberResourcesIn:aValueHolderOrNil |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
566 |
"setup a resource owner" |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
567 |
|
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
568 |
|resolvedItems rcv| |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
569 |
|
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
570 |
"/ cg: do not recursively change the receiver - it could be set for the top |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
571 |
"/ menu via #receiver: by the application. |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
572 |
"/ if the submenu's receiver is nil, the parentmenus receiver will be used, which is ok. |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
573 |
"/ But if it was changed below, we would need a recursive setting in #receiver: as well. |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
574 |
|
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
575 |
"/ receiver isNil ifTrue:[ |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
576 |
"/ receiver := aResourceContainerOrApplication |
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
577 |
"/ ]. |
1986 | 578 |
items isEmptyOrNil ifTrue:[^ self]. |
579 |
||
580 |
resolvedItems := OrderedCollection new. |
|
581 |
||
582 |
items do:[:anItem | |
|
2867 | 583 |
anItem isMenuSlice ifTrue:[ |
584 |
|resItems| |
|
585 |
||
2059
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
586 |
rcv := aResourceContainerOrApplication. |
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
587 |
[rcv notNil and:[resItems isNil]] whileTrue:[ |
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
588 |
resItems := anItem resolveSliceMenuItemsIn:rcv |
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
589 |
rememberResourcesIn:aValueHolderOrNil. |
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
590 |
rcv := rcv perform:#masterApplication ifNotUnderstood:nil. |
36e4aa247402
fixed menu-slice resolving (search in masterApplication too)
Claus Gittinger <cg@exept.de>
parents:
2039
diff
changeset
|
591 |
]. |
1986 | 592 |
|
593 |
resItems notEmptyOrNil ifTrue:[ |
|
594 |
resolvedItems addAll:resItems. |
|
595 |
] |
|
596 |
] ifFalse:[ |
|
597 |
anItem |
|
598 |
findGuiResourcesIn:aResourceContainerOrApplication |
|
599 |
rememberResourcesIn:aValueHolderOrNil. |
|
600 |
||
601 |
resolvedItems add:anItem. |
|
1534
292c277fcf6a
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
602 |
]. |
1986 | 603 |
]. |
604 |
items := resolvedItems. |
|
2269
7fae2df3ba48
resolveGUIResources no longer sets the receiver recursively
Claus Gittinger <cg@exept.de>
parents:
2129
diff
changeset
|
605 |
|
2867 | 606 |
"Modified: / 22-09-2010 / 13:34:38 / cg" |
582 | 607 |
! ! |
608 |
||
940 | 609 |
!Menu methodsFor:'adding & removing'! |
610 |
||
611 |
addItem:aMenuItem |
|
1029 | 612 |
"add a menuItem at the end; |
613 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
614 |
||
940 | 615 |
items isNil ifTrue:[ |
1029 | 616 |
items := OrderedCollection new |
617 |
] ifFalse:[ |
|
618 |
items := items asOrderedCollection |
|
940 | 619 |
]. |
620 |
items add:aMenuItem. |
|
1029 | 621 |
|
622 |
"Modified: / 4.8.1998 / 17:31:13 / cg" |
|
940 | 623 |
! |
624 |
||
625 |
addItem:aMenuItem beforeIndex:anIndex |
|
1029 | 626 |
"add a menuItem at some position; |
627 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
628 |
||
940 | 629 |
items isNil ifTrue:[ |
630 |
items := OrderedCollection new |
|
1029 | 631 |
] ifFalse:[ |
632 |
items := items asOrderedCollection |
|
940 | 633 |
]. |
634 |
items add:aMenuItem beforeIndex:anIndex. |
|
1029 | 635 |
|
636 |
"Modified: / 4.8.1998 / 17:31:39 / cg" |
|
940 | 637 |
! |
638 |
||
639 |
addItem:aMenuItem value:aValue |
|
3022 | 640 |
aMenuItem itemValue:aValue. |
940 | 641 |
self addItem:aMenuItem. |
3022 | 642 |
|
643 |
"Modified: / 09-09-2012 / 13:08:50 / cg" |
|
940 | 644 |
! |
645 |
||
1758 | 646 |
addItemGroup:aGroup |
1029 | 647 |
"add a group of items at the end; |
648 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
649 |
||
940 | 650 |
groupSizes isNil ifTrue:[ |
1758 | 651 |
groupSizes := OrderedCollection with:items size. |
940 | 652 |
]. |
1758 | 653 |
groupSizes add:aGroup size. |
940 | 654 |
|
1758 | 655 |
aGroup do:[:item | |
1029 | 656 |
self addItem:item |
940 | 657 |
]. |
658 |
||
659 |
"Created: / 27.10.1997 / 15:02:15 / cg" |
|
1029 | 660 |
"Modified: / 4.8.1998 / 17:32:06 / cg" |
940 | 661 |
! |
662 |
||
663 |
addItemGroup:aGroup values:values |
|
1029 | 664 |
"add a group of items at the end; |
665 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
666 |
||
1758 | 667 |
aGroup with:values do:[:item :value | |
668 |
item value:value |
|
940 | 669 |
]. |
1758 | 670 |
self addItemGroup:aGroup |
1029 | 671 |
|
672 |
"Modified: / 4.8.1998 / 17:32:18 / cg" |
|
940 | 673 |
! |
674 |
||
675 |
addItemGroupLabels:labels values:values |
|
1029 | 676 |
"add a group of items at the end; |
677 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
678 |
||
940 | 679 |
|items| |
680 |
||
681 |
items := labels with:values |
|
1029 | 682 |
collect:[:label :value | |
3185 | 683 |
MenuItem label:label itemValue:value |
1029 | 684 |
]. |
940 | 685 |
self addItemGroup:items |
686 |
||
687 |
"Created: / 27.10.1997 / 19:49:27 / cg" |
|
1029 | 688 |
"Modified: / 4.8.1998 / 17:35:22 / cg" |
940 | 689 |
! |
690 |
||
691 |
addItemLabel:label value:value |
|
1029 | 692 |
"add an item at the end; |
693 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
940 | 694 |
|
3185 | 695 |
self addItem:(MenuItem label:label itemValue:value) |
940 | 696 |
|
697 |
"Created: / 27.10.1997 / 19:47:12 / cg" |
|
1029 | 698 |
"Modified: / 4.8.1998 / 17:34:44 / cg" |
940 | 699 |
! |
700 |
||
3226 | 701 |
addItems: collection |
702 |
"Add all items in given collection. |
|
703 |
Useful to build a menu programmatically (or, to add more items dynamically)" |
|
704 |
||
705 |
items isNil ifTrue:[ |
|
706 |
items := OrderedCollection new |
|
707 |
] ifFalse:[ |
|
708 |
items := items asOrderedCollection |
|
709 |
]. |
|
710 |
items addAll: collection |
|
711 |
||
712 |
"Created: / 01-09-2013 / 16:43:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
713 |
! |
|
714 |
||
715 |
addItemsFrom: anotherMenu |
|
716 |
"Add all items from another menu. |
|
717 |
Useful to build a menu programmatically (or, to add more items dynamically)" |
|
718 |
||
3254 | 719 |
self addItems: anotherMenu items ? #() |
3226 | 720 |
|
721 |
"Created: / 01-09-2013 / 16:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3254 | 722 |
"Modified: / 04-10-2013 / 19:28:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3226 | 723 |
! |
724 |
||
1500 | 725 |
addSeparator |
726 |
"add a separating line item at the end; |
|
727 |
useful to build a menu programmatically (or, to add more items dynamically)" |
|
728 |
||
2814 | 729 |
self addItem:(MenuItem separator). |
1500 | 730 |
! |
731 |
||
940 | 732 |
removeItem:aMenuItem |
733 |
"remove an item from the menu" |
|
734 |
||
735 |
|idx| |
|
736 |
||
737 |
items notNil ifTrue:[ |
|
738 |
idx := items identityIndexOf:aMenuItem. |
|
739 |
idx ~~ 0 ifTrue:[ |
|
740 |
items removeAtIndex:idx |
|
741 |
] |
|
742 |
]. |
|
743 |
||
744 |
"Created: / 13.9.1997 / 10:27:31 / cg" |
|
745 |
"Modified: / 2.2.1998 / 13:26:49 / cg" |
|
746 |
! |
|
747 |
||
748 |
removeItemAt:anIndex |
|
749 |
"remove item at an index |
|
750 |
" |
|
751 |
anIndex <= items size ifTrue:[ |
|
752 |
^ items removeAtIndex:anIndex |
|
753 |
]. |
|
754 |
^ nil |
|
755 |
! ! |
|
756 |
||
451 | 757 |
!Menu methodsFor:'converting'! |
758 |
||
2081 | 759 |
asOldStylePopUpMenuFor:anApplicationOrNil |
2080 | 760 |
"a temporary kludge - will vanish, when oldStyle MenuView and PopUpMenu are gone" |
761 |
||
2081 | 762 |
|menuView itemsShown| |
763 |
||
2867 | 764 |
itemsShown := items |
765 |
select:[:each | |
|
2081 | 766 |
|visibilityInItem| |
767 |
||
768 |
visibilityInItem := each isVisible. |
|
769 |
visibilityInItem isNil ifTrue:[ |
|
770 |
true |
|
771 |
] ifFalse:[ |
|
772 |
visibilityInItem isBoolean ifTrue:[ |
|
773 |
visibilityInItem |
|
774 |
] ifFalse:[ |
|
775 |
visibilityInItem isSymbol ifTrue:[ |
|
2917
2ba0fee85a7f
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
2916
diff
changeset
|
776 |
anApplicationOrNil isNil |
2ba0fee85a7f
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
2916
diff
changeset
|
777 |
or:[ (anApplicationOrNil perform:visibilityInItem) value ]. |
2081 | 778 |
] ifFalse:[ |
779 |
visibilityInItem value |
|
780 |
]. |
|
781 |
]. |
|
782 |
]. |
|
783 |
]. |
|
2080 | 784 |
|
785 |
menuView := MenuView |
|
2081 | 786 |
labels:(itemsShown collect:[:each | each label]) |
787 |
selectors:(itemsShown collect:[:each | each value]) |
|
2751
d0729d604864
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
2584
diff
changeset
|
788 |
accelerators:(itemsShown collect:[:each | each shortcutKey]) |
2081 | 789 |
args:(itemsShown collect:[:each | each argument]) |
2080 | 790 |
receiver:receiver. |
791 |
||
2092 | 792 |
itemsShown doWithIndex:[:each :idx | |
2081 | 793 |
|enabledInItem enabled| |
794 |
||
795 |
enabledInItem := each enabled. |
|
796 |
enabledInItem notNil ifTrue:[ |
|
797 |
enabledInItem isSymbol ifTrue:[ |
|
2917
2ba0fee85a7f
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
2916
diff
changeset
|
798 |
enabled := anApplicationOrNil isNil or:[ (anApplicationOrNil perform:enabledInItem) ]. |
2081 | 799 |
] ifFalse:[ |
3028
29a0a22942fe
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
3022
diff
changeset
|
800 |
enabled := enabledInItem |
2081 | 801 |
]. |
802 |
enabled value ifFalse:[ |
|
2092 | 803 |
menuView disable:idx |
2081 | 804 |
]. |
805 |
]. |
|
806 |
]. |
|
807 |
||
3245 | 808 |
menuView actions:(itemsShown |
809 |
collect:[:each | |
|
810 |
[ |
|
811 |
|actionOrSymbol| |
|
812 |
||
813 |
actionOrSymbol := each itemValue. |
|
814 |
actionOrSymbol isBlock ifTrue:[ |
|
815 |
actionOrSymbol value |
|
816 |
] ifFalse:[ |
|
817 |
receiver perform:actionOrSymbol |
|
818 |
] |
|
819 |
] |
|
820 |
] |
|
821 |
). |
|
2080 | 822 |
|
823 |
^ PopUpMenu forMenu:menuView |
|
2867 | 824 |
|
2917
2ba0fee85a7f
changed: #asOldStylePopUpMenuFor:
Claus Gittinger <cg@exept.de>
parents:
2916
diff
changeset
|
825 |
"Modified: / 30-06-2011 / 10:35:57 / cg" |
2080 | 826 |
! |
827 |
||
451 | 828 |
fromLiteralArrayEncoding:aLiteralEncodedArray |
829 |
"read my contents from a aLiteralEncodedArray" |
|
830 |
||
831 |
|items groups values| |
|
832 |
||
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
833 |
items := aLiteralEncodedArray at:2. |
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
834 |
|
2864
f90017f2da66
changed: #fromLiteralArrayEncoding:
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
835 |
items notNil ifTrue:[ |
1620
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
836 |
items := items collect:[:item | item decodeAsLiteralArray]. |
bf72298c42bc
bug fixes; handle unspecified items in literalArrayEncoding
ca
parents:
1599
diff
changeset
|
837 |
]. |
1405
c7775c10e8fd
tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
838 |
groups := aLiteralEncodedArray at:3 ifAbsent:nil. |
c7775c10e8fd
tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
839 |
values := aLiteralEncodedArray at:4 ifAbsent:nil. |
610
72dbf392e888
ST80 compatible inst creation method..
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
840 |
self menuItems:items menuItemGroups:groups values:values. |
451 | 841 |
|
842 |
"extract from PD folder.st: |
|
843 |
#(#Menu #( |
|
1245 | 844 |
#(#MenuItem |
845 |
#rawLabel: 'left' |
|
846 |
#value: #left ) |
|
847 |
#(#MenuItem |
|
848 |
#rawLabel: 'center' |
|
849 |
#value: #center ) |
|
850 |
#(#MenuItem |
|
851 |
#rawLabel: 'right' |
|
852 |
#value: #right ) |
|
853 |
) |
|
854 |
#(3 ) |
|
855 |
nil |
|
451 | 856 |
) decodeAsLiteralArray |
857 |
" |
|
452 | 858 |
" |
859 |
#(#Menu #( |
|
1245 | 860 |
#(#MenuItem |
861 |
#label: 'Straighten Up' ) |
|
862 |
#(#MenuItem |
|
863 |
#label: 'Inspect' ) |
|
864 |
#(#MenuItem |
|
865 |
#label: 'Coredump' ) |
|
866 |
) |
|
867 |
#(3 ) |
|
868 |
#(#straightenUp #inspect #halt ) |
|
452 | 869 |
) decodeAsLiteralArray startUp |
870 |
" |
|
457 | 871 |
|
454 | 872 |
"extract from iconicBrowser.st: |
452 | 873 |
#(#Menu #( |
1245 | 874 |
#(#MenuItem |
875 |
#label: 'Straighten Up' ) |
|
876 |
#(#MenuItem |
|
877 |
#label: 'Inspect' ) |
|
878 |
#(#MenuItem |
|
879 |
#label: 'Coredump' ) |
|
880 |
) |
|
881 |
#(3 ) |
|
882 |
#(1 2 3 ) |
|
452 | 883 |
) decodeAsLiteralArray startUp |
884 |
" |
|
451 | 885 |
|
454 | 886 |
"extract from refactory213.st: |
887 |
#(#Menu #( |
|
1245 | 888 |
#(#MenuItem |
889 |
#label: 'File List' |
|
890 |
#accessCharacterPosition: 1 ) |
|
891 |
#(#MenuItem #label: 'File Editor...' |
|
892 |
#accessCharacterPosition: 6 ) |
|
893 |
#(#MenuItem #label: 'Refactoring Tool...' |
|
894 |
#accessCharacterPosition: 1 ) |
|
895 |
#(#MenuItem #label: 'Workspace' |
|
896 |
#accessCharacterPosition: 1 ) |
|
897 |
#(#MenuItem #label: 'New Canvas' |
|
898 |
#accessCharacterPosition: 1 ) |
|
899 |
#(#MenuItem #label: 'Palette' |
|
900 |
#accessCharacterPosition: 1 ) |
|
901 |
#(#MenuItem #label: 'Canvas Tool' |
|
902 |
#accessCharacterPosition: 1 ) |
|
903 |
#(#MenuItem #label: 'Image Editor' |
|
904 |
#accessCharacterPosition: 1 ) |
|
905 |
#(#MenuItem #label: 'Menu Editor' |
|
906 |
#accessCharacterPosition: 1 ) |
|
907 |
#(#MenuItem #label: 'Advanced' |
|
908 |
#accessCharacterPosition: 1 ) |
|
909 |
#(#MenuItem #label: 'DLL and C Connect' |
|
910 |
#accessCharacterPosition: 1 ) |
|
911 |
#(#MenuItem #label: 'System Transcript' |
|
912 |
#accessCharacterPosition: 8 ) |
|
913 |
) |
|
914 |
#(4 5 2 1 ) |
|
915 |
#(#openFileList #openFileEditor #openRefactoringTool #toolsNewWorkspace #toolsNewCanvas #toolsPalette #toolsCanvasTool #toolsMaskEditor #toolsMenuEditor nil #openExternalFinder #toggleSystemTranscript ) |
|
916 |
) decodeAsLiteralArray startUp |
|
454 | 917 |
" |
918 |
||
457 | 919 |
"submenus: |
920 |
#(#Menu #( |
|
1245 | 921 |
#(#MenuItem |
922 |
#label: 'Foo' |
|
923 |
#submenu: #(#Menu #( |
|
924 |
#(#MenuItem #label: 'foo 1') |
|
925 |
#(#MenuItem #label: 'foo 2') |
|
926 |
) |
|
927 |
nil |
|
928 |
#(11 22) |
|
929 |
) |
|
930 |
) |
|
931 |
#(#MenuItem |
|
932 |
#label: 'Inspect' ) |
|
933 |
#(#MenuItem |
|
934 |
#label: 'Coredump' ) |
|
935 |
) |
|
936 |
#(3 ) |
|
937 |
#(1 2 3 ) |
|
457 | 938 |
) decodeAsLiteralArray startUp |
939 |
" |
|
940 |
||
2864
f90017f2da66
changed: #fromLiteralArrayEncoding:
Claus Gittinger <cg@exept.de>
parents:
2854
diff
changeset
|
941 |
"Modified: / 08-08-2010 / 14:43:03 / cg" |
489 | 942 |
! |
943 |
||
944 |
literalArrayEncoding |
|
945 |
"return myself encoded as a literal array" |
|
946 |
||
1245 | 947 |
|coll array size| |
489 | 948 |
|
949 |
coll := OrderedCollection new. |
|
950 |
coll add:#Menu. |
|
1245 | 951 |
|
952 |
(size := items size) == 0 ifTrue:[ |
|
953 |
array := nil |
|
954 |
] ifFalse:[ |
|
955 |
array := Array new:size. |
|
956 |
items keysAndValuesDo:[:anIndex :anItem| |
|
957 |
array at:anIndex put:(anItem literalArrayEncoding) |
|
958 |
] |
|
959 |
]. |
|
960 |
coll add:array. |
|
961 |
||
962 |
(size := groupSizes size) == 0 ifTrue:[ |
|
963 |
array := nil |
|
964 |
] ifFalse:[ |
|
965 |
array := Array new:size. |
|
966 |
groupSizes keysAndValuesDo:[:anIndex :aSize| |
|
967 |
array at:anIndex put:(aSize literalArrayEncoding) |
|
968 |
] |
|
969 |
]. |
|
970 |
coll add:array. |
|
489 | 971 |
coll add:nil. |
579 | 972 |
^ coll asArray |
451 | 973 |
! ! |
974 |
||
584 | 975 |
!Menu methodsFor:'enumerating'! |
976 |
||
2494
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
977 |
allItemsDetect:aOneArgBlock ifNone:exceptionalValue |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
978 |
"find an element amongst each item and submenu items" |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
979 |
|
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
980 |
self itemsDo:[:anItem| |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
981 |
|sub subItem| |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
982 |
|
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
983 |
(aOneArgBlock value:anItem) ifTrue:[^ anItem]. |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
984 |
(sub := anItem submenu) notNil ifTrue:[ |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
985 |
subItem := sub allItemsDetect:aOneArgBlock ifNone:nil. |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
986 |
subItem notNil ifTrue:[^ subItem]. |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
987 |
] |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
988 |
]. |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
989 |
^ exceptionalValue value |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
990 |
! |
994b030ae562
new enumerator: allItemsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
991 |
|
665 | 992 |
allItemsDo:aOneArgBlock |
993 |
"evaluate block on each item and submenu items |
|
994 |
" |
|
995 |
self itemsDo:[:anItem| |
|
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
996 |
|sub| |
724 | 997 |
|
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
998 |
aOneArgBlock value:anItem. |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
999 |
(sub := anItem submenu) notNil ifTrue:[ |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1000 |
sub allItemsDo:aOneArgBlock |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1001 |
] |
665 | 1002 |
] |
724 | 1003 |
|
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1004 |
"Modified: / 19.6.1998 / 00:34:53 / cg" |
665 | 1005 |
! |
1006 |
||
940 | 1007 |
detectItem:aBlock |
1008 |
"evaluate the argument, aBlock for each item in the menu until the |
|
1009 |
block returns true; in this case return the item which caused the |
|
1010 |
true evaluation. |
|
1011 |
If none of the evaluations returns true, return the result of the |
|
1012 |
evaluation of the exceptionBlock |
|
1013 |
" |
|
1014 |
^ self detectItem:aBlock ifNone:[self errorNotFound] |
|
1015 |
||
1016 |
! |
|
1017 |
||
1018 |
detectItem:aBlock ifNone:exceptionBlock |
|
1019 |
"evaluate the argument, aBlock for each item in the menu until the |
|
1020 |
block returns true; in this case return the item which caused the |
|
1021 |
true evaluation. |
|
1022 |
If none of the evaluations returns true, return the result of the |
|
1023 |
evaluation of the exceptionBlock |
|
1024 |
" |
|
1025 |
items notNil ifTrue:[ |
|
1026 |
^ items detect:aBlock ifNone:exceptionBlock |
|
1027 |
]. |
|
1028 |
^ exceptionBlock value |
|
1029 |
! |
|
1030 |
||
589 | 1031 |
itemsDo:aOneArgBlock |
1032 |
"evaluate the block for each item in the current menu |
|
1033 |
" |
|
1034 |
items notNil ifTrue:[items do:aOneArgBlock] |
|
1035 |
! |
|
1036 |
||
584 | 1037 |
menuAndSubmenusDetectItem:aOneArgBlock |
1038 |
"evaluate the block for each item in the current menu and all |
|
1039 |
submenus. In case that the block returns a non nil argument, |
|
1040 |
the item will be returned |
|
1041 |
" |
|
724 | 1042 |
|item| |
584 | 1043 |
|
1044 |
items notNil ifTrue:[ |
|
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1045 |
items do:[:anItem| |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1046 |
|sub| |
724 | 1047 |
|
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1048 |
(aOneArgBlock value:anItem) ifTrue:[ |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1049 |
^ anItem |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1050 |
]. |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1051 |
(sub := anItem submenu) notNil ifTrue:[ |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1052 |
item := sub menuAndSubmenusDetectItem:aOneArgBlock. |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1053 |
item notNil ifTrue:[ |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1054 |
^ item |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1055 |
] |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1056 |
] |
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1057 |
] |
584 | 1058 |
]. |
724 | 1059 |
^ nil |
1060 |
||
972
09bc0765dbc1
no need to send submenu value - the item does it now.
Claus Gittinger <cg@exept.de>
parents:
950
diff
changeset
|
1061 |
"Modified: / 19.6.1998 / 00:35:00 / cg" |
584 | 1062 |
! ! |
1063 |
||
672
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1064 |
!Menu methodsFor:'kludged fixes'! |
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1065 |
|
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1066 |
destroy |
1599 | 1067 |
"dummy to allow a menu to be used where a MenuView used to be" |
672
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1068 |
|
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1069 |
"Created: 28.7.1997 / 10:16:52 / cg" |
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1070 |
! ! |
2db4bb41aa93
added dummy #destroy (q&d hack)
Claus Gittinger <cg@exept.de>
parents:
665
diff
changeset
|
1071 |
|
584 | 1072 |
!Menu methodsFor:'menu items'! |
1073 |
||
2404 | 1074 |
removeAllAccelerators |
1075 |
self allItemsDo:[:eachItem | |
|
1076 |
eachItem shortcutKey:nil. |
|
1077 |
]. |
|
1078 |
! |
|
1079 |
||
740 | 1080 |
someMenuItemLabeled:aLabel |
1081 |
"get the menu item with that label; in case that the label |
|
1082 |
is not found, nil is returned |
|
1083 |
" |
|
1084 |
^ self someMenuItemLabeled:aLabel ifNone:nil |
|
1085 |
||
1086 |
"Created: / 14.11.1997 / 20:55:17 / cg" |
|
1087 |
! |
|
1088 |
||
1089 |
someMenuItemLabeled:aLabel ifNone:exceptionBlock |
|
1090 |
"get the menu item labeled aLabel; in case that the value |
|
1091 |
is not found, the given exceptionBlock is executed and its value returned |
|
1092 |
" |
|
1093 |
|item| |
|
1094 |
||
1095 |
item := self menuAndSubmenusDetectItem:[:anItem| anItem label = aLabel]. |
|
1096 |
||
1097 |
item notNil ifTrue:[ |
|
1098 |
^ item |
|
1099 |
]. |
|
1100 |
^ exceptionBlock value |
|
1101 |
||
1102 |
"Created: / 14.11.1997 / 20:56:13 / cg" |
|
1103 |
! |
|
1104 |
||
584 | 1105 |
someMenuItemWithValue:aValue |
1106 |
"get the menu item assigned with the value; in case that the value |
|
1107 |
is not found nil is returned |
|
1108 |
" |
|
1109 |
^ self someMenuItemWithValue:aValue ifNone:nil |
|
1110 |
! |
|
1111 |
||
1112 |
someMenuItemWithValue:aValue ifNone:exceptionBlock |
|
1113 |
"get the menu item assigned with the value; in case that the value |
|
1114 |
is not found, the given exceptionBlock is executed and returned |
|
1115 |
" |
|
1116 |
|item| |
|
1117 |
||
1118 |
item := self menuAndSubmenusDetectItem:[:anItem| anItem value == aValue]. |
|
1119 |
||
1120 |
item notNil ifTrue:[ |
|
740 | 1121 |
^ item |
584 | 1122 |
]. |
1123 |
^ exceptionBlock value |
|
1124 |
! ! |
|
1125 |
||
1126 |
!Menu methodsFor:'queries'! |
|
1127 |
||
724 | 1128 |
hasHiddenItems |
1129 |
"test whether any item is hidden" |
|
1130 |
||
1131 |
self allItemsDo:[:anItem| |
|
740 | 1132 |
anItem isHidden ifTrue:[^ true] |
724 | 1133 |
]. |
1134 |
^ false |
|
1135 |
||
1136 |
"Modified: / 27.10.1997 / 15:12:44 / cg" |
|
1137 |
! |
|
1138 |
||
2584 | 1139 |
hasItems |
1140 |
"test whether there are any menu-items" |
|
1141 |
||
1142 |
^ items notEmptyOrNil |
|
1143 |
! |
|
1144 |
||
584 | 1145 |
hasSubMenuAt:anIndex |
1146 |
"test whether the menu item at the given index has a submenu |
|
1147 |
" |
|
1148 |
^ (self menuItemAt:anIndex) hasSubmenu |
|
1149 |
! ! |
|
1150 |
||
451 | 1151 |
!Menu methodsFor:'startup'! |
1152 |
||
729 | 1153 |
show |
1154 |
"realize the menu at its last position; returns the value associated with the |
|
1155 |
selected item, 0 if none was selected" |
|
1156 |
||
1157 |
^ (MenuPanel menu:self) show ? 0 |
|
1158 |
||
1159 |
||
1160 |
! |
|
1161 |
||
1162 |
showAt:aPoint |
|
1163 |
"realize the menu at aPoint; returns the value associated with the |
|
1164 |
selected item, 0 if none was selected" |
|
1165 |
||
1166 |
^ self showAt:aPoint resizing:true |
|
1167 |
||
1168 |
||
1169 |
! |
|
1170 |
||
1171 |
showAt:aPoint resizing:aBoolean |
|
1172 |
"realize the menu at aPoint; returns the value associated with the |
|
451 | 1173 |
selected item, 0 if none was selected" |
1174 |
||
996
1e10d01c90b8
careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
1175 |
^ ((MenuPanel menu:self) showAt:aPoint resizing:aBoolean) ? 0 |
1e10d01c90b8
careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
1176 |
|
1e10d01c90b8
careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
1177 |
"Modified: / 8.7.1998 / 19:57:55 / cg" |
729 | 1178 |
! |
1179 |
||
1180 |
showAtPointer |
|
1181 |
"realize the menu at the current pointer position; returns the value associated with the |
|
1182 |
selected item, 0 if none was selected" |
|
1183 |
||
1184 |
^ self startUp |
|
1185 |
! |
|
457 | 1186 |
|
729 | 1187 |
showCenteredIn:aView |
1188 |
"realize the menu visible at the aView center; returns the value associated with the |
|
1189 |
selected item, 0 if none was selected" |
|
1190 |
||
996
1e10d01c90b8
careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
1191 |
^ ((MenuPanel menu:self) showCenteredIn:aView) ? 0 |
729 | 1192 |
|
996
1e10d01c90b8
careful: ? is a binary selector.
Claus Gittinger <cg@exept.de>
parents:
977
diff
changeset
|
1193 |
"Modified: / 8.7.1998 / 19:58:05 / cg" |
729 | 1194 |
! |
1195 |
||
1196 |
startUp |
|
1197 |
"display the menu as a popUp; returns the value associated with the |
|
2039 | 1198 |
selected item, nil if none was selected. |
1199 |
(should we return 0 form ST-80 compatibility ?)" |
|
729 | 1200 |
|
1367 | 1201 |
^ (MenuPanel menu:self) startUp "/ ? 0 |
451 | 1202 |
|
579 | 1203 |
" |
1367 | 1204 |
|m| |
579 | 1205 |
|
1367 | 1206 |
m := #(#Menu #( |
1207 |
#(#MenuItem |
|
1208 |
#rawLabel: 'left' |
|
1209 |
#value: #left ) |
|
1210 |
#(#MenuItem |
|
1211 |
#rawLabel: 'center' |
|
1212 |
#value: #center ) |
|
1213 |
#(#MenuItem |
|
1214 |
#rawLabel: 'right' |
|
1215 |
#value: #right ) ) |
|
1216 |
#(2) |
|
1217 |
nil |
|
1218 |
) decodeAsLiteralArray. |
|
451 | 1219 |
|
579 | 1220 |
Transcript showCR:(m startUp) |
1221 |
" |
|
938
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1222 |
! |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1223 |
|
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1224 |
startUpAt:aPoint |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1225 |
"display the menu as a popUp at aPoint; returns the value associated with the |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1226 |
selected item, 0 if none was selected" |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1227 |
|
939 | 1228 |
^ ((MenuPanel menu:self) startUpAt:aPoint) ? 0 |
938
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1229 |
|
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1230 |
" |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1231 |
|m| |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1232 |
|
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1233 |
m := #(#Menu #( |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1234 |
#(#MenuItem |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1235 |
#rawLabel: 'left' |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1236 |
#value: #left ) |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1237 |
#(#MenuItem |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1238 |
#rawLabel: 'center' |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1239 |
#value: #center ) |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1240 |
#(#MenuItem |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1241 |
#rawLabel: 'right' |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1242 |
#value: #right ) ) |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1243 |
#(2) |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1244 |
nil |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1245 |
) decodeAsLiteralArray. |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1246 |
|
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1247 |
Transcript showCR:(m startUpAt:100@100) |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1248 |
" |
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1249 |
|
dfa1b1666cfa
added #startUpAt: (MenuView compatibility)
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1250 |
"Created: / 21.5.1998 / 14:15:21 / cg" |
939 | 1251 |
"Modified: / 21.5.1998 / 14:17:46 / cg" |
1367 | 1252 |
! |
1253 |
||
1652 | 1254 |
startUpFor:originatingWidget |
1255 |
"display the menu as a popUp; returns the value associated with the |
|
2039 | 1256 |
selected item, nil if none was selected. |
1257 |
(should we return 0 for ST-80 compatibility ?)" |
|
1652 | 1258 |
|
1259 |
^ (MenuPanel menu:self) startUpFor:originatingWidget "/ ? 0 |
|
1260 |
||
1261 |
" |
|
1262 |
|m| |
|
1263 |
||
1264 |
m := #(#Menu #( |
|
1265 |
#(#MenuItem |
|
1266 |
#rawLabel: 'left' |
|
1267 |
#value: #left ) |
|
1268 |
#(#MenuItem |
|
1269 |
#rawLabel: 'center' |
|
1270 |
#value: #center ) |
|
1271 |
#(#MenuItem |
|
1272 |
#rawLabel: 'right' |
|
1273 |
#value: #right ) ) |
|
1274 |
#(2) |
|
1275 |
nil |
|
1276 |
) decodeAsLiteralArray. |
|
1277 |
||
1278 |
Transcript showCR:(m startUp) |
|
1279 |
" |
|
1280 |
! |
|
1281 |
||
1367 | 1282 |
startUpOrNil |
1283 |
"display the menu as a popUp; returns the value associated with the |
|
1284 |
selected item, nil if none was selected" |
|
1285 |
||
1405
c7775c10e8fd
tolerant literalDecoding (missing 2nd and 3rd elements);
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
1286 |
^ (MenuPanel menu:self) startUpOrNil |
451 | 1287 |
! ! |
1288 |
||
2967
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1289 |
!Menu methodsFor:'utilities'! |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1290 |
|
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1291 |
replaceArgument: oldValue with: newValue |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1292 |
|
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1293 |
"Recusively Replace argument in menu items where |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1294 |
current argument is equal to oldValue by newValue" |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1295 |
|
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1296 |
self itemsDo:[:item| |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1297 |
item replaceArgument: oldValue with: newValue |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1298 |
] |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1299 |
|
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1300 |
"Created: / 12-10-2011 / 20:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1301 |
! ! |
c50ab5fa6cf0
Added #replaceArgument:with:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2952
diff
changeset
|
1302 |
|
451 | 1303 |
!Menu class methodsFor:'documentation'! |
1304 |
||
2764 | 1305 |
version_CVS |
3340 | 1306 |
^ '$Header: /cvs/stx/stx/libview2/Menu.st,v 1.92 2014-05-23 07:19:21 cg Exp $' |
451 | 1307 |
! ! |
3117
3c7f6b69b2c5
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
3028
diff
changeset
|
1308 |