mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 09:09:32 +02:00
use LCL font is it is non-default
git-svn-id: trunk@6994 -
This commit is contained in:
parent
212edd1edb
commit
3e4b7bdaed
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user