trichview.com

trichview.support




Re: TRichviewEdit in DLL


Return to index


Author

Message

hpsmall

Posted: 06/19/2004 3:40:34


Of couse. I create this TRicheviewEdit using the follow function. All these

code can run in a application.


procedure CreateRichview(var rv: TRichviewEdit; var rvs: TRvStyle; FParent:

TWinControl; FVisible: Boolean);

begin

  // creating

  rv := TRichViewEdit.Create(nil);

  rvs := TRVStyle.Create(nil);

  rv.Visible := FVisible;

  rv.Parent := FParent; // it's necessary to assign parent!

  rv.Style := rvs;

  // setting options

  SetRichviewUnicodeMode(rv);

end;


procedure SetRichviewUnicodeMode(rv: TCustomRichviewEdit);

var

  i: integer;

begin

  rv.Options := rv.Options + [rvoTagsArePChars];

  rv.RVFTextStylesReadMode := rvf_sInsertMerge;

  rv.RVFParaStylesReadMode := rvf_sInsertMerge;

  rv.RVFOptions := rv.RVFOptions + [rvfoSaveTextStyles, rvfoSaveParaStyles,

    rvfoLoadBack, rvfoSaveBack, rvfoLoadLayout, rvfoSaveLayout];

  rv.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;

  rv.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;

  rv.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;

  rv.RTFReadProperties.IgnorePictures := false;

  if rv.Style <> nil then

    for i := 0 to rv.Style.TextStyles.Count - 1 do

      rv.Style.TextStyles[i].Unicode := True;

end;





Powered by ABC Amber Outlook Express Converter