busy indicator when percentage is negative
authorClaus Gittinger <cg@exept.de>
Fri, 26 Oct 2001 15:51:30 +0200
changeset 2040 702df7addef9
parent 2039 176da0a9b13c
child 2041 00e511a396d0
busy indicator when percentage is negative
ProgressIndicator.st
--- a/ProgressIndicator.st	Wed Oct 24 10:55:38 2001 +0200
+++ b/ProgressIndicator.st	Fri Oct 26 15:51:30 2001 +0200
@@ -596,7 +596,11 @@
 
     |newPercentage|
 
-    newPercentage := ((aNumber max:0) min:100) rounded.
+    aNumber < 0 ifTrue:[
+        newPercentage := -1.
+    ] ifFalse:[
+        newPercentage := ((aNumber max:0) min:100) rounded.
+    ].
     newPercentage ~= percentage ifTrue:[
         percentage := newPercentage.
         shown ifTrue:[self invalidateRepairNow:true].
@@ -734,7 +738,7 @@
 redraw
     "redraw the percentage bar and optional percentage string"
 
-    |s lx rx sx sy sw m2 m w h|
+    |s lx rx sx sy sw m2 m w h doBusy|
 
     m := margin + 1.
     m2 := m*2.
@@ -744,7 +748,15 @@
 
 "/    self clear.
 
-    showBusy value ifTrue:[
+    doBusy := showBusy value.
+    doBusy ifFalse:[
+        percentage value < 0 ifTrue:[
+            self startBusyIndicationProcess.
+            doBusy := true.
+        ].        
+    ].
+
+    doBusy ifTrue:[
         self paint:bgColor.
         self fillRectangleX:m y:m width:w height:h.
 
@@ -757,6 +769,8 @@
         ^ self
     ].
 
+    self stopBusyIndicationProcess.
+
     rx := (w * percentage / 100) rounded.
     self paint:bgColor.
     self fillRectangleX:m+rx y:m width:w-rx height:h.
@@ -1015,5 +1029,5 @@
 !ProgressIndicator class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ProgressIndicator.st,v 1.36 2001-02-14 10:20:12 frank Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ProgressIndicator.st,v 1.37 2001-10-26 13:51:30 cg Exp $'
 ! !