COPY AND INSERT

General TRichView support forum. Please post your questions here
Post Reply
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

COPY AND INSERT

Post by OldHawk »

1, in my RichViewEdit, i selected some text and gif(TGIFImage), and press CTRL+C, CTRL+P,bug only paste the text ,has not gif? is anywhere set wrong? i can copy form Demo Application.

2,in my RichViewEdit, i set caret pos at middle of some words,then insert one gif, how to get the latest inserted ItemNo(gif)? maby has many gif in RichViewEdit.

i used RichView a few days, so mush content, search some qustion is so slow.very thans.
Last edited by OldHawk on Sat Apr 01, 2006 11:37 am, edited 1 time in total.
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

why? i insert some gif to middle of richviewedit,the caret is not at after the inserted gif. but caret is at after the inserted gif in DemoEditor.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1. Call RegisterClass(TGifImage) one time, when the application starts.

2. How do you insert this gif? Do you insert only one picture using InsertPicture method, then you can get it using GetCurrentPictureInfo.
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

i already register class in formMain.Create method:
RegisterClass(TGifImage);
CTRL+C,CTRL+P however has no image.

i maby already insert few gif in it, then i set caret to middle of them with mouse, and insert new gif, this time, the carset is not at after the latest inserted gif.

i select gif from a frame,and add to the parent form`s RichViewEdit.

Code: Select all

var gif: TGIFImage;
----
    gif:=TGIFImage.Create;
    gif.Assign(gr);
    TformMsg(fmMsg).RichViewEditSend.InsertPicture(s,gif,rvvaBaseLine);
    TformMsg(fmMsg).RichViewEditSend.Format;
    hide;

    TformMsg(fmMsg).RichViewEditSend.SetFocus;
-----
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

i can copy bitmap(not gif) from Demo Editor , and paste to my RichViewEdit,
but can not copy bitmap from my RichViewEdit and paste to Demo Editor.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Remove call of Format - it's not needed after Insert*** methods, and it moves caret to the beginning.

May be you copy gifs to demo editor? It was compiled without gif support.
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

1,only addpicture** need Format?

2, no, because copy gif in my application is failed, so i test copy bitmap between my application and Demo application. copy bitmap also failed.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

All Add*** methods need format. They should be used for document generation: rv.Clear, then calling one or more Add*** methods, then call rv.Format.
Generally, all methods for document modification introduced in TRichView need calling Format (they are marked in the help file as "viewer-style methods", all method introduced in TRichViewEdit reformat document automatically (they are marked in the help file as "editing-style methods").

See "Viewer vs Editor" help topic for details.

As for copy-pasting Gifs, see my answer before.
I do not know why bitmaps are not loaded. You can save this document in RVF file and send to me, I'll try to see what's wrong.
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

1, because i set rvoAutoCopyRVF to false,os i can`t copy bitmap from rv,i turn it true, is OK,can copy bitmap now.

2, i reRegister TGIFImage Class at Here

Code: Select all

begin
  Application.Initialize;
  RegisterClass(TGifImage);
  Application.CreateForm(TformMain, formMain);
  Application.Run;
end.
now can copy gif from one rv to other rv normal. but when i copy some text and gif together , or copy more than one gif, is same , the application is stop respond, CPU used 99% with my application,why? if i copy only one gif , it can work normal
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What is your version of Delphi?
Did you download update of TGifImage?
OldHawk
Posts: 16
Joined: Wed Mar 29, 2006 11:25 am

Post by OldHawk »

bds 2006

where can download new TGifImage??
Post Reply