oops - need fix, since order of model-notification vs. actionBlock
authorClaus Gittinger <cg@exept.de>
Mon, 27 Jan 1997 17:47:40 +0100
changeset 977 82696bdd308a
parent 976 ed2b99f9695a
child 978 6e678fdc6e5b
oops - need fix, since order of model-notification vs. actionBlock has changed
PopUpListController.st
PopUpLstC.st
--- a/PopUpListController.st	Mon Jan 27 16:00:15 1997 +0100
+++ b/PopUpListController.st	Mon Jan 27 17:47:40 1997 +0100
@@ -44,6 +44,36 @@
 
 !PopUpListController methodsFor:'event handling'!
 
+buttonPress:button x:x y:y
+    "redefined to not send any change message to the model when
+     pressed (this is done by the popped menu)"
+
+    (button == 1 or:[button == #select]) ifFalse:[
+        ^ super buttonPress:button x:x y:y
+    ].
+
+    enableChannel value ifTrue:[
+        pressed ifFalse:[
+            pressed := true.
+            view showActive.
+
+            (pressActionBlock notNil or:[model notNil]) ifTrue:[
+                "
+                 force output - so that button is drawn correctly in case
+                 of any long-computation (at high priority)
+                "
+                view flush.
+            ].
+
+            pressActionBlock value.
+
+        ]
+    ]
+
+    "Created: 27.1.1997 / 17:22:16 / cg"
+    "Modified: 27.1.1997 / 17:23:17 / cg"
+!
+
 keyPress:key x:x y:y
     "pull menu on Return and space, if I am the focusView of my group
      (i.e. if I got an explicit focus)"
@@ -81,5 +111,5 @@
 !PopUpListController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.10 1996-04-25 16:34:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpListController.st,v 1.11 1997-01-27 16:47:40 cg Exp $'
 ! !
--- a/PopUpLstC.st	Mon Jan 27 16:00:15 1997 +0100
+++ b/PopUpLstC.st	Mon Jan 27 17:47:40 1997 +0100
@@ -44,6 +44,36 @@
 
 !PopUpListController methodsFor:'event handling'!
 
+buttonPress:button x:x y:y
+    "redefined to not send any change message to the model when
+     pressed (this is done by the popped menu)"
+
+    (button == 1 or:[button == #select]) ifFalse:[
+        ^ super buttonPress:button x:x y:y
+    ].
+
+    enableChannel value ifTrue:[
+        pressed ifFalse:[
+            pressed := true.
+            view showActive.
+
+            (pressActionBlock notNil or:[model notNil]) ifTrue:[
+                "
+                 force output - so that button is drawn correctly in case
+                 of any long-computation (at high priority)
+                "
+                view flush.
+            ].
+
+            pressActionBlock value.
+
+        ]
+    ]
+
+    "Created: 27.1.1997 / 17:22:16 / cg"
+    "Modified: 27.1.1997 / 17:23:17 / cg"
+!
+
 keyPress:key x:x y:y
     "pull menu on Return and space, if I am the focusView of my group
      (i.e. if I got an explicit focus)"
@@ -81,5 +111,5 @@
 !PopUpListController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/PopUpLstC.st,v 1.10 1996-04-25 16:34:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/PopUpLstC.st,v 1.11 1997-01-27 16:47:40 cg Exp $'
 ! !