submenu item send #value.
submenuHolder added (for the real submenu).
label returns the label without embedded &'s.
(thats what rawlabel is for)
--- a/MenuItem.st Fri Jun 19 00:58:02 1998 +0200
+++ b/MenuItem.st Fri Jun 19 00:59:17 1998 +0200
@@ -111,9 +111,10 @@
!
label
- ^ label
+ ^ self filteredLabel "/ label
- "Created: 25.2.1997 / 19:48:16 / cg"
+ "Created: / 25.2.1997 / 19:48:16 / cg"
+ "Modified: / 19.6.1998 / 00:02:55 / cg"
!
label:aString
@@ -453,6 +454,28 @@
^ adornment
"Created: 25.2.1997 / 20:57:05 / cg"
+!
+
+filteredLabel
+ "return the label without any &-chars"
+
+ |in out c|
+
+ out := WriteStream on:''.
+ in := self rawLabel readStream.
+ [in atEnd] whileFalse:[
+ c := in next.
+ c == $& ifTrue:[
+ in peek == $& ifTrue:[
+ out nextPut:c
+ ]
+ ] ifFalse:[
+ out nextPut:c
+ ]
+ ].
+ ^ out contents.
+
+ "Created: / 19.6.1998 / 00:02:10 / cg"
! !
!MenuItem methodsFor:'queries'!
@@ -598,9 +621,10 @@
submenu
"get the submenu or nil
"
- ^ submenu
+ ^ submenu value
- "Created: 25.2.1997 / 20:59:28 / cg"
+ "Created: / 25.2.1997 / 20:59:28 / cg"
+ "Modified: / 19.6.1998 / 00:33:58 / cg"
!
submenu:something
@@ -621,10 +645,19 @@
"set the submenuChannel or nil
"
submenuChannel := something.
+!
+
+submenuHolder
+ "get the submenuHolder or nil
+ "
+ ^ submenu
+
+ "Modified: / 19.6.1998 / 00:33:58 / cg"
+ "Created: / 19.6.1998 / 00:34:32 / cg"
! !
!MenuItem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.21 1998-06-18 14:54:43 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.22 1998-06-18 22:59:17 cg Exp $'
! !