Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2022-07

Pas2JS_Widget woes

11 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

Hello,

I'm trying to follow the instructions here

https://github.com/pascaldragon/Pas2JS_Widget

I'm currently using lazarus 2.2.2 and I downloaded the 2.2.0 zip of pas2js (for linux), I have the Pas2HSDsgn 1.0.2 package installed and I set the pas2js options so that they point to the 2.2.0 pas2js and compileserver.

the instructions say:

1 - make sure that the pas2jsdsgn package is installed - done 2 - the pas2js_rtl package should have been opened (so that the IDE knows about it) - done
3 - install the wcldsgn package from design/package - done 4 - open the wcl package in widgets (again so that the IDE knows about it) - done

I then created a new "Web GUI Application", Run->Compile but I get

Error: can't find unit "Interfaces"

This is the automatically generated project source

program Project1;
{$mode delphi}{$H+}
uses
   Interfaces, Forms, unit1;
{$R *.res}
begin
   Application.Initialize;
   Application.CreateForm(TWForm1, WForm1);
   Application.Run;
end.

If I comment out the Interfaces, the next error is on Forms, and so on, and so forth.
Funnily enough, lazarus can find all those units.

What am I doing wrong?

Bye

Luca
Sven Barth
to Luca Olivetti
Luca Olivetti wrote 50 lines
Hello, I'm trying to follow the instructions here https://github.com/pascaldragon/Pas2JS_Widget I'm currently using lazarus 2.2.2 and I downloaded the 2.2.0 zip of pas2js (for linux), I have the Pas2HSDsgn 1.0.2 package installed and I set the pas2js options so that they point to the 2.2.0 pas2js and compileserver. the instructions say: 1 -? make sure that the pas2jsdsgn package is installed - done 2 - the pas2js_rtl package should have been opened (so that the IDE knows about it) - done 3 - install the wcldsgn package from design/package - done 4 - open the wcl package in widgets (again so that the IDE knows about it) - done I then created a new "Web GUI Application", Run->Compile but I get Error: can't find unit "Interfaces" This is the automatically generated project source program Project1; {$mode delphi}{$H+} uses ? Interfaces, Forms, unit1; {$R *.res} begin ? Application.Initialize; ? Application.CreateForm(TWForm1, WForm1); ? Application.Run; end. If I comment out the Interfaces, the next error is on Forms, and so on, and so forth. Funnily enough, lazarus can find all those units. What am I doing wrong?

Would you please make sure that your project has a dependency on the WCL package, but not on the LCL (or the FCL) package?

Regards,
Sven

Luca Olivetti
to Sven Barth

El 18/7/22 a les 23:10, Sven Barth via Pas2js ha escrit:

> What am I doing wrong? Would you please make sure that your project has a dependency on the WCL package, but not on the LCL (or the FCL) package?

The only dependencies are WCL and pas2js_rtl.

I managed to compile the project with

pas2js -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' project1.lpr

