From 7b28c1d7e01e2eafc7a6c69908a953ee7b0c2513 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 8 Apr 2018 12:25:51 +0000 Subject: [PATCH] jvcllaz: Add support for more general text format strings of TJvSpecialProgress git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6295 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/jvcllaz/examples/JvSpecialProgress/main.lfm | 2 +- components/jvcllaz/run/JvMM/JvSpecialProgress.pas | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/jvcllaz/examples/JvSpecialProgress/main.lfm b/components/jvcllaz/examples/JvSpecialProgress/main.lfm index daf4fde2d..3e83e2267 100644 --- a/components/jvcllaz/examples/JvSpecialProgress/main.lfm +++ b/components/jvcllaz/examples/JvSpecialProgress/main.lfm @@ -160,7 +160,7 @@ object MainForm: TMainForm Top = 236 Width = 100 TabOrder = 10 - Text = '%d%% done.' + Text = '%0:d%% done (%1:d of %2:d).' end object LblFormat: TLabel Left = 247 diff --git a/components/jvcllaz/run/JvMM/JvSpecialProgress.pas b/components/jvcllaz/run/JvMM/JvSpecialProgress.pas index 59fd58da0..3b879586a 100644 --- a/components/jvcllaz/run/JvMM/JvSpecialProgress.pas +++ b/components/jvcllaz/run/JvMM/JvSpecialProgress.pas @@ -88,9 +88,9 @@ type procedure SetTextOption(const Value: TJvTextOption); procedure PaintRectangle; procedure PaintNonSolid; - procedure PaintSolid; - procedure DoEraseBackground; + procedure PaintSolid; procedure PaintText; + procedure DoEraseBackground; protected function ColorOrDefaultColor: TColor; procedure Paint; override; @@ -111,7 +111,7 @@ type property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame; property BorderSpacing; property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsNone; - property Caption; + property Caption; // contains FormatStr if TextOption=foFormat: #0=Percent #1=Position #2=Max #3=Min property Color; property EndColor: TColor read FEndColor write SetEndColor default clBlack; property Flat: Boolean read FFlat write SetFlat default true; @@ -437,7 +437,7 @@ begin toPercent: S := Format('%d%%', [PercentDone]); toFormat: - S := Format(Caption, [PercentDone]); + S := Format(Caption, [PercentDone, FPosition, FMaximum, FMinimum]); toCaption: S := Caption; else {toNoText}