rvico TRichView Reference | TRVStyle | TRVStyleTemplateCollection


Top  Previous  Next

Applies styles from the file to the collection.

function InsertFromRVST(const FileName: TRVUnicodeString; Units: TRVStyleUnits): Boolean;

Files of "RichView Styles" format contain style templates. Normally they have "rvst" extension. They can be created by SaveToRVST method.

This method loads style templates from the file. If style templates of the same names already exist, properties of existing style templates are overridden from the file. Otherwise, new style templates are added to the collection. Units of loaded style templates are converted to Units.

Example: applying styles from a file to RichViewEdit1

  StyleTemplates: TRVStyleTemplateCollection;
  if not OpenDialog1.Execute then
  StyleTemplates := TRVStyleTemplateCollection.Create(nil);
    StyleTemplates.AssignStyleTemplates(rvs.StyleTemplates, True);
    if not StyleTemplates.InsertFromRVST(OpenDialog1.FileName, RichViewEdit1.Style.Unitsthen

TRichView © trichview.com