Recent

Author Topic: [SOLVED] Attempted use Pas2JS_Widget.  (Read 3432 times)

yus

  • New Member
  • *
  • Posts: 49
[SOLVED] Attempted use Pas2JS_Widget.
« on: December 09, 2020, 08:08:55 pm »
Hello.

When trying to use the project https://github.com/pascaldragon/Pas2JS_Widget.
I follow the instructions, but the browser tells me

Quote
Uncaught exception of type EResNotFound:
Form resource TWForm1 not found. For resourceless forms CreateNew constructor must be used.

Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}
  4.  
  5. uses
  6.   Forms, Interfaces, unit1;
  7.  
  8. begin
  9.   Application.Initialize;
  10.   Application.CreateForm(TWForm1, WForm1);
  11.   Application.Run;
  12. end.  

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}
  4.  
  5. interface
  6.  
  7. uses
  8.   JS, Classes, SysUtils, Graphics, Controls, Forms, Dialogs, WebCtrls;
  9.  
  10. type
  11.   TWForm1 = class(TWForm)
  12.   private
  13.  
  14.   public
  15.  
  16.   end;
  17.  
  18. var
  19.   WForm1: TWForm1;
  20.  
  21. implementation
  22.  
  23. {$R *.lfm}
  24.  
  25. end.
  26.  
       
Where i'm wrong?


Windows 10, Lazarus 2.1.0, FPC 3.3.1. (trunk version)

« Last Edit: December 09, 2020, 10:16:41 pm by yus »

yus

  • New Member
  • *
  • Posts: 49
Re: Attempted use Pas2JS_Widget.
« Reply #1 on: December 09, 2020, 08:24:23 pm »
If I manualy create form and control, it's work.

Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}
  4.  
  5. uses
  6.   Forms,
  7.   Dialogs,
  8.   WebCtrls,
  9.   Interfaces,
  10.   unit1;
  11.  
  12. var
  13.   form: TWForm;
  14.   button: TWButton;
  15. begin
  16.   Application.Initialize;
  17.   form := TWForm.Create(Application);
  18.   form.Color := $556688;
  19.   form.Caption := 'test';
  20.   button := TWButton.Create(form);
  21.   button.Caption := 'Click';
  22.   button.Left := 100;
  23.   button.Top := 200;
  24.   button.Parent := form;
  25.   Application.Run;
  26. end.    

yus

  • New Member
  • *
  • Posts: 49
Re: Attempted use Pas2JS_Widget.
« Reply #2 on: December 09, 2020, 10:16:23 pm »
Sorry.
I lost -JRjs parameter.

PascalDragon

  • Hero Member
  • *****
  • Posts: 4014
  • Compiler Developer
Re: Attempted use Pas2JS_Widget.
« Reply #3 on: December 10, 2020, 09:38:11 am »
Sorry.
I lost -JRjs parameter.

Yes, I still need to adjust the project templates so that one doesn't have to keep that in mind... :-[

yus

  • New Member
  • *
  • Posts: 49
Re: Attempted use Pas2JS_Widget.
« Reply #4 on: December 10, 2020, 11:23:30 am »
Yes, I still need to adjust the project templates so that one doesn't have to keep that in mind... :-[

I liked the project. I'll try to help.  :)

Where i can write bugs?
« Last Edit: December 10, 2020, 11:29:31 am by yus »

PascalDragon

  • Hero Member
  • *****
  • Posts: 4014
  • Compiler Developer
Re: Attempted use Pas2JS_Widget.
« Reply #5 on: December 10, 2020, 04:16:54 pm »
Yes, I still need to adjust the project templates so that one doesn't have to keep that in mind... :-[

I liked the project. I'll try to help.  :)

Any help would be welcome. :)

Where i can write bugs?

It should be the issues on the GitHub project, but it seems that I'll need to enable that first... will try to do this when I'm home. :)

PascalDragon

  • Hero Member
  • *****
  • Posts: 4014
  • Compiler Developer
Re: Attempted use Pas2JS_Widget.
« Reply #6 on: December 10, 2020, 07:23:05 pm »
Where i can write bugs?

It should be the issues on the GitHub project, but it seems that I'll need to enable that first... will try to do this when I'm home. :)

I how have enabled issues on the fork :)

yus

  • New Member
  • *
  • Posts: 49
Re: Attempted use Pas2JS_Widget.
« Reply #7 on: December 10, 2020, 07:56:15 pm »
I how have enabled issues on the fork :)
Nice.
I created 2 Pull Request.

 

TinyPortal © 2005-2018