diff options
author | Carsten Driesner <cd@openoffice.org> | 2002-11-20 07:43:39 +0000 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2002-11-20 07:43:39 +0000 |
commit | d67c16ffd6b7c616d5d116968552d52b4046e475 (patch) | |
tree | dd9e00de93ac2798f5ec1059ff31993b1b484cd9 /vcl/source/window/status.cxx | |
parent | 3d897d93a1d4ae75795231538f44d274a7413ecb (diff) |
#96469# Support setting a random value for progress
Diffstat (limited to 'vcl/source/window/status.cxx')
-rw-r--r-- | vcl/source/window/status.cxx | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index e799fc06f075..ec4b6306ac1b 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -2,9 +2,9 @@ * * $RCSfile: status.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: pl $ $Date: 2002-05-29 17:01:29 $ + * last change: $Author: cd $ $Date: 2002-11-20 08:43:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -505,9 +505,29 @@ void DrawProgress( Window* pWindow, const Point& rPos, USHORT nPerc1 = nPercent1 / nPercentCount; USHORT nPerc2 = nPercent2 / nPercentCount; - // Percent-Rechtecke malen - if ( nPerc1 < nPerc2 ) + if ( nPerc1 > nPerc2 ) { + // Support progress that can also decrease + + // Rechteck berechnen + long nDX = nPrgsWidth + nOffset; + long nLeft = rPos.X()+((nPerc1-1)*nDX); + Rectangle aRect( nLeft, rPos.Y(), nLeft+nPrgsWidth, rPos.Y()+nPrgsHeight ); + + do + { + pWindow->Erase( aRect ); + aRect.Left() -= nDX; + aRect.Right() -= nDX; + nPerc1--; + } + while ( nPerc1 > nPerc2 ); + + pWindow->Flush(); + } + else if ( nPerc1 < nPerc2 ) + { + // Percent-Rechtecke malen // Wenn Percent2 ueber 100%, Werte anpassen if ( nPercent2 > 10000 ) { @@ -1375,6 +1395,23 @@ void StatusBar::EndProgressMode() // ----------------------------------------------------------------------- +void StatusBar::ResetProgressMode() +{ + if ( mbProgressMode ) + { + mnPercent = 0; + maPrgsTxt.Erase(); + if ( IsReallyVisible() ) + { + Invalidate(); + Update(); + Flush(); + } + } +} + +// ----------------------------------------------------------------------- + void StatusBar::SetText( const XubString& rText ) { if ( (!mbVisibleItems || (GetStyle() & WB_RIGHT)) && !mbProgressMode && @@ -1394,6 +1431,16 @@ void StatusBar::SetText( const XubString& rText ) Flush(); } } + else if ( mbProgressMode ) + { + maPrgsTxt = rText; + if ( IsReallyVisible() ) + { + Invalidate(); + Update(); + Flush(); + } + } else Window::SetText( rText ); } |