451
|
1 |
Object subclass:#MenuItem
|
|
2 |
instanceVariableNames:'enabled label value nameKey'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Views-Support'
|
|
6 |
!
|
|
7 |
|
|
8 |
Object subclass:#MenuItemAdornment
|
|
9 |
instanceVariableNames:'color indication submenu'
|
|
10 |
classVariableNames:''
|
|
11 |
poolDictionaries:''
|
|
12 |
privateIn:MenuItem
|
|
13 |
!
|
|
14 |
|
|
15 |
!MenuItem class methodsFor:'documentation'!
|
|
16 |
|
|
17 |
documentation
|
|
18 |
"
|
|
19 |
not yet finished MenuItem class - this will eventually replace
|
|
20 |
most of the MenuView and PopUpMenu stuff.
|
|
21 |
(and hopefully be ST-80 compatible ...)
|
|
22 |
|
|
23 |
For now, only a subset of the full protocol is implemented.
|
|
24 |
|
|
25 |
[author:]
|
|
26 |
Claus Gittinger
|
|
27 |
|
|
28 |
[see also:]
|
|
29 |
MenuItem
|
|
30 |
PopUpMenu
|
|
31 |
"
|
|
32 |
|
|
33 |
! !
|
|
34 |
|
|
35 |
!MenuItem methodsFor:'accessing'!
|
|
36 |
|
|
37 |
disable
|
|
38 |
enabled := false
|
|
39 |
|
|
40 |
"Created: 25.2.1997 / 19:39:09 / cg"
|
|
41 |
!
|
|
42 |
|
|
43 |
enable
|
|
44 |
enabled := true
|
|
45 |
|
|
46 |
"Created: 25.2.1997 / 19:39:00 / cg"
|
|
47 |
!
|
|
48 |
|
|
49 |
enabled:aBoolean
|
|
50 |
enabled := aBoolean
|
|
51 |
|
|
52 |
"Created: 25.2.1997 / 19:39:27 / cg"
|
|
53 |
!
|
|
54 |
|
|
55 |
isEnabled
|
|
56 |
^ enabled ? true
|
|
57 |
|
|
58 |
"Created: 25.2.1997 / 19:39:17 / cg"
|
|
59 |
!
|
|
60 |
|
|
61 |
label
|
|
62 |
^ label
|
|
63 |
|
|
64 |
"Created: 25.2.1997 / 19:48:16 / cg"
|
|
65 |
!
|
|
66 |
|
|
67 |
rawLabel:aString
|
|
68 |
label := aString
|
|
69 |
|
|
70 |
"Created: 25.2.1997 / 19:11:02 / cg"
|
|
71 |
!
|
|
72 |
|
|
73 |
value
|
|
74 |
^ value
|
|
75 |
|
|
76 |
"Created: 25.2.1997 / 19:50:14 / cg"
|
|
77 |
!
|
|
78 |
|
|
79 |
value:something
|
|
80 |
value := something
|
|
81 |
|
|
82 |
"Created: 25.2.1997 / 19:11:13 / cg"
|
|
83 |
! !
|
|
84 |
|
|
85 |
!MenuItem methodsFor:'converting'!
|
|
86 |
|
|
87 |
fromLiteralArrayEncoding:aLiteralEncodedArray
|
|
88 |
"read my contents from a aLiteralEncodedArray"
|
|
89 |
|
|
90 |
2 to:aLiteralEncodedArray size by:2 do:[:i |
|
|
91 |
|selector value|
|
|
92 |
|
|
93 |
selector := aLiteralEncodedArray at:i.
|
|
94 |
value := (aLiteralEncodedArray at:i+1) decodeAsLiteralArray.
|
|
95 |
|
|
96 |
self perform:selector with:value
|
|
97 |
].
|
|
98 |
|
|
99 |
"
|
|
100 |
#( #MenuItem #rawLabel: 'left' #value: #left )
|
|
101 |
decodeAsLiteralArray
|
|
102 |
"
|
|
103 |
|
|
104 |
"Modified: 25.2.1997 / 19:24:22 / cg"
|
|
105 |
! !
|
|
106 |
|
|
107 |
!MenuItem class methodsFor:'documentation'!
|
|
108 |
|
|
109 |
version
|
|
110 |
^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.1 1997-02-25 18:53:41 cg Exp $'
|
|
111 |
! !
|