richmemo: win32 setting RichEdit default font on WS SetFont method

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4147 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2015-05-24 04:51:16 +00:00
parent e706371e5d
commit 915ba50653
2 changed files with 42 additions and 0 deletions

View File

@ -59,6 +59,7 @@ type
class function GetStrings(const ACustomMemo: TCustomMemo): TStrings; override;
class procedure SetColor(const AWinControl: TWinControl); override;
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
@ -378,6 +379,14 @@ begin
SendMessage(AWinControl.Handle, EM_SETBKGNDCOLOR, 0, ColorToRGB(AWinControl.Color));
end;
class procedure TWin32WSCustomRichMemo.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
begin
if not Assigned(AWinControl) then Exit;
Windows.SendMessage(AWinControl.Handle, WM_SETFONT, Windows.WParam(AFont.Reference.Handle), 1);
RichEditManager.SetDefaultTextStyle(AWinControl.Handle, GetFontParams(AFont));
end;
class procedure TWin32WSCustomRichMemo.SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer);
var
range : Tcharrange;