TCustomRichViewEdit.ChangeStyleTemplates

<< Click to display table of contents >>

TCustomRichViewEdit.ChangeStyleTemplates

Updates the document after editing style templates.

procedure ChangeStyleTemplates(NewStyleTemplates:

  TRVStyleTemplateCollection);

(introduced in version 14)

The code below shows how to edit style templates for RichViewEdit1: TRichViewEdit. It assumes that you have RVStyleTmp: TRVStyle component, not linked to any RichView.

RVStyleTmp.Units := RichViewEdit1.Style.Units;

RVStyleTmp.StyleTemplates.AssignStyleTemplates(

  RichViewEdit1.Style.StyleTemplates, True);

<code for changing RVStyleTmp.StyleTemplates here>

RichViewEdit1.ChangeStyleTemplates(RVStyleTmp.StyleTemplates);

While editing RVStyleTmp.StyleTemplates, you can:

add new style templates;

change any property of style templates, rename them;

delete style templates (use RVStyleTmp.StyleTemplates.ForbiddenIds).

Method type: editstyle editing-style.

srv_icon ScaleRichView note: in TSRichViewEdit, this method must be called for SRichViewEdit.ActiveEditor. It may be called while the main editor, a header or a footer is being edited. It cannot be called while a footnote or an endnote is being edited.

See also:

ApplyStyleTemplate;

ApplyParaStyleTemplate;

ApplyTextStyleTemplate.