perform action first, then reinstall autorepeat
authorClaus Gittinger <cg@exept.de>
Wed, 29 Jan 1997 13:26:15 +0100
changeset 985 6e8a73b27390
parent 984 dbd60475b3f5
child 986 7f50e27cb732
perform action first, then reinstall autorepeat
ButtonC.st
ButtonController.st
--- a/ButtonC.st	Wed Jan 29 13:24:42 1997 +0100
+++ b/ButtonC.st	Wed Jan 29 13:26:15 1997 +0100
@@ -541,6 +541,10 @@
     entered := true.
     enableChannel value ifTrue:[
         pressed ifTrue:[
+            isTriggerOnDown ifFalse:[
+                view showActive.
+            ].
+
             "
              reentered after a leave with mouse-button down;
              restart autorepeating and/or if I am a button with
@@ -549,9 +553,6 @@
             autoRepeat ifTrue:[
                 Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
             ].
-            isTriggerOnDown ifFalse:[
-                view showActive.
-            ]
         ] ifFalse:[
             view invalidate
         ]
@@ -566,6 +567,10 @@
 
     entered := false.
     pressed ifTrue:[
+        isTriggerOnDown ifFalse:[
+            view showPassive.
+        ].
+
         "
          leave with mouse-button down;
          stop autorepeating and/or if I am a button with
@@ -574,9 +579,6 @@
         autoRepeat ifTrue:[
             Processor removeTimedBlock:repeatBlock
         ].
-        isTriggerOnDown ifFalse:[
-            view showPassive.
-        ]
     ] ifFalse:[
         enableChannel value ifTrue:[
             view invalidate
@@ -593,14 +595,10 @@
 
     |dly|
 
-    pressed ifTrue:[
+    (pressed and:[entered]) ifTrue:[
         enableChannel value ifTrue:[
             active ifFalse:[
                 self performAction.
-"/                active := true.
-"/                releaseActionBlock notNil ifTrue:[releaseActionBlock value].
-"/                pressActionBlock notNil ifTrue:[pressActionBlock value].
-"/                active := false.
 
                 autoRepeat ifTrue:[
                     view graphicsDevice shiftDown ifTrue:[
@@ -640,5 +638,5 @@
 !ButtonController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.38 1997-01-27 15:00:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.39 1997-01-29 12:26:15 cg Exp $'
 ! !
--- a/ButtonController.st	Wed Jan 29 13:24:42 1997 +0100
+++ b/ButtonController.st	Wed Jan 29 13:26:15 1997 +0100
@@ -541,6 +541,10 @@
     entered := true.
     enableChannel value ifTrue:[
         pressed ifTrue:[
+            isTriggerOnDown ifFalse:[
+                view showActive.
+            ].
+
             "
              reentered after a leave with mouse-button down;
              restart autorepeating and/or if I am a button with
@@ -549,9 +553,6 @@
             autoRepeat ifTrue:[
                 Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
             ].
-            isTriggerOnDown ifFalse:[
-                view showActive.
-            ]
         ] ifFalse:[
             view invalidate
         ]
@@ -566,6 +567,10 @@
 
     entered := false.
     pressed ifTrue:[
+        isTriggerOnDown ifFalse:[
+            view showPassive.
+        ].
+
         "
          leave with mouse-button down;
          stop autorepeating and/or if I am a button with
@@ -574,9 +579,6 @@
         autoRepeat ifTrue:[
             Processor removeTimedBlock:repeatBlock
         ].
-        isTriggerOnDown ifFalse:[
-            view showPassive.
-        ]
     ] ifFalse:[
         enableChannel value ifTrue:[
             view invalidate
@@ -593,14 +595,10 @@
 
     |dly|
 
-    pressed ifTrue:[
+    (pressed and:[entered]) ifTrue:[
         enableChannel value ifTrue:[
             active ifFalse:[
                 self performAction.
-"/                active := true.
-"/                releaseActionBlock notNil ifTrue:[releaseActionBlock value].
-"/                pressActionBlock notNil ifTrue:[pressActionBlock value].
-"/                active := false.
 
                 autoRepeat ifTrue:[
                     view graphicsDevice shiftDown ifTrue:[
@@ -640,5 +638,5 @@
 !ButtonController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.38 1997-01-27 15:00:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.39 1997-01-29 12:26:15 cg Exp $'
 ! !