Forum > Pas2JS

[SOLVED] Attempted use Pas2JS_Widget.

(1/2) > >>

yus:
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.

--- End quote ---


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program project1; {$mode objfpc} uses  Forms, Interfaces, unit1; begin  Application.Initialize;  Application.CreateForm(TWForm1, WForm1);  Application.Run;end.  

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; {$mode objfpc} interface uses  JS, Classes, SysUtils, Graphics, Controls, Forms, Dialogs, WebCtrls; type  TWForm1 = class(TWForm)  private   public   end; var  WForm1: TWForm1; implementation {$R *.lfm} end.        
Where i'm wrong?


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

yus:
If I manualy create form and control, it's work.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program project1; {$mode objfpc} uses  Forms,  Dialogs,  WebCtrls,  Interfaces,  unit1; var  form: TWForm;  button: TWButton;begin  Application.Initialize;  form := TWForm.Create(Application);  form.Color := $556688;  form.Caption := 'test';  button := TWButton.Create(form);  button.Caption := 'Click';  button.Left := 100;  button.Top := 200;  button.Parent := form;  Application.Run;end.    

yus:
Sorry.
I lost -JRjs parameter.

PascalDragon:

--- Quote from: yus on December 09, 2020, 10:16:23 pm ---Sorry.
I lost -JRjs parameter.

--- End quote ---

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

yus:

--- Quote from: PascalDragon on December 10, 2020, 09:38:11 am ---Yes, I still need to adjust the project templates so that one doesn't have to keep that in mind... :-[

--- End quote ---

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

Where i can write bugs?

Navigation

[0] Message Index

[#] Next page

Go to full version