(once corrected the error here:
https://forum.lazarus.freepascal.org/index.php/topic,59272.0.html)

though when I open project1.html the browser console complains "Uncaught reference: rtl is not defined"

Bye

Luca
Michael Van Canneyt
to Luca Olivetti
Luca Olivetti wrote 19 lines
El 18/7/22 a les 23:10, Sven Barth via Pas2js ha escrit: >> What am I doing wrong? > > Would you please make sure that your project has a dependency on the WCL > package, but not on the LCL (or the FCL) package? The only dependencies are WCL and pas2js_rtl. I managed to compile the project with pas2js -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' project1.lpr (once corrected the error here: https://forum.lazarus.freepascal.org/index.php/topic,59272.0.html) though when I open project1.html the browser console complains "Uncaught reference: rtl is not defined"

Add -Jirtl.js to the options:

pas2js -Jirtl.js -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' project1.lpr

(normally you can see this option in the custom compiler options of your project)

Michael.

Luca Olivetti
to Michael Van Canneyt

El 19/7/22 a les 10:48, Michael Van Canneyt ha escrit:

Show quoted text 29 lines
On Tue, 19 Jul 2022, Luca Olivetti wrote: > El 18/7/22 a les 23:10, Sven Barth via Pas2js ha escrit: > >>> What am I doing wrong? >> >> Would you please make sure that your project has a dependency on the >> WCL package, but not on the LCL (or the FCL) package? > > The only dependencies are WCL and pas2js_rtl. > > I managed to compile the project with > > pas2js? -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' > project1.lpr > > > (once corrected the error here: > https://forum.lazarus.freepascal.org/index.php/topic,59272.0.html) > > though when I open project1.html the browser console complains > "Uncaught reference: rtl is not defined" Add -Jirtl.js to the options: pas2js -Jirtl.js -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' project1.lpr

Now no error in the console but I get this messagebox

Uncaught exception of type EResNotFound:

Form resource TWForm1 not found. For resourceless forms CreateNew constructor must be used.

(normally you can see this option in the custom compiler options of your project)

I wonder why when I create a new "Web GUI Application (Pas2JS)" lazarus cannot compile the project (the custom compiler options are " -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs").

BTW, using those options generates an apparently working html page.

Bye

Luca
Michael Van Canneyt
to Luca Olivetti
Luca Olivetti wrote 45 lines
El 19/7/22 a les 10:48, Michael Van Canneyt ha escrit: > > > On Tue, 19 Jul 2022, Luca Olivetti wrote: > >> El 18/7/22 a les 23:10, Sven Barth via Pas2js ha escrit: >> >>>> What am I doing wrong? >>> >>> Would you please make sure that your project has a dependency on the WCL >>> package, but not on the LCL (or the FCL) package? >> >> The only dependencies are WCL and pas2js_rtl. >> >> I managed to compile the project with >> >> pas2js? -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' >> project1.lpr >> >> >> (once corrected the error here: >> https://forum.lazarus.freepascal.org/index.php/topic,59272.0.html) >> >> though when I open project1.html the browser console complains "Uncaught >> reference: rtl is not defined" > > Add -Jirtl.js to the options: > > pas2js -Jirtl.js -Tbrowser -Fu'/home/luca/pas2js-linux/Pas2JS_Widget/*' > project1.lpr Now no error in the console but I get this messagebox Uncaught exception of type EResNotFound: Form resource TWForm1 not found. For resourceless forms CreateNew constructor must be used. > > (normally you can see this option in the custom compiler options of your > project) I wonder why when I create a new "Web GUI Application (Pas2JS)" lazarus cannot compile the project (the custom compiler options are " -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs").

Because it attempts to compile the dependencies of your project, and that fails.

Michael.

Luca Olivetti
to Michael Van Canneyt

El 21/7/22 a les 21:38, Michael Van Canneyt ha escrit:

Show quoted text 8 lines
> > I wonder why when I create a new "Web GUI Application (Pas2JS)" > lazarus cannot compile the project (the custom compiler options are " > -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs"). Because it attempts to compile the dependencies of your project, and that fails.

Then what's the point of "Web GUI Application (Pas2JS)"? Just to create the form(s) and the compilation has to be done manually?

Bye

Luca
Luca Olivetti
to Luca Olivetti

El 21/7/22 a les 21:48, Luca Olivetti ha escrit:

Show quoted text 12 lines
El 21/7/22 a les 21:38, Michael Van Canneyt ha escrit: >> >> I wonder why when I create a new "Web GUI Application (Pas2JS)" >> lazarus cannot compile the project (the custom compiler options are " >> -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs"). > > Because it attempts to compile the dependencies of your project, and > that fails. > Then what's the point of "Web GUI Application (Pas2JS)"? Just to create the form(s) and the compilation has to be done manually?

I looked this video

https://www.youtube.com/watch?v=Hxb-An_61D8

(I think it's about a previous version of the pas2js widgetset).

At 4:19 I see that he clicks on the "Play" button in the lazarus ide to compile the project and start the browser, but in my ide the play button is greyed out.

Again, am I doing something wrong? What am I doing wrong?

The only dependencies of the project are WCL and pas2js_rtl.

Bye

Luca
Michael Van Canneyt
to Luca Olivetti
Luca Olivetti wrote 27 lines
El 21/7/22 a les 21:48, Luca Olivetti ha escrit: > El 21/7/22 a les 21:38, Michael Van Canneyt ha escrit: >>> >>> I wonder why when I create a new "Web GUI Application (Pas2JS)" lazarus >>> cannot compile the project (the custom compiler options are " >>> -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs"). >> >> Because it attempts to compile the dependencies of your project, and that >> fails. >> > > Then what's the point of "Web GUI Application (Pas2JS)"? > Just to create the form(s) and the compilation has to be done manually? I looked this video https://www.youtube.com/watch?v=Hxb-An_61D8 (I think it's about a previous version of the pas2js widgetset). At 4:19 I see that he clicks on the "Play" button in the lazarus ide to compile the project and start the browser, but in my ide the play button is greyed out. Again, am I doing something wrong? What am I doing wrong? The only dependencies of the project are WCL and pas2js_rtl.

Are you using an official release of lazarus ? Or trunk version ?

In the trunk version, it should work.
In fact, support for running has been very much improved.

Michael.

Michael Van Canneyt
to Luca Olivetti: El 21/7/22 a les 21:38, Michael Van Canneyt ha escrit: Then what's the point of "Web GUI…
Luca Olivetti wrote 12 lines
El 21/7/22 a les 21:38, Michael Van Canneyt ha escrit: >> >> I wonder why when I create a new "Web GUI Application (Pas2JS)" lazarus >> cannot compile the project (the custom compiler options are " >> -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs"). > > Because it attempts to compile the dependencies of your project, and that > fails. > Then what's the point of "Web GUI Application (Pas2JS)"? Just to create the form(s) and the compilation has to be done manually?

No, it just means the packages are wrongly configured.

Michael.

Luca Olivetti
to Michael Van Canneyt: Are you using an official release of lazarus ? Or trunk version ? In the trunk version,…

El 22/7/22 a les 16:53, Michael Van Canneyt ha escrit:

Show quoted text 5 lines
> Again, am I doing something wrong? What am I doing wrong? > > The only dependencies of the project are WCL and pas2js_rtl. Are you using an official release of lazarus ? Or trunk version ?

Official 2.2.2

In the trunk version, it should work. In fact, support for running has been very much improved.

Is there no way to make it work with 2.2.2?

Bye

Luca