published TPanel.Font

git-svn-id: trunk@7871 -
This commit is contained in:
mattias 2005-10-01 00:53:07 +00:00
parent 06a1976a71
commit 20f205ab1d
4 changed files with 9 additions and 1 deletions

View File

@ -1677,6 +1677,7 @@ type
protected protected
procedure WMPaint(var Message: TLMPaint); message LM_PAINT; procedure WMPaint(var Message: TLMPaint); message LM_PAINT;
procedure PaintWindow(DC: HDC); override; procedure PaintWindow(DC: HDC); override;
procedure FontChanged(Sender: TObject); override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;

View File

@ -80,6 +80,12 @@ begin
if Assigned(FOnPaint) then FOnPaint(Self); if Assigned(FOnPaint) then FOnPaint(Self);
end; end;
procedure TCustomControl.FontChanged(Sender: TObject);
begin
Canvas.Font:=Font;
inherited FontChanged(Sender);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: TCustomControl.LMPaint Method: TCustomControl.LMPaint
Params: Msg: The paint message Params: Msg: The paint message

View File

@ -110,6 +110,7 @@ begin
TS.Layout:= tlCenter; TS.Layout:= tlCenter;
TS.Opaque:= false; TS.Opaque:= false;
TS.Clipping:= false; TS.Clipping:= false;
TS.SystemFont:=Canvas.Font.IsDefault;
Canvas.TextRect(ARect,ARect.Left,ARect.Top, Caption, TS); Canvas.TextRect(ARect,ARect.Left,ARect.Top, Caption, TS);
end; end;
end; end;

View File

@ -1751,7 +1751,7 @@ begin
begin begin
TWSWinControlClass(WidgetSetClass).SetFont(Self, Font); TWSWinControlClass(WidgetSetClass).SetFont(Self, Font);
Exclude(FWinControlFlags,wcfFontChanged); Exclude(FWinControlFlags,wcfFontChanged);
//NotifyControls(CM_ ...); Invalidate;
end else end else
Include(FWinControlFlags,wcfFontChanged); Include(FWinControlFlags,wcfFontChanged);
end; end;