RichMemo - Losing Background color
Original Reporter info from Mantis: bobonwhidbey
-
Reporter name: Bob Richardson
Original Reporter info from Mantis: bobonwhidbey
- Reporter name: Bob Richardson
Description:
This is a problem with RichMemo. Perhaps I should be mentioning this to skalogryz, not here? When editing an RTF file, I can apply a background color with no problem (e.g. yellow). When I then insert some text within that yellow background text, the new text has the default (white) background, not yellow.
Additional information:
I think the fix is an easy one. In the Win32RichMemoProc unit, make this change:
procedure CharFormatToFontParams(const fmt: TCHARFORMAT2; var Params: TIntFontParams);
begin
Params.Name := fmt.szFaceName;
Params.Size := Round(fmt.yHeight / TwipsInFontSize);
Params.Color := fmt.crTextColor;
Params.Style := EffectsToFontStyles(fmt.dwEffects);
if fmt.cbSize > sizeof(CHARFORMAT) then
begin
Params.HasBkClr := (fmt.dwEffects and CFE_AUTOBACKCOLOR) = 0;
// if Params.HasBkClr then Params.Color:=Params.Color; // I changed this
if Params.HasBkClr then Params.BkColor := fmt.crBackColor;
Params.VScriptPos := EffectsToVScriptPost(fmt.dwEffects);
end;
end;
Mantis conversion info:
- Mantis ID: 33546
- OS: W
- OS Build: 10
- Build: 1.8.0RC5
- Platform: Win