use LCL font is it is non-default

git-svn-id: trunk@6994 -
This commit is contained in:
micha 2005-03-19 13:19:39 +00:00
parent 212edd1edb
commit 3e4b7bdaed

View File

@ -182,6 +182,8 @@ end;
procedure FinishCreateWindow(const AWinControl: TWinControl; var Params: TCreateWindowExParams;
const AlternateCreateWindow: boolean);
var
lhFont: HFONT;
begin
if not AlternateCreateWindow then
begin
@ -224,14 +226,19 @@ begin
if SubClassWndProc <> nil then
WindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
Window, GWL_WNDPROC, LongInt(SubClassWndProc)));
Windows.SendMessage(Window, WM_SETFONT,
WParam(TWin32WidgetSet(InterfaceObject).MessageFont), 0);
if AWinControl.Font.IsDefault then
lhFont := GetStockObject(DEFAULT_GUI_FONT)
else
lhFont := AWinControl.Font.Handle;
Windows.SendMessage(Window, WM_SETFONT, lhFont, 0)
end;
end;
end;
procedure WindowCreateInitBuddy(const AWinControl: TWinControl;
var Params: TCreateWindowExParams);
var
lhFont: HFONT;
begin
with Params do
if Buddy <> HWND(Nil) then
@ -240,8 +247,11 @@ begin
BuddyWindowInfo^.AWinControl := AWinControl;
BuddyWindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
Buddy, GWL_WNDPROC, LongInt(SubClassWndProc)));
Windows.SendMessage(Buddy, WM_SETFONT,
WParam(TWin32WidgetSet(InterfaceObject).MessageFont), 0);
if AWinControl.Font.IsDefault then
lhFont := GetStockObject(DEFAULT_GUI_FONT)
else
lhFont := AWinControl.Font.Handle;
Windows.SendMessage(Buddy, WM_SETFONT, lhFont, 0);
end
else
BuddyWindowInfo := nil;