[Pas2js] TMS Web Clone

warleyalex warleyalex at yahoo.com.br
Tue Feb 27 13:15:58 CET 2018


I was recently analyzing the TMS Web Core framework, and and quite a bit of
effort, doing some reverve engineering I believe I created a clone!
     ,  ,  , , ,
    <(__)> | | |
    | \/ | \_|_/
     \^  ^/   |
     /\--/\  /|
    /  \/  \/ |

 - there are enough similarities that it's clear that they have the same
source. That works quite a bit better than I expected! Unfortunately, I can
only create components only on runtime.

There are some issue:

I think the TMS Web Core, auto generates the LoadDFMValues method. I could
find a way to achieve this, I  have manually to type the code. Look at this
example:

------------------------------------------------------------
unit Unit1;

{$mode objfpc}

interface

uses
  SysUtils, Classes, JS, Web, WEBLib.Graphics, WEBLib.StdCtrls,
WEBLib.Forms,
  WEBLib.Dialogs;

type
  { TForm1 }
  TForm1 = class(TForm)
  private
    { Private declarations }
    Button1: TButton;
  public
    { Public declarations }
    procedure LoadDFMValues; override;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.LoadDFMValues;
begin
  inherited;
  Button1 := TButton.create(Self);
  Button1.BeginUpdate;
  try
    Self.Name := 'Form1';
    Self.Left := 0;
    Self.Top:= 0;
    Self.Width := 640;
    Self.Height := 480;
    Self.Font.Charset := 1;
    Self.Font.Color := 0;
    Self.Font.Height := -13;
    Self.Font.Name := 'Tahoma';
    Self.Font.Style := [fsBold];
    Self.FFormContainer := 'appcontent';
    Self.TabOrder := 1;

    with Button1 do
    begin
      Parent := Self;
      Name := 'Button1';
      Left := 204;
      Top:= 40;
      Width:= 75;
      Height:= 25;
      Caption := 'Add';
      OnClick := @Button1Click;
      TabOrder := 1;
    end;

  finally
    Button1.EndUpdate;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  console.log('button clicked');
end;

end.
------------------------------------------------------------

I never created a Lazarus visual component before, is it possible to install
the WEBLib.StdCtrls (this unit contains TLabel, TEdit, TButton, TComboBox
and TMemo) visual web component on Lazarus IDE? 

b) another thing, how to get the module name? for instance, the main HTML
page "projWEBForms.html"?





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


More information about the Pas2js mailing list