MenuItem.st
changeset 1370 4d2a3cc1d3c7
parent 1369 281acc9f1a73
child 1401 0fda9891ba4a
--- a/MenuItem.st	Thu Apr 27 12:57:45 2000 +0200
+++ b/MenuItem.st	Fri May 05 11:27:41 2000 +0200
@@ -24,7 +24,7 @@
 Object subclass:#MenuItemAdornment
 	instanceVariableNames:'color indication submenu submenuChannel shortcutKey labelText
 		labelImage accessCharacterPosition argument choice choiceValue
-		font auxValue showBusyCursorWhilePerforming'
+		font auxValue showBusyCursorWhilePerforming keepLinkedMenu'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:MenuItem
@@ -213,6 +213,28 @@
     isVisible := something
 !
 
+keepLinkedMenu
+    "an additional, arbitrary value"
+
+    adornment notNil ifTrue:[
+        ^ adornment keepLinkedMenu
+    ].
+    ^ false
+!
+
+keepLinkedMenu:aBoolean
+    "set the keepLinkedMenu
+    "
+    adornment notNil ifTrue:[
+        adornment keepLinkedMenu:aBoolean.
+    ] ifFalse:[
+        aBoolean == true ifTrue:[
+            "/ the default is false
+            self adornment keepLinkedMenu:true
+        ]
+    ].
+!
+
 label
     ^ self filteredLabel "/ label
 
@@ -634,7 +656,11 @@
         ].
 
         (something := self submenuChannel) notNil ifTrue:[
-            coll add:#submenuChannel: ; add:(something literalArrayEncoding)
+            coll add:#submenuChannel: ; add:(something literalArrayEncoding).
+
+            (something := self keepLinkedMenu) ifTrue:[
+                coll add:#keepLinkedMenu: ; add:true
+            ]
         ].
 
         self hasSubmenu ifTrue:[
@@ -877,6 +903,18 @@
     "Created: 25.2.1997 / 20:59:28 / cg"
 !
 
+keepLinkedMenu
+    "return the value of the instance variable 'keepLinkedMenu' (automatically generated)"
+
+    ^ keepLinkedMenu ? false
+!
+
+keepLinkedMenu:aBoolean
+    "set the value of the instance variable 'keepLinkedMenu' (automatically generated)"
+
+    keepLinkedMenu := aBoolean ? false.
+!
+
 labelImage
     "return the value of the instance variable 'labelImage' (automatically generated)"
 
@@ -992,5 +1030,5 @@
 !MenuItem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.39 2000-04-27 10:57:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MenuItem.st,v 1.40 2000-05-05 09:27:41 ca Exp $'
 ! !