Skip to content

Commit

Permalink
修复Windows下TRichMemo的一个bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ying32 committed Jan 5, 2021
1 parent d0de3b6 commit 4364b3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/3rd-party/richmemo/win32/win32richmemoproc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class function TRichEditManager.SetDefaultTextStyle(RichEditWnd: Handle;
fmt.cbSize := sizeof(fmt);

fmt.dwMask := fmt.dwMask or CFM_COLOR;
fmt.crTextColor := Params.Color;
fmt.crTextColor := ColorToRGB(Params.Color);

fmt.dwMask := fmt.dwMask or CFM_FACE;
// keep last char for Null-termination?
Expand Down Expand Up @@ -459,7 +459,7 @@ class function TRichEditManager.SetSelectedTextStyle(RichEditWnd: Handle;

if not useMask or (tmm_Color in AModifyMask) then begin
fmt.dwMask := fmt.dwMask or CFM_COLOR;
fmt.crTextColor := Params.Color;
fmt.crTextColor := ColorToRGB(Params.Color);
end;

if not useMask or (tmm_Name in AModifyMask) then begin
Expand All @@ -481,7 +481,7 @@ class function TRichEditManager.SetSelectedTextStyle(RichEditWnd: Handle;
if not useMask or (tmm_BackColor in AModifyMask) then begin
if Params.HasBkClr then begin
fmt.dwMask := fmt.dwMask or CFM_BACKCOLOR;
fmt.crBackColor := Params.BkColor;
fmt.crBackColor := ColorToRGB(Params.BkColor);
end else begin
fmt.dwMask := fmt.dwMask or CFM_BACKCOLOR;
fmt.dwEffects := fmt.dwEffects or CFE_AUTOBACKCOLOR;
Expand Down

0 comments on commit 4364b3c

Please sign in to comment.