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