ExCtrls: Fix TProgressBarEx repainting itself again and again.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8780 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-03-29 11:54:06 +00:00
parent ef7c6a38ac
commit 0cd9c62629
3 changed files with 11 additions and 6 deletions

View File

@ -44,11 +44,6 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
<Unit>
<Filename Value="exprogressbar.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ExProgressbar"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -16,7 +16,8 @@
<Description Value="Extended standard controls:
- CurrencyEdit, FloatSIEdit (supports SI units suffixes)
- TRadioButton, TCheckbox, TRadioGroup and TCheckGroup: drawn by ThemeServices/Canvas, not by widgetset, button/text layout, wordwrap, user-provided check images
- TColumnComboBoxEx"/>
- TColumnComboBoxEx
- TProgressBarEx"/>
<License Value="LGPL with linking exception (like Lazarus LCL)."/>
<Files Count="9">
<Item1>

View File

@ -76,6 +76,8 @@ type
property ParentShowHint;
property ShowHint;
property Visible;
property OnPaint;
end;
implementation
@ -86,6 +88,8 @@ uses
constructor TProgressbarEx.Create(AOwner: TComponent);
begin
inherited;
ControlStyle := ControlStyle - [csSetCaption];
FCaption := '';
FColors[0] := DEFAULT_BACKCOLOR;
FColors[1] := DEFAULT_BORDERCOLOR;
@ -95,9 +99,12 @@ begin
FMarqueeSpeed := DEFAULT_MARQUEESPEED;
FMax := 100;
FStyle := pbstNormal;
FTimer := TTimer.Create(self);
FTimer.Interval := 25;
FTimer.OnTimer := @TimerHandler;
FTimer.Enabled := false;
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
end;
@ -303,6 +310,8 @@ begin
else
Canvas.TextOut((Width - txtSize.CY) div 2, R.Bottom - (Height - txtSize.CX) div 2, FCaption);
end;
inherited;
end;
procedure TProgressbarEx.SetCaption(AValue: String);