Actions in Scripts

Is it possible to use an ActionList component and Actions inside a Script?
That is like dropping an ActionList on the form, add some Actions to it and connect some Buttons to these Actions.
Perhaps this also needs some kind of ActionList-Editor?

Hi Uwe, yes, it's possible. This such code sample works, for example:


in Delphi code:


  IDEScripter1.DefineClassByRTTI(TAction);


and from script:



{$FORM TForm2, Unit2.sfm}         


uses
  Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
                     
var
  Action: TAction;
  
procedure Button1Click(Sender: TObject);
begin
  Action := TAction.Create(Self);
  Action.Caption := 'Click me';
  Action.OnExecute := 'ActionExecute';
  Button2.Action := Action;         
end;


procedure ActionExecute(Sender: TObject);
begin
  ShowMessage('Action executed!');
end;                                                      


begin
end;


But yes, for design-time support in Scripter IDE, we would have to provide specific ActionList editor. That's something we could plan for a future version, indeed.