From 4b2a2eca8afad5a3fc3bd5e0e8231ad6d30a4728 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 25 Oct 2010 17:37:53 +0000 Subject: [PATCH] fpcunit gui test runner: improved painting progres text in progresbar, now uses transparent background. git-svn-id: trunk@27859 - --- components/fpcunit/guitestrunner.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/components/fpcunit/guitestrunner.pas b/components/fpcunit/guitestrunner.pas index 5f7f04cfda..541225641b 100644 --- a/components/fpcunit/guitestrunner.pas +++ b/components/fpcunit/guitestrunner.pas @@ -395,6 +395,7 @@ procedure TGUITestRunner.pbBarPaint(Sender: TObject); var msg: string; alltests: integer; + OldStyle: TBrushStyle; begin with (Sender as TPaintBox) do begin @@ -404,18 +405,22 @@ begin Canvas.Font.Color := clWhite; if Assigned(TestSuite) then begin - alltests := TestSuite.CountTestCases; - if FailureCounter + ErrorCounter = 0 then - barColor := clGreen; - Canvas.Brush.Color := barColor; if TestsCounter <> 0 then begin + alltests := TestSuite.CountTestCases; + if FailureCounter + ErrorCounter = 0 then + barColor := clGreen; + Canvas.Brush.Color := barColor; Canvas.Rectangle(0, 0, round(TestsCounter / (alltests - skipsCounter) * Width), Height); msg := Format(rsRuns, [IntToStr(TestsCounter), IntToStr(alltests - skipsCounter)]); msg := Format(rsErrors, [msg, IntToStr(ErrorCounter)]); msg := Format(rsFailures, [msg, IntToStr(FailureCounter)]); - Canvas.Textout(10, 10, msg) + //Canvas.Brush.Color := clNone; + OldStyle := Canvas.Brush.Style; + Canvas.Brush.Style := bsClear; + Canvas.Textout(10, 10, msg); + Canvas.Brush.Style := OldStyle; end; end; Canvas.UnLock;