TRVAControlPanel.InitImportPicturesAndFiles, DoneImportPicturesAndFiles

<< Click to display table of contents >>

TRVAControlPanel.InitImportPicturesAndFiles, DoneImportPicturesAndFiles

Allows using DownloadInterface component for a loading operation that were not initialized by RichViewActions.

procedure InitImportPicturesAndFiles(Sender: TrvAction;
  Editor: TCustomRichViewEdit);
procedure DoneImportPicturesAndFiles(

  Editor: TCustomRichViewEdit);

Normally, when loading is initiated by an action, DownloadInterface is used automatically. The following actions initializes loading:

TrvActionOpen

TrvActionInsertFile

TrvActionPaste

TrvActionPasteSpecial

However, when loading is not initiated by an action, DownloadInterface is not used. To solve this problem, call InitImportPicturesAndFiles before loading, and DoneImportPicturesAndFiles after.

 

Parameters:

Sender will be used as a parameter of OnDownload event

Editor is a target editor.

 

Example:

This code allows downloading external pictures referred by files that are inserted in the editor as a result of drag-and-drop operation.

procedure TMyForm.MyRichViewEditBeforeOleDrop(Sender: TObject);
begin
  MyRVAControlPanel.InitImportPicturesAndFiles(nil,
    (Sender as TCustomRichViewEdit));
end;
procedure TForm3.RichViewEdit1AfterOleDrop(Sender: TObject);
begin
  MyRVAControlPanel.DoneImportPicturesAndFiles(
    (Sender as TCustomRichViewEdit));
end;