about box, status was only auto refresh on create

This commit is contained in:
Basile Burg 2015-08-31 17:56:25 +02:00
parent be20059d6b
commit e72f558ff1
2 changed files with 28 additions and 4 deletions

View File

@ -25,12 +25,12 @@ inherited CEInfoWidget: TCEInfoWidget
Align = alTop Align = alTop
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Caption = 'about' Caption = 'about'
ClientHeight = 75 ClientHeight = 85
ClientWidth = 366 ClientWidth = 366
TabOrder = 0 TabOrder = 0
object Label1: TLabel object Label1: TLabel
Left = 0 Left = 0
Height = 75 Height = 85
Top = 0 Top = 0
Width = 366 Width = 366
Align = alClient Align = alClient
@ -52,12 +52,12 @@ inherited CEInfoWidget: TCEInfoWidget
Align = alClient Align = alClient
BorderSpacing.Around = 4 BorderSpacing.Around = 4
Caption = 'tools status' Caption = 'tools status'
ClientHeight = 159 ClientHeight = 169
ClientWidth = 366 ClientWidth = 366
TabOrder = 1 TabOrder = 1
object boxTools: TScrollBox object boxTools: TScrollBox
Left = 4 Left = 4
Height = 151 Height = 161
Top = 4 Top = 4
Width = 358 Width = 358
HorzScrollBar.Page = 1 HorzScrollBar.Page = 1

View File

@ -37,6 +37,9 @@ type
GroupBox2: TGroupBox; GroupBox2: TGroupBox;
Label1: TLabel; Label1: TLabel;
private private
procedure RefreshAllStatus;
protected
procedure SetVisible(Value: Boolean); override;
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
end; end;
@ -147,6 +150,8 @@ begin
fIco.Glyph.Assign(png); fIco.Glyph.Assign(png);
png.Free; png.Free;
end; end;
ReAlign;
Invalidate;
end; end;
constructor TCEInfoWidget.create(aOwner: TComponent); constructor TCEInfoWidget.create(aOwner: TComponent);
@ -176,5 +181,24 @@ begin
Realign; Realign;
end; end;
procedure TCEInfoWidget.RefreshAllStatus;
var
i: integer;
begin
for i := 0 to boxTools.ControlCount -1 do
begin
if not (boxTools.Controls[i] is TToolInfo) then
continue;
TToolInfo(boxTools.Controls[i]).refreshStatus;
end;
end;
procedure TCEInfoWidget.SetVisible(Value: Boolean);
begin
inherited;
if Visible then
RefreshAllStatus;
end;
end. end.