author | Claus Gittinger <cg@exept.de> |
Thu, 06 May 1999 20:53:16 +0200 | |
changeset 1165 | 70fd3edc13b4 |
parent 1044 | 5ecf46d0f1b7 |
child 1196 | 27897663fc97 |
permissions | -rw-r--r-- |
451 | 1 |
Object subclass:#MenuItem |
752 | 2 |
instanceVariableNames:'activeHelpKey enabled label value nameKey adornment |
798 | 3 |
translateLabel isButton startGroup isVisible' |
451 | 4 |
classVariableNames:'' |
5 |
poolDictionaries:'' |
|
6 |
category:'Views-Support' |
|
7 |
! |
|
8 |
||
9 |
Object subclass:#MenuItemAdornment |
|
666 | 10 |
instanceVariableNames:'color indication submenu submenuChannel shortcutKey labelText |
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
11 |
labelImage accessCharacterPosition argument choice choiceValue' |
451 | 12 |
classVariableNames:'' |
13 |
poolDictionaries:'' |
|
14 |
privateIn:MenuItem |
|
15 |
! |
|
16 |
||
17 |
!MenuItem class methodsFor:'documentation'! |
|
18 |
||
19 |
documentation |
|
20 |
" |
|
21 |
not yet finished MenuItem class - this will eventually replace |
|
22 |
most of the MenuView and PopUpMenu stuff. |
|
23 |
(and hopefully be ST-80 compatible ...) |
|
24 |
||
25 |
For now, only a subset of the full protocol is implemented. |
|
26 |
||
27 |
[author:] |
|
28 |
Claus Gittinger |
|
29 |
||
30 |
[see also:] |
|
31 |
MenuItem |
|
32 |
PopUpMenu |
|
33 |
" |
|
34 |
||
35 |
! ! |
|
36 |
||
490 | 37 |
!MenuItem class methodsFor:'instance creation'! |
38 |
||
1044 | 39 |
label:aString |
40 |
"create and return a new menuItem, given a label string" |
|
41 |
||
42 |
^ self new label:aString |
|
43 |
||
44 |
"Modified: / 4.8.1998 / 17:33:13 / cg" |
|
45 |
"Created: / 14.8.1998 / 19:19:14 / cg" |
|
46 |
! |
|
47 |
||
1030
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
48 |
label:labelString value:selectorOrValue |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
49 |
"create and return a new menuItem, given its label and value" |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
50 |
|
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
51 |
^ (self new) label:labelString; value:selectorOrValue; yourself |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
52 |
|
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
53 |
"Created: / 4.8.1998 / 17:34:18 / cg" |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
54 |
! |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
55 |
|
490 | 56 |
labeled:aString |
1030
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
57 |
"create and return a new menuItem, given a label string" |
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
58 |
|
490 | 59 |
^ self new label:aString |
1030
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
60 |
|
3684379a1ac8
added inst-creation #label:value:
Claus Gittinger <cg@exept.de>
parents:
985
diff
changeset
|
61 |
"Modified: / 4.8.1998 / 17:33:13 / cg" |
490 | 62 |
! ! |
63 |
||
724 | 64 |
!MenuItem methodsFor:'ST-80 compatibility'! |
65 |
||
66 |
isEnabled:aBoolean |
|
67 |
self enabled:aBoolean |
|
68 |
||
69 |
"Created: / 27.10.1997 / 16:34:55 / cg" |
|
70 |
! ! |
|
71 |
||
451 | 72 |
!MenuItem methodsFor:'accessing'! |
73 |
||
579 | 74 |
accessCharacterPosition |
75 |
"get the index of the access character in the label text or string, or nil if none |
|
76 |
" |
|
77 |
adornment notNil ifTrue:[ |
|
78 |
^ adornment accessCharacterPosition |
|
79 |
]. |
|
80 |
^ nil |
|
451 | 81 |
! |
82 |
||
579 | 83 |
accessCharacterPosition:index |
84 |
"set the index of the access character in the label text or string, or nil if none |
|
85 |
" |
|
86 |
(index isNil and:[adornment isNil]) ifFalse:[ |
|
87 |
self adornment accessCharacterPosition:index |
|
88 |
] |
|
451 | 89 |
! |
90 |
||
640 | 91 |
activeHelpKey |
92 |
^ activeHelpKey |
|
93 |
! |
|
94 |
||
95 |
activeHelpKey:aKey |
|
96 |
activeHelpKey := aKey |
|
97 |
! |
|
98 |
||
684 | 99 |
argument |
100 |
"get argument given to the value (selector) |
|
101 |
" |
|
102 |
adornment notNil ifTrue:[ |
|
103 |
^ adornment argument |
|
104 |
]. |
|
105 |
^ nil |
|
106 |
! |
|
107 |
||
108 |
argument:something |
|
109 |
"set argument given to the value (selector) |
|
110 |
" |
|
111 |
|arg| |
|
112 |
||
113 |
(arg := something) notNil ifTrue:[ |
|
114 |
arg isString ifTrue:[ |
|
115 |
(arg size == 0 or:[(arg indexOfNonSeparatorStartingAt:1) == 0]) ifTrue:[ |
|
116 |
arg := nil |
|
117 |
] |
|
118 |
] |
|
119 |
]. |
|
120 |
||
121 |
(arg isNil and:[adornment isNil]) ifFalse:[ |
|
122 |
self adornment argument:arg |
|
123 |
] |
|
124 |
! |
|
125 |
||
798 | 126 |
isVisible |
127 |
^ isVisible ? true |
|
128 |
! |
|
129 |
||
130 |
isVisible:something |
|
131 |
isVisible := something |
|
132 |
! |
|
133 |
||
451 | 134 |
label |
973 | 135 |
^ self filteredLabel "/ label |
451 | 136 |
|
973 | 137 |
"Created: / 25.2.1997 / 19:48:16 / cg" |
138 |
"Modified: / 19.6.1998 / 00:02:55 / cg" |
|
451 | 139 |
! |
140 |
||
453 | 141 |
label:aString |
142 |
label := aString |
|
143 |
||
144 |
"Created: 25.2.1997 / 19:55:16 / cg" |
|
145 |
! |
|
146 |
||
581 | 147 |
labelImage |
148 |
"gets the labelImage |
|
149 |
" |
|
150 |
adornment notNil ifTrue:[ |
|
584 | 151 |
^ adornment labelImage value |
581 | 152 |
]. |
153 |
^ nil |
|
154 |
! |
|
155 |
||
156 |
labelImage:aResourceRetriever |
|
157 |
"set the labelImage |
|
158 |
" |
|
159 |
aResourceRetriever notNil ifTrue:[ |
|
160 |
self adornment labelImage:aResourceRetriever |
|
161 |
] |
|
162 |
! |
|
163 |
||
578 | 164 |
nameKey |
165 |
^ nameKey |
|
166 |
||
167 |
||
168 |
! |
|
169 |
||
170 |
nameKey:aNameKey |
|
579 | 171 |
nameKey := aNameKey. |
578 | 172 |
|
173 |
||
174 |
! |
|
175 |
||
490 | 176 |
rawLabel |
177 |
^ label |
|
178 |
||
179 |
"Created: 25.2.1997 / 19:48:16 / cg" |
|
180 |
! |
|
181 |
||
451 | 182 |
rawLabel:aString |
183 |
label := aString |
|
184 |
||
185 |
"Created: 25.2.1997 / 19:11:02 / cg" |
|
186 |
! |
|
187 |
||
490 | 188 |
shortcutKeyCharacter |
189 |
"ignored for now" |
|
190 |
||
578 | 191 |
adornment notNil ifTrue:[ |
192 |
^ adornment shortcutKeyCharacter |
|
193 |
]. |
|
490 | 194 |
^ nil |
195 |
! |
|
196 |
||
578 | 197 |
shortcutKeyCharacter:aKey |
198 |
"set the key to press to select the menu item from the keyboard |
|
199 |
" |
|
579 | 200 |
(aKey isNil and:[adornment isNil]) ifFalse:[ |
201 |
self adornment shortcutKeyCharacter:aKey |
|
202 |
] |
|
578 | 203 |
! |
204 |
||
794 | 205 |
startGroup |
206 |
"start group #left #right #center ... or nil |
|
207 |
at the moment only #right is implemented |
|
208 |
" |
|
209 |
^ startGroup |
|
210 |
! |
|
211 |
||
212 |
startGroup:aSymbol |
|
213 |
"start group #left #right #center ... |
|
214 |
at the moment only #right is implemented |
|
215 |
" |
|
216 |
(startGroup isNil or:[startGroup == #right]) ifTrue:[ |
|
217 |
startGroup := aSymbol |
|
218 |
] ifFalse:[ |
|
219 |
self warn:('not supported group: ', aSymbol printString ). |
|
220 |
] |
|
221 |
! |
|
222 |
||
458 | 223 |
submenu |
578 | 224 |
adornment notNil ifTrue:[ |
225 |
^ adornment submenu |
|
226 |
]. |
|
227 |
^ nil |
|
458 | 228 |
|
229 |
"Created: 25.2.1997 / 20:57:24 / cg" |
|
230 |
! |
|
231 |
||
232 |
submenu:aMenu |
|
233 |
self adornment submenu:aMenu |
|
234 |
||
235 |
"Created: 25.2.1997 / 20:56:20 / cg" |
|
236 |
! |
|
237 |
||
666 | 238 |
submenuChannel |
239 |
adornment notNil ifTrue:[ |
|
240 |
^ adornment submenuChannel |
|
241 |
]. |
|
242 |
^ nil |
|
243 |
! |
|
244 |
||
245 |
submenuChannel:something |
|
246 |
self adornment submenuChannel:something |
|
247 |
! |
|
248 |
||
451 | 249 |
value |
250 |
^ value |
|
251 |
||
252 |
"Created: 25.2.1997 / 19:50:14 / cg" |
|
253 |
! |
|
254 |
||
255 |
value:something |
|
256 |
value := something |
|
257 |
||
258 |
"Created: 25.2.1997 / 19:11:13 / cg" |
|
259 |
! ! |
|
260 |
||
579 | 261 |
!MenuItem methodsFor:'accessing behavior'! |
262 |
||
590 | 263 |
beOff |
264 |
"set indication off |
|
265 |
" |
|
266 |
self indication:false |
|
267 |
! |
|
268 |
||
269 |
beOn |
|
270 |
"set indication on |
|
271 |
" |
|
272 |
self indication:true |
|
273 |
! |
|
274 |
||
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
275 |
choice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
276 |
"return the menu items choice indicator (RadioButton) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
277 |
" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
278 |
adornment notNil ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
279 |
^ adornment choice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
280 |
]. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
281 |
^ nil |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
282 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
283 |
"Created: / 14.8.1998 / 14:34:55 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
284 |
"Modified: / 14.8.1998 / 15:11:57 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
285 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
286 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
287 |
choice:aChoice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
288 |
"set the menu items choice indicator (RadioButton) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
289 |
" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
290 |
(aChoice notNil or:[adornment notNil]) ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
291 |
self adornment choice:aChoice. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
292 |
]. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
293 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
294 |
"Created: / 14.8.1998 / 15:11:17 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
295 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
296 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
297 |
choiceValue |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
298 |
"return the menu items choiceValue (RadioButton) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
299 |
" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
300 |
adornment notNil ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
301 |
^ adornment choiceValue |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
302 |
]. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
303 |
^ nil |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
304 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
305 |
"Modified: / 14.8.1998 / 15:11:57 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
306 |
"Created: / 14.8.1998 / 15:38:05 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
307 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
308 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
309 |
choiceValue:something |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
310 |
"set the menu items choiceValue (RadioButton) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
311 |
" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
312 |
(something notNil or:[adornment notNil]) ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
313 |
self adornment choiceValue:something. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
314 |
]. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
315 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
316 |
"Created: / 14.8.1998 / 15:39:12 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
317 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
318 |
|
579 | 319 |
disable |
320 |
enabled := false |
|
321 |
||
322 |
"Created: 25.2.1997 / 19:39:09 / cg" |
|
323 |
! |
|
324 |
||
325 |
enable |
|
326 |
enabled := true |
|
327 |
||
328 |
"Created: 25.2.1997 / 19:39:00 / cg" |
|
329 |
! |
|
330 |
||
581 | 331 |
enabled |
332 |
"returns a boolean, valueHolder or block |
|
333 |
" |
|
334 |
^ enabled |
|
335 |
! |
|
579 | 336 |
|
581 | 337 |
enabled:something |
338 |
"a boolean, valueHolder or block |
|
339 |
" |
|
340 |
enabled := something |
|
590 | 341 |
! |
342 |
||
343 |
indication |
|
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
344 |
"return the menu items on/off indicator (CheckToggle) |
590 | 345 |
" |
346 |
adornment notNil ifTrue:[ |
|
347 |
^ adornment indication |
|
348 |
]. |
|
349 |
^ nil |
|
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
350 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
351 |
"Modified: / 14.8.1998 / 15:11:37 / cg" |
590 | 352 |
! |
353 |
||
354 |
indication:anIndication |
|
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
355 |
"set the menu items an on/off indicator (CheckToggle) |
590 | 356 |
" |
357 |
(anIndication notNil or:[adornment notNil]) ifTrue:[ |
|
358 |
self adornment indication:anIndication. |
|
359 |
]. |
|
360 |
||
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
361 |
"Modified: / 14.8.1998 / 15:11:25 / cg" |
752 | 362 |
! |
363 |
||
364 |
isButton |
|
365 |
"returns whether item looks like a Button |
|
366 |
" |
|
367 |
^isButton ? false |
|
368 |
||
369 |
||
370 |
! |
|
371 |
||
372 |
isButton:anBoolean |
|
373 |
"sets whether item looks like a Button |
|
374 |
" |
|
375 |
isButton := anBoolean |
|
376 |
||
377 |
||
378 |
! |
|
379 |
||
380 |
translateLabel |
|
381 |
"returns whether label is translated |
|
382 |
" |
|
383 |
^translateLabel ? false |
|
384 |
||
385 |
||
386 |
! |
|
387 |
||
388 |
translateLabel:anBoolean |
|
389 |
"sets whether label is translated |
|
390 |
" |
|
391 |
translateLabel := anBoolean |
|
392 |
||
393 |
||
581 | 394 |
! ! |
395 |
||
396 |
!MenuItem methodsFor:'accessing resource'! |
|
397 |
||
584 | 398 |
findGuiResourcesIn:aResourceContainerOrApplication |
581 | 399 |
"setup a resource container |
400 |
" |
|
960
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
401 |
|lblImg m| |
581 | 402 |
|
752 | 403 |
self translateLabel ifTrue:[ |
404 |
label := ResourceRetriever findResourceLabel: label in: aResourceContainerOrApplication |
|
405 |
]. |
|
406 |
||
584 | 407 |
adornment notNil ifTrue:[ |
752 | 408 |
(lblImg := adornment labelImage) notNil ifTrue:[ |
409 |
lblImg findGuiResourcesIn:aResourceContainerOrApplication. |
|
410 |
lblImg labelText notNil ifTrue: [lblImg labelText: label]. |
|
411 |
]. |
|
960
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
412 |
(m := adornment submenu) notNil ifTrue:[ |
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
413 |
m := m value. |
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
414 |
m notNil ifTrue:[ |
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
415 |
m findGuiResourcesIn:aResourceContainerOrApplication |
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
416 |
] |
752 | 417 |
]. |
581 | 418 |
] |
960
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
419 |
|
fee5a1a50374
adornments submenu may be a valueHolder.
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
420 |
"Modified: / 18.6.1998 / 16:54:25 / cg" |
579 | 421 |
! ! |
422 |
||
451 | 423 |
!MenuItem methodsFor:'converting'! |
424 |
||
425 |
fromLiteralArrayEncoding:aLiteralEncodedArray |
|
426 |
"read my contents from a aLiteralEncodedArray" |
|
427 |
||
428 |
2 to:aLiteralEncodedArray size by:2 do:[:i | |
|
429 |
|selector value| |
|
430 |
||
431 |
selector := aLiteralEncodedArray at:i. |
|
581 | 432 |
value := (aLiteralEncodedArray at:i+1) decodeAsLiteralArray. |
433 |
self perform:selector with:value |
|
451 | 434 |
]. |
435 |
||
436 |
" |
|
578 | 437 |
#( #MenuItem #rawLabel: 'left' #nameKey: 'identifier' #value: #left ) |
451 | 438 |
decodeAsLiteralArray |
439 |
" |
|
440 |
||
441 |
"Modified: 25.2.1997 / 19:24:22 / cg" |
|
490 | 442 |
! |
443 |
||
444 |
literalArrayEncoding |
|
445 |
"return myself encoded as a literal array" |
|
446 |
||
581 | 447 |
|coll something| |
490 | 448 |
|
449 |
coll := OrderedCollection new. |
|
450 |
coll add:#MenuItem. |
|
581 | 451 |
|
452 |
label notNil ifTrue:[ |
|
453 |
coll add:#label: ; add:(label literalArrayEncoding) |
|
454 |
]. |
|
752 | 455 |
self translateLabel ifTrue:[ |
456 |
coll add:#translateLabel: ; add:(translateLabel literalArrayEncoding) |
|
457 |
]. |
|
458 |
self isButton ifTrue:[ |
|
459 |
coll add:#isButton:; add:(isButton literalArrayEncoding) |
|
460 |
]. |
|
581 | 461 |
nameKey notNil ifTrue:[ |
462 |
coll add:#nameKey: ; add:(nameKey literalArrayEncoding) |
|
463 |
]. |
|
798 | 464 |
isVisible notNil ifTrue:[ |
465 |
isVisible ~~ true ifTrue:[ |
|
466 |
coll add:#isVisible: ; add:(isVisible literalArrayEncoding) |
|
467 |
] |
|
468 |
]. |
|
794 | 469 |
|
470 |
startGroup notNil ifTrue:[ |
|
471 |
coll add:#startGroup: ; add:(startGroup literalArrayEncoding) |
|
472 |
]. |
|
473 |
||
579 | 474 |
value notNil ifTrue:[ |
475 |
coll add:#value: ; add:(value literalArrayEncoding). |
|
476 |
]. |
|
653 | 477 |
activeHelpKey notNil ifTrue:[ |
478 |
coll add:#activeHelpKey: ; add:(activeHelpKey literalArrayEncoding). |
|
479 |
]. |
|
480 |
(something := self enabled) notNil ifTrue:[ |
|
481 |
coll add:#enabled: ; add:(enabled literalArrayEncoding). |
|
579 | 482 |
]. |
483 |
||
653 | 484 |
adornment notNil ifTrue:[ |
485 |
(something := self shortcutKeyCharacter) notNil ifTrue:[ |
|
486 |
coll add:#shortcutKeyCharacter: ; add:(something literalArrayEncoding) |
|
487 |
]. |
|
488 |
||
489 |
(something := self accessCharacterPosition) notNil ifTrue:[ |
|
490 |
coll add:#accessCharacterPosition: ; add:(something literalArrayEncoding) |
|
491 |
]. |
|
492 |
||
684 | 493 |
(something := self argument) notNil ifTrue:[ |
494 |
coll add:#argument: ; add:(something literalArrayEncoding) |
|
495 |
]. |
|
496 |
||
661 | 497 |
adornment labelImage notNil ifTrue:[ |
653 | 498 |
coll add:#labelImage: ; add:(adornment labelImage literalArrayEncoding) |
499 |
]. |
|
500 |
(something := self indication) notNil ifTrue:[ |
|
501 |
coll add:#indication: ; add:(something literalArrayEncoding) |
|
666 | 502 |
]. |
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
503 |
(something := self choice) notNil ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
504 |
coll add:#choice: ; add:(something literalArrayEncoding) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
505 |
]. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
506 |
(something := self choiceValue) notNil ifTrue:[ |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
507 |
coll add:#choiceValue: ; add:(something literalArrayEncoding) |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
508 |
]. |
579 | 509 |
|
666 | 510 |
(something := self submenuChannel) notNil ifTrue:[ |
511 |
coll add:#submenuChannel: ; add:(something literalArrayEncoding) |
|
512 |
]. |
|
513 |
||
514 |
self hasSubmenu ifTrue:[ |
|
515 |
coll add:#submenu:; add:(self submenu literalArrayEncoding) |
|
516 |
]. |
|
581 | 517 |
]. |
653 | 518 |
|
579 | 519 |
^ coll asArray |
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
520 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
521 |
"Modified: / 14.8.1998 / 15:44:53 / cg" |
451 | 522 |
! ! |
523 |
||
458 | 524 |
!MenuItem methodsFor:'private - accessing'! |
525 |
||
526 |
adornment |
|
527 |
adornment isNil ifTrue:[ |
|
528 |
adornment := MenuItemAdornment new |
|
529 |
]. |
|
530 |
^ adornment |
|
531 |
||
532 |
"Created: 25.2.1997 / 20:57:05 / cg" |
|
973 | 533 |
! |
534 |
||
535 |
filteredLabel |
|
536 |
"return the label without any &-chars" |
|
537 |
||
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
538 |
|rawLabel l in out c pos emp e| |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
539 |
|
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
540 |
rawLabel := self rawLabel. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
541 |
rawLabel isString ifFalse:[^ rawLabel]. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
542 |
|
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
543 |
"/ be careful to preserve any emphasis ... |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
544 |
"/ bad kludge ... |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
545 |
rawLabel isText ifTrue:[ |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
546 |
emp := RunArray new. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
547 |
]. |
973 | 548 |
|
549 |
out := WriteStream on:''. |
|
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
550 |
in := rawLabel readStream. |
973 | 551 |
[in atEnd] whileFalse:[ |
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
552 |
emp notNil ifTrue:[ |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
553 |
e := rawLabel emphasisAt:(in position). |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
554 |
]. |
973 | 555 |
c := in next. |
556 |
c == $& ifTrue:[ |
|
557 |
in peek == $& ifTrue:[ |
|
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
558 |
out nextPut:c. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
559 |
emp notNil ifTrue:[ |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
560 |
emp add:e |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
561 |
] |
973 | 562 |
] |
563 |
] ifFalse:[ |
|
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
564 |
out nextPut:c. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
565 |
emp notNil ifTrue:[ |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
566 |
emp add:e |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
567 |
] |
973 | 568 |
] |
569 |
]. |
|
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
570 |
l := out contents. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
571 |
emp notNil ifTrue:[ |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
572 |
^ Text string:l emphasisCollection:emp |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
573 |
]. |
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
574 |
^ l. |
973 | 575 |
|
576 |
"Created: / 19.6.1998 / 00:02:10 / cg" |
|
985
5a5b476cfd6b
care for Text & images in rawLabel, when filtering.
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
577 |
"Modified: / 20.6.1998 / 17:15:18 / cg" |
458 | 578 |
! ! |
579 |
||
579 | 580 |
!MenuItem methodsFor:'queries'! |
581 |
||
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
582 |
hasChoice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
583 |
"test whether choice exists |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
584 |
" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
585 |
^ self choice notNil |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
586 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
587 |
"Created: / 14.8.1998 / 14:34:29 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
588 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
589 |
|
590 | 590 |
hasIndication |
591 |
"test whether indication on/off exists |
|
592 |
" |
|
593 |
^ self indication notNil |
|
594 |
! |
|
595 |
||
579 | 596 |
hasSubmenu |
584 | 597 |
^ self submenu notNil |
579 | 598 |
|
599 |
"Created: 25.2.1997 / 20:56:20 / cg" |
|
600 |
! |
|
601 |
||
602 |
isEnabled |
|
581 | 603 |
^ enabled value ? true |
579 | 604 |
|
605 |
"Created: 25.2.1997 / 19:39:17 / cg" |
|
590 | 606 |
! |
607 |
||
724 | 608 |
isHidden |
609 |
"not yet supported" |
|
610 |
||
611 |
^ false |
|
612 |
||
613 |
"Created: / 27.10.1997 / 15:13:43 / cg" |
|
614 |
! |
|
615 |
||
590 | 616 |
isOff |
617 |
"test whether indication on/off exists and is off |
|
618 |
" |
|
619 |
|indication| |
|
620 |
||
621 |
indication := self indication. |
|
622 |
^ indication value == false |
|
623 |
! |
|
624 |
||
625 |
isOn |
|
626 |
"test whether indication on/off exists and is on |
|
627 |
" |
|
628 |
|indication| |
|
629 |
||
630 |
indication := self indication. |
|
631 |
^ indication value == true |
|
579 | 632 |
! ! |
633 |
||
458 | 634 |
!MenuItem::MenuItemAdornment methodsFor:'accessing'! |
635 |
||
579 | 636 |
accessCharacterPosition |
637 |
"return the value of the instance variable 'accessCharacterPosition' (automatically generated)" |
|
638 |
||
639 |
^ accessCharacterPosition! |
|
640 |
||
641 |
accessCharacterPosition:something |
|
642 |
"set the value of the instance variable 'accessCharacterPosition' (automatically generated)" |
|
643 |
||
644 |
accessCharacterPosition := something.! |
|
645 |
||
684 | 646 |
argument |
647 |
"return the value of the instance variable 'argument' (automatically generated)" |
|
648 |
||
649 |
^ argument |
|
650 |
||
651 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
652 |
! |
|
653 |
||
654 |
argument:something |
|
655 |
"set the value of the instance variable 'argument' (automatically generated)" |
|
656 |
||
657 |
argument := something. |
|
658 |
||
659 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
660 |
! |
|
661 |
||
1041
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
662 |
choice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
663 |
"return the value of the instance variable 'choice' (automatically generated)" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
664 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
665 |
^ choice |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
666 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
667 |
"Created: / 14.8.1998 / 14:32:06 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
668 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
669 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
670 |
choice:something |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
671 |
"set the value of the instance variable 'choice' (automatically generated)" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
672 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
673 |
choice := something. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
674 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
675 |
"Created: / 14.8.1998 / 14:32:06 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
676 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
677 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
678 |
choiceValue |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
679 |
"return the value of the instance variable 'choiceValue' (automatically generated)" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
680 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
681 |
^ choiceValue |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
682 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
683 |
"Created: / 14.8.1998 / 15:39:26 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
684 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
685 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
686 |
choiceValue:something |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
687 |
"set the value of the instance variable 'choiceValue' (automatically generated)" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
688 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
689 |
choiceValue := something. |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
690 |
|
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
691 |
"Created: / 14.8.1998 / 15:39:26 / cg" |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
692 |
! |
d28f0375cd26
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
1030
diff
changeset
|
693 |
|
458 | 694 |
color |
695 |
"return the value of the instance variable 'color' (automatically generated)" |
|
696 |
||
697 |
^ color |
|
698 |
||
699 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
700 |
! |
|
701 |
||
702 |
color:something |
|
703 |
"set the value of the instance variable 'color' (automatically generated)" |
|
704 |
||
705 |
color := something. |
|
706 |
||
707 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
708 |
! |
|
709 |
||
710 |
indication |
|
590 | 711 |
"test whether the menu item has an on/off indicator (CheckToggle) |
712 |
" |
|
458 | 713 |
^ indication |
714 |
||
715 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
716 |
! |
|
717 |
||
718 |
indication:something |
|
590 | 719 |
"test whether the menu item has an on/off indicator (CheckToggle) |
720 |
" |
|
458 | 721 |
indication := something. |
722 |
||
723 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
724 |
! |
|
725 |
||
581 | 726 |
labelImage |
727 |
"return the value of the instance variable 'labelImage' (automatically generated)" |
|
728 |
||
729 |
^ labelImage! |
|
730 |
||
731 |
labelImage:something |
|
732 |
"set the value of the instance variable 'labelImage' (automatically generated)" |
|
733 |
||
734 |
labelImage := something.! |
|
735 |
||
578 | 736 |
labelText |
737 |
"get the text appear as the menu label |
|
738 |
" |
|
739 |
^ labelText |
|
740 |
! |
|
741 |
||
742 |
labelText:something |
|
743 |
"set the text appear as the menu label |
|
744 |
" |
|
745 |
labelText := something. |
|
746 |
! |
|
747 |
||
748 |
shortcutKeyCharacter |
|
749 |
"get the key to press to select the menu item from the keyboard |
|
750 |
" |
|
751 |
^ shortcutKey |
|
752 |
! |
|
753 |
||
754 |
shortcutKeyCharacter:something |
|
755 |
"set the key to press to select the menu item from the keyboard |
|
756 |
" |
|
757 |
shortcutKey := something. |
|
758 |
! |
|
759 |
||
458 | 760 |
submenu |
578 | 761 |
"get the submenu or nil |
762 |
" |
|
973 | 763 |
^ submenu value |
458 | 764 |
|
973 | 765 |
"Created: / 25.2.1997 / 20:59:28 / cg" |
766 |
"Modified: / 19.6.1998 / 00:33:58 / cg" |
|
458 | 767 |
! |
768 |
||
769 |
submenu:something |
|
578 | 770 |
"set the submenu or nil |
771 |
" |
|
458 | 772 |
submenu := something. |
773 |
||
774 |
"Created: 25.2.1997 / 20:59:28 / cg" |
|
666 | 775 |
! |
776 |
||
777 |
submenuChannel |
|
778 |
"get the submenuChannel or nil |
|
779 |
" |
|
780 |
^ submenuChannel |
|
781 |
! |
|
782 |
||
783 |
submenuChannel:something |
|
784 |
"set the submenuChannel or nil |
|
785 |
" |
|
786 |
submenuChannel := something. |
|
973 | 787 |
! |
788 |
||
789 |
submenuHolder |
|
790 |
"get the submenuHolder or nil |
|
791 |
" |
|
792 |
^ submenu |
|
793 |
||
794 |
"Modified: / 19.6.1998 / 00:33:58 / cg" |
|
795 |
"Created: / 19.6.1998 / 00:34:32 / cg" |
|
458 | 796 |
! ! |
797 |
||
451 | 798 |
!MenuItem class methodsFor:'documentation'! |
799 |
||
800 |
version |
|
1044 | 801 |
^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.26 1998-08-14 17:19:24 cg Exp $' |
451 | 802 |
! ! |