MenuPanel.st
changeset 653 cf9b6ef11ade
parent 650 29dcdf6a5994
child 657 a8246e896fa3
--- a/MenuPanel.st	Mon Jan 12 11:17:54 1998 +0100
+++ b/MenuPanel.st	Mon Jan 12 14:49:19 1998 +0100
@@ -430,7 +430,7 @@
 
     self isPopUpView ifFalse:[
         self do:[:el| el updateIndicators].
-        self windowGroup processExposeEvents
+        self windowGroup processExposeEvents.
     ] ifTrue:[
         self destroy
     ].
@@ -438,8 +438,9 @@
 
     self isPopUpView ifTrue:[
         self menuAdornmentAt:#value put:value.
-        self menuAdornmentAt:#item  put:item
+        self menuAdornmentAt:#item  put:item.
     ].
+
   ^ item.
 
 !
@@ -1170,7 +1171,9 @@
 showGroupDivider:aState
     "set the enabled flag for showing groupDiveders
     "
-    self menuAdornmentAt:#showGroupDivider put:aState
+    (self menuAdornmentAt:#showGroupDivider put:aState) ifTrue:[
+        self mustRearrange.
+    ]
 !
 
 showSeparatingLines
@@ -1182,7 +1185,9 @@
 showSeparatingLines:aState
     "turn on/off drawing of separating lines.
     "
-    self menuAdornmentAt:#showSeparatingLines put:aState
+    (self menuAdornmentAt:#showSeparatingLines put:aState) ifTrue:[
+        self mustRearrange
+    ]
 !
 
 verticalLayout
@@ -1194,7 +1199,9 @@
 verticalLayout:aState
     "set the layout: or vertical( true ) or horizontal( false )
     "
-    self menuAdornmentAt:#verticalLayout put:aState.
+    (self menuAdornmentAt:#verticalLayout put:aState) ifTrue:[        
+        self mustRearrange
+    ]
 ! !
 
 !MenuPanel methodsFor:'accessing submenu'!
@@ -2325,15 +2332,17 @@
 !
 
 menuAdornmentAt:aSymbol put:something
-    "sets a value for the specific menu
+    "sets a value for the specific menu; if the value differs to the
+     current stored value, true is returned otherwise false
     "
-    (self menuAdornmentAt:aSymbol) ~~ something ifTrue:[
-        adornment isNil ifTrue:[
-            adornment := DefaultAdornment copy
-        ].
-        adornment at:aSymbol put:something.
-        self mustRearrange.
-    ]
+    (self menuAdornmentAt:aSymbol) == something ifTrue:[
+        ^ false
+    ].
+    adornment isNil ifTrue:[
+        adornment := DefaultAdornment copy
+    ].
+    adornment at:aSymbol put:something.
+  ^ true
 !
 
 onEachPerform:aSelector withArgList:aList
@@ -4043,6 +4052,6 @@
 !MenuPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.41 1998-01-09 15:53:27 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.42 1998-01-12 13:49:19 ca Exp $'
 ! !
 MenuPanel initialize!