OnComponentDblClick

Hi !!! 

can you add event to IDEEngine -> OnComponentDblClick ?

It would be convenient for some components that have a call for designers, for example FastReport.

You can do that by using the RegisterIDEComponentEditor as explained here: https://www.tmssoftware.com/site/forum/forum_posts.asp?TID=11378&title=columns-properties-in-dbgrid

And override the Edit method and HasEditor method in the TIDEComponentEditor descendant:

Rough example from TImageList editor:



type
  TImageListIDEEditor = class(TIDEComponentEditor)
  protected
    procedure Edit; override;
    function HasEditor: boolean; override;
  end;


procedure TImageListIDEEditor.Edit;
begin
  if GetComponent is TImageList then
    EditImageList(TImageList(GetComponent));
end;


function TImageListIDEEditor.HasEditor: boolean;
begin
  result := true;
end;


  RegisterIDEComponentEditor(TImageList, TImageListIDEEditor);

Thank. it works

Another problem with the FastReport component.

1. Add the component FastReport to the form of the script.
2. Add a button with name 'Button2'
3. Put the event on the button:
procedure Button2Click (Sender: TObject);
to begin
   ShowMessage ('test');
   frxReport1.ShowReport (true);
end;

If you run the script from IDE (IDEDialog1.Execute;), then F9,
then when you press Button2, the message “test” appears, and a report appears (everything is fine)

If I run the script IDEEngine1. RunProject, then click Button2, nothing happens. No message and report does not appear. What could it be ?

Hello Alena,

I can't tell what's wrong with the provided information. It should work.
I understood the pattern. If the script in Unit1 calls the form goes as 
MainForm.ShushModal, the script raises the report in any case.

If in the script in Unit1 the form call goes as MainForm.Shoц, there are problems !!!

When MainForm.Show is called, the form is displayed and the script is finished. Aren't you maybe destroying objects after the script is "finished"? Then you are destroying the event handlers from the form.