added ignoreReselect
authorClaus Gittinger <cg@exept.de>
Mon, 12 Aug 2002 13:04:32 +0200
changeset 2578 d5cdeaff2431
parent 2577 a6584be928e8
child 2579 74d3798f4200
added ignoreReselect
PopUpList.st
--- a/PopUpList.st	Fri Aug 09 16:29:48 2002 +0200
+++ b/PopUpList.st	Mon Aug 12 13:04:32 2002 +0200
@@ -14,7 +14,7 @@
 
 Button subclass:#PopUpList
 	instanceVariableNames:'menu menuAction values useIndex listMsg defaultLabel listHolder
-		showHandle'
+		showHandle ignoreReselect'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Views-Interactors'
@@ -626,6 +626,10 @@
     menuAction := aOneArgBlock
 !
 
+ignoreReselect:aBoolean 
+    ignoreReselect := aBoolean
+!
+
 menu:aMenu
     "explicit change of the menu; 
      allows for non-list-based, or MenuBuilder-constructed menus to be used.
@@ -900,6 +904,7 @@
 
     controller beTriggerOnDown.
     controller action:[self popMenu].
+    ignoreReselect := true.
     useIndex := false.
     defaultLabel := 'popup'.
     showHandle := true.
@@ -1125,7 +1130,11 @@
                 chg := #value:
             ]
         ].
-
+        ignoreReselect ifFalse:[
+            (value == model value) ifTrue:[
+                model setValue:nil.
+            ].
+        ].
         self sendChangeMessage:chg with:value.
     ].
 
@@ -1142,5 +1151,5 @@
 !PopUpList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpList.st,v 1.77 2001-12-08 13:29:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpList.st,v 1.78 2002-08-12 11:04:32 cg Exp $'
 ! !