Copy and apply style button
Posted: Thu Jun 26, 2014 1:22 pm
Hi
Does the button copy/apply style exist ?
Thanks
Does the button copy/apply style exist ?
Thanks
Support forums for TRichView, ScaleRichView, Report Workshop and RVMedia components
https://text-ally.com/forums/
Code: Select all
TextStyle: TFontInfo;
StyleTemplateName: TRVStyleTemplateName;
Code: Select all
var ST: TRVStyleTemplate;
if TextStyle=nil then
TextStyle := TFontInfo.Create(nil);
TextStyle.Assign(RVStyle1.TextStyles[RichViewEdit1.CurTextStyleNo]);
ST := RVStyle1.StyleTemplates.FindItemById(TextStyle.StyleTemplateId);
if ST<>nil then
StyleTemplateName := ST.Name
else
StyleTemplateName := '';
Code: Select all
var ST: TRVStyleTemplate;
if TextStyle<>nil then begin
TextStyle.ParaStyleTemplateId := RVStyle1.TextStyles[RichViewEdit1.CurTextStyleNo]).ParaStyleTemplateId;
ST := RVStyle1.StyleTemplates.FindItemByName(StyleTemplateName);
if ST<>nil then
TextStyle.StyleTemplateId := ST.Id
else
TextStyle.StyleTemplateId := -1;
RichViewEdit1.ApplyTextStyle(RVStyle1.FindTextStyle(TextStyle));
end;
Code: Select all
TextStyle.Free;