lcl: notify controls using message on FontChanged, and ParentFontChanged for delphi compatibility

git-svn-id: trunk@22196 -
This commit is contained in:
paul 2009-10-16 13:36:52 +00:00
parent 709c5a4bfe
commit 82ae075ca3
3 changed files with 10 additions and 4 deletions

View File

@ -276,6 +276,7 @@ procedure TControl.FontChanged(Sender: TObject);
begin
ParentFont := False;
Invalidate;
Perform(CM_FONTCHANGED, 0, 0);
end;
procedure TControl.ParentFontChanged;
@ -285,8 +286,9 @@ begin
if FParentFont then
begin
Font := FParent.Font;
FParentFont := true;
FParentFont := True;
end;
Perform(CM_PARENTFONTCHANGED, 0, 0);
end;
procedure TControl.SetAction(Value: TBasicAction);

View File

@ -373,9 +373,13 @@ begin
begin
while PeekMessage(AMessage, HWnd(nil), 0, 0, PM_REMOVE) do
begin
if AMessage.message = WM_QUIT then
begin
PostQuitMessage(AMessage.wParam);
break;
end;
AccelTable := GetWin32WindowInfo(AMessage.HWnd)^.Accel;
if (AccelTable = HACCEL(nil))
or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) then
if (AccelTable = HACCEL(nil)) or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) then
begin
TranslateMessage(@AMessage);
{$IFDEF WindowsUnicodeSupport}

View File

@ -242,7 +242,7 @@ const
CM_DIALOGKEY = CM_BASE + 5;
CM_DIALOGCHAR = CM_BASE + 6;
CM_FOCUSCHANGED = CM_BASE + 7;
//CM_PARENTFONTCHANGED = CM_BASE + 8; // LCL doesn't send or receive
CM_PARENTFONTCHANGED = CM_BASE + 8;
CM_PARENTCOLORCHANGED = CM_BASE + 9;
CM_HITTEST = CM_BASE + 10;
CM_VISIBLECHANGED = CM_BASE + 11;