Jump to content

Recommended Posts

Hi,

 

New user here, I think the potential of SMS is enormous, but I'm having a few problems.

The book seems very outdated, hasn't been touched in 3 years.

 

With the beta:

1.  application.gotoform() and gotoformbyref()... how do you specify the form?

I created file form2.pas, with TForm2, and it has the autoinitialization stuff.  But I don't see where a variable is created to call by ref, and the form 'Name' doesn't work either.  Both give javascript exceptions.

 

2. Since I don't have a variable name for the form, I have no way to pass parameters to it from the previous form.  In delphi

you can call Form2.SomeFuncName( param1, param2 )?  I guess I could use a global varaible... yuck.

 

Thanks for help

Erick

 

 

 

Link to post
Share on other sites

You have basically override ApplicationStarting at TApplication level to use gotoForm and gotoFormByRef methods.

 

type
  TApplication = class(TW3CustomApplication)
  private
    FForm1: TForm1;   
    FForm2: TForm2;      
    FForm3: TForm3;
  protected
    procedure ApplicationStarting; override;
  public

  end;

implementation

{ TApplication }

procedure TApplication.ApplicationStarting;
begin
  FForm1:=TForm1.Create(display.view);
  FForm1.name:='Form1';
  RegisterFormInstance(FForm1, true);

  FForm2:=TForm2.Create(display.view);
  FForm2.name:='Form2';
  RegisterFormInstance(FForm2, false);

  FForm3:=TForm3.Create(display.view);
  FForm3.name:='Form3';
  RegisterFormInstance(FForm3, false);
  inherited;
end;

then, just drag 'n drop a button into designer... 

procedure TForm1.W3Button1Click(Sender: TObject);
begin
  Application.GotoForm('Form2', feToLeft);
end;

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...