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