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