Hi,
In unit WPCtrRich.pas under procedure TWPCustomRichText.DoUpdateCharAttr; there should be this code:
{$IFNDEF NOTOOLBAR} if (FToolBar <> nil) then begin if IsSelected then begin if not SelectedTextAttr.GetFontName(fnt) then fnt := ' '; FToolBar.UpdateSelection(wptName, fnt, 0); end else FToolBar.UpdateSelection(wptName, CurrAttr.FontName, 0); str := CurrAttr.StyleName; FToolBar.UpdateSelection(wptTyp, str, 0); FToolBar.UpdateSelection(wptStyleNames, str, 0); FToolBar.UpdateSel; //was: FToolBar.UpdateSelection(wptSize, '', Round(CurrAttr.Size)); if IsSelected then b := Memo.Cursor.SelectedTextAttr.GetFontSize(s) else b := Memo.Cursor.WritingTextAttr.GetFontSize(s); if b then FToolBar.UpdateSelection(wptSize, '', Round(s)) else FToolBar.UpdateSelection(wptSize, '', -1); FToolBar.UpdateSelection(wptColor, '', CurrAttr.Color); FToolBar.UpdateSelection(wptBKColor, '', CurrAttr.BKColor); end; {$ENDIF}
It is comparable to the code used for TBX which indeed uses the default font if none is found. The edit will be empty if different fonts are used in a selection.
action code:
if Edit.IsSelected then
begin
if not Edit.SelectedTextAttr.GetFontName(fnt) then
TTBXComboBoxItem(FAttachedControl).Text := ''
else TTBXComboBoxItem(FAttachedControl).Text := fnt;
end else TTBXComboBoxItem(FAttachedControl).Text := edit.CurrAttr.FontName;
Julian