trichview.com

trichview.support




Re: A Question About Icons Codes Replacement


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/18/2005 22:17:28


Create a hidden rveHidden: TRichViewEdit. Link it to its own RVStyle.

Process OnPaste event of your main RichViewEdit:


procedure TForm1.RichViewEdit1Paste(Sender: TCustomRichViewEdit;

  var DoDefault: Boolean);

var Stream: TMemoryStream;

begin

  if rveHidden.CanPaste then begin

    // pasting in rveHidden

    rveHidden.Clear;

    rveHidden.DeleteUnusedStyles(True, True, True);

    rveHidden.Format;

    rveHidden.Paste;

    // replacing emoticons codes

    DetectEmoticons(rveHidden);

    // inserting rveHidden content to

    // the main editor

    Stream := TMemoryStream.Create;

    rveHidden.SaveRVFToStream(Stream, False);

    Stream.Position := 0;

    Sender.InsertRVFFromStreamEd(Stream);

    Stream.Free;

    DoDefault := False;

  end;

end;




> Sergey Tkachenko:

>     I want to copy text for a MS word doc,or any other text editor(e.g

> notepad,wordpad),and then paste it

> to a TRichViewEdit.Text which copied includes icons codes.I want it

happens

> that when text is pasted to

> the TRichViewEdit,the replacement of icons codes could perform.Now I can't

> deal with is how to spring off

> this procedure.Thank U.

>

>

>





Powered by ABC Amber Outlook Express Converter