Create test application:
Code: Select all
type
TForm5 = class(TForm)
SRichViewEdit1: TSRichViewEdit;
procedure FormCreate(Sender: TObject);
private
procedure CreateTest;
public
end;
var
Form5: TForm5;
implementation
uses
RVStyle, RVEdit;
{$R *.dfm}
procedure TForm5.CreateTest;
var
curStyleNo: Integer;
fi: TFontInfo;
rve: TCustomRichViewEdit;
textStyleNo: Integer;
begin
rve := SRichViewEdit1.RichViewEdit.TopLevelEditor;
rve.InsertText('Click right mouse button here >');
rve.InsertText('<', True);
curStyleNo := rve.CurTextStyleNo;
fi := TFontInfo.Create(nil);
try
fi.Assign(rve.Style.TextStyles[curStyleNo]);
fi.EmptyWidth := 100;
fi.Style := fi.Style + [fsUnderline];
textStyleNo := rve.Style.TextStyles.FindSuchStyle(0, fi, RVAllFontInfoProperties);
if textStyleNo < 0 then
begin
textStyleNo := rve.Style.TextStyles.Count;
rve.Style.TextStyles.add.Assign(fi);
rve.Style.TextStyles[textStyleNo].Standard := False;
end;
rve.CurTextStyleNo := textStyleNo;
rve.InsertStringTag('', 'test');
finally
fi.Free;
rve.CurTextStyleNo := curStyleNo;
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
CreateTest;
end;
Who is to blame and what to do?
PS: Sorry my google-translate