[Pas2js] Before compile Notifier to the pas2jsdesign plugin

warleyalex warleyalex at yahoo.com.br
Sat Mar 24 05:09:13 CET 2018


In Delphi, using Open Tools API, it is possible form notifiers that fire
notifications for BeforeSave or AfterSave. One can AddNotifier and watch for
notifications directly from the IDE plugin:

  TIdeNotifier = class(TNotifierObject, IOTANotifier, IOTAIDENotifier)
  protected
    procedure AfterCompile(Succeeded: Boolean);
    procedure BeforeCompile(const Project: IOTAProject; var Cancel:
Boolean);
    procedure FileNotification(NotifyCode: TOTAFileNotification;
      const FileName: string; var Cancel: Boolean);
  end;

The plan would be to implement an IDE notifier to the Lazarus pas2jsdesign
plugin. For instance, before compile, I want to fire the method DFMTOPAS. As
I was stuck on this “Plan A”, I will try the plan B, which is a simple menu
button to call DFMTOPAS manually, this DFMTOPAS method is
(component-to-code) will translate ALL "instantiated" and "unassigned" forms
as well in the current project to pascal code, then I will add this
directive.

procedure TForm1.LoadDFMValues;
begin
  inherited;
{ $I Form1.lfm.inc }

//{ $I %form% }

end;

Any thoughts on this.



--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list