Hello,
On a form I have :
IDEDialog1: TIDEDialog;
IDEScripter1: TIDEScripter;
IDEEngine1: TIDEEngine;
PopupMenu2: TPopupMenu;
etc...
In design time (IDEEngine1.RunProject;).
Only a TMemo (Memo1) on a form.
I want to show my PopupMenu2 when the user click in inspector in property Memo1.PopupMenu
I have tried to add this :
IDEScripter1.AddComponent(PopupMenu2);
IDEScripter1.AddForm(self);
IDEScripter1.AddDataModule(DataModule2);
IDEScripter1.AddObject('PopupMenu2', PopupMenu2);
IDEScripter1.DefineProp('PopupMenu2',atScript.tkClass,_GetPopupMenu2,nil,TPopupMenu,false,0);
and also a TatScripterLibrary of my form which contains PopupMenu2 .
But I only know of to do it by code in design time like this :
procedure Memo1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if not assigned(Memo1.PopupMenu) then
Memo1.PopupMenu:=PopupMenu2;
end;
How to allow a component property to be linked (via inspector of TIDEEngine) to a "local" component ? (TMemo.popupMenu -> a Local TpopupMenu)
Best regards,
Fabrice
You want to link a property to a "local" (delphi) component from the Scripter IDE? While editing a form in scripter form designer? Then it's not possible. You can only link to components that are in the form being designed by Scripter IDE.
Hello
Thank you for your quick answer.
Any chance to add this as a future feature request ?
For example I have "local" TImagelist (or popup ) and I want visually (without code) link TadvStringGrid.GridImages property to this "local" TImageList.
With a method like IDEScripter1.AddLocalProperty('ImageList1', ImageList1);
I doubt this can be implemented, it was never request before. The "correct" way to do so is just register your TImageList in scripter and then set it from script by code:
AdvStringGrid1.Images := ImageList1;