Jump to content

Application form vs Form


Guest

Recommended Posts

Message from: "Harry Rogers"

 

Hi

 

Hugely impressed with this !...

 

A couple of questions

 

1.

Was wondering what is the difference between the

'Application Form' and the 'Form'

when using the File | New | Other | uniGui

option from the IDE.

 

2.

What is the mechanism (if any ?)to dynamicly create multiple instances

of a form ?

 

e.g. this fails

procedure TMainForm.UniButton1Click(Sender: TObject);

var aform : TUniform1

begin

aform := Tuniform.create( self );

aform.show;

end;

 

 

Best regards

 

Harry Rogers

 

 

--

 

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

Hi Harry

 

"Harry Rogers"

> Hi

>

> Hugely impressed with this !...

>

 

Thanks.

 

> A couple of questions

>

> 1.

> Was wondering what is the difference between the

> 'Application Form' and the 'Form'

> when using the File | New | Other | uniGui

> option from the IDE.

>

 

Technically speaking both are same with minor differences.

 

"Application Forms" are easier to manage as you can automatically initiate

an instance of it by simple referring to its name:

 

UniForm1.Show;

 

In above call an instance of TUniForm1 is automatically created. In

subsequent calls to UniForm1, this instance is returned until Form is

destroyed.

 

Regular Forms should be created explicitly by creating an instance of it:

 

TUniForm1.Create(uniApplication).Show;

 

Another difference is that "Application Forms" can not be included in

packages.

 

> 2.

> What is the mechanism (if any ?)to dynamicly create multiple instances

> of a form ?

>

 

You can create as many Forms as you want using above syntax. You can also

examine the "Dynamic" demo to see how forms and controls are dymanically

created.

 

> e.g. this fails

> procedure TMainForm.UniButton1Click(Sender: TObject);

> var aform : TUniform1

> begin

> aform := Tuniform.create( self );

> aform.show;

> end;

>

 

All forms must be owned by uniApplication. Use uniApplication instead of

Self and it should work

 

Regards

Farshad Mohajeri

 

 

.

 

Link to comment
Share on other sites

Message from: "Harry Rogers"

 

Farshad Mohajeri wrote:

 

> Hi Harry

>

> "Harry Rogers"

> > Hi

> >

> > Hugely impressed with this !...

> >

>

> Thanks.

>

> > A couple of questions

> >

> > 1.

> > Was wondering what is the difference between the

> > 'Application Form' and the 'Form'

> > when using the File | New | Other | uniGui

> > option from the IDE.

> >

>

> Technically speaking both are same with minor differences.

>

> "Application Forms" are easier to manage as you can automatically

> initiate an instance of it by simple referring to its name:

>

> UniForm1.Show;

>

> In above call an instance of TUniForm1 is automatically created. In

> subsequent calls to UniForm1, this instance is returned until Form is

> destroyed.

>

> Regular Forms should be created explicitly by creating an instance of

> it:

>

> TUniForm1.Create(uniApplication).Show;

>

> Another difference is that "Application Forms" can not be included in

> packages.

>

> > 2.

> > What is the mechanism (if any ?)to dynamicly create multiple

> > instances of a form ?

> >

>

> You can create as many Forms as you want using above syntax. You can

> also examine the "Dynamic" demo to see how forms and controls are

> dymanically created.

>

> > e.g. this fails

> > procedure TMainForm.UniButton1Click(Sender: TObject);

> > var aform : TUniform1

> > begin

> > aform := Tuniform.create( self );

> > aform.show;

> > end;

> >

>

> All forms must be owned by uniApplication. Use uniApplication instead

> of Self and it should work

>

> Regards

> Farshad Mohajeri

 

Many thanks - that's clear now

 

--

 

.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...