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
This commit is contained in:
wp_xxyyzz
2018-04-08 12:25:51 +00:00
parent 7eadb2c7d2
commit 7b28c1d7e0
2 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,7 @@ object MainForm: TMainForm
Top = 236 Top = 236
Width = 100 Width = 100
TabOrder = 10 TabOrder = 10
Text = '%d%% done.' Text = '%0:d%% done (%1:d of %2:d).'
end end
object LblFormat: TLabel object LblFormat: TLabel
Left = 247 Left = 247

View File

@ -88,9 +88,9 @@ type
procedure SetTextOption(const Value: TJvTextOption); procedure SetTextOption(const Value: TJvTextOption);
procedure PaintRectangle; procedure PaintRectangle;
procedure PaintNonSolid; procedure PaintNonSolid;
procedure PaintSolid; procedure PaintSolid;
procedure DoEraseBackground;
procedure PaintText; procedure PaintText;
procedure DoEraseBackground;
protected protected
function ColorOrDefaultColor: TColor; function ColorOrDefaultColor: TColor;
procedure Paint; override; procedure Paint; override;
@ -111,7 +111,7 @@ type
property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame; property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame;
property BorderSpacing; property BorderSpacing;
property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsNone; 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 Color;
property EndColor: TColor read FEndColor write SetEndColor default clBlack; property EndColor: TColor read FEndColor write SetEndColor default clBlack;
property Flat: Boolean read FFlat write SetFlat default true; property Flat: Boolean read FFlat write SetFlat default true;
@ -437,7 +437,7 @@ begin
toPercent: toPercent:
S := Format('%d%%', [PercentDone]); S := Format('%d%%', [PercentDone]);
toFormat: toFormat:
S := Format(Caption, [PercentDone]); S := Format(Caption, [PercentDone, FPosition, FMaximum, FMinimum]);
toCaption: toCaption:
S := Caption; S := Caption;
else {toNoText} else {toNoText}