MenuPanel.st
changeset 2047 62de65e3a61b
parent 2046 012798480de6
child 2048 ba472f3f46c7
--- a/MenuPanel.st	Tue Nov 13 14:19:27 2001 +0100
+++ b/MenuPanel.st	Tue Nov 13 20:00:06 2001 +0100
@@ -3007,9 +3007,11 @@
 
     item notNil ifTrue:[
         direction := self scrollerDirectionAtPoint:aPoint.
-        (self scrolling startAt:direction on:self) ifTrue:[
-            self pointerEntersItem:nil.
-            ^ self
+        direction notNil ifTrue:[
+            (self scrolling startIfRequiredAt:direction on:self) ifTrue:[
+                self pointerEntersItem:nil.
+                ^ self
+            ]
         ]
     ].
 
@@ -3035,7 +3037,7 @@
     ].
 
     "Created: / 13.11.2001 / 14:12:04 / cg"
-    "Modified: / 13.11.2001 / 14:13:26 / cg"
+    "Modified: / 13.11.2001 / 19:50:52 / cg"
 !
 
 handleCursorKey:aKey
@@ -6813,7 +6815,7 @@
 
 !MenuPanel::Scrolling methodsFor:'user operations'!
 
-startAt:aDirection on:aMenu
+startIfRequiredAt:aDirection on:aMenu
     "start scrolling; returns true if scrolling is activated
     "
     |bounds index|
@@ -6831,29 +6833,41 @@
             index := aMenu indexOfItemAtScroller:aDirection.
 
             index ~~ 0 ifTrue:[
-                scrollTask := [ |item step|
-                                [
-                                    step := (aDirection == #PREV) ifTrue:[-1] ifFalse:[1].
-
-                                    [ aMenu shown and:[(item := aMenu itemAt:index) notNil] ] whileTrue:[
-                                        aMenu makeItemVisible:item.
-                                        Delay waitForSeconds:0.05.
-                                        index := index + step.
-                                    ].
-                                    item := nil.
-                                ] valueNowOrOnUnwindDo:[
-                                    scrollTask := nil.
-
-                                    item notNil ifTrue:[
-                                        "/ process was killed
-                                        aMenu invalidate:bounds
-                                    ]
-                                ]
-                              ] forkAt:8.
+                scrollTask := 
+                    [ 
+                        |item step|
+
+                        [
+                            step := (aDirection == #PREV) ifTrue:[-1] ifFalse:[1].
+                            ( aMenu shown and:[(item := aMenu itemAt:index) notNil] ) ifTrue:[
+                                aMenu makeItemVisible:item.
+                                index := index + step.
+                            ].
+
+                            Delay waitForSeconds:(ButtonController defaultInitialDelay).
+
+                            [ aMenu shown and:[(item := aMenu itemAt:index) notNil] ] whileTrue:[
+                                aMenu makeItemVisible:item.
+                                Delay waitForSeconds:(ButtonController defaultRepeatDelay).
+                                index := index + step.
+                            ].
+                            item := nil.
+                        ] valueNowOrOnUnwindDo:[
+                            scrollTask := nil.
+
+                            item notNil ifTrue:[
+                                "/ process was killed
+                                aMenu invalidate:bounds
+                            ]
+                        ]
+                    ] forkAt:8.
             ]
         ]
     ].
     ^ bounds notNil
+
+    "Created: / 13.11.2001 / 19:50:50 / cg"
+    "Modified: / 13.11.2001 / 19:55:25 / cg"
 !
 
 stop
@@ -6884,6 +6898,6 @@
 !MenuPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.283 2001-11-13 13:19:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.284 2001-11-13 19:00:06 cg Exp $'
 ! !
 MenuPanel initialize!