Guest Posted September 24, 2010 Posted September 24, 2010 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 -- . Quote
Guest Posted September 24, 2010 Author Posted September 24, 2010 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 . Quote
Guest Posted September 24, 2010 Author Posted September 24, 2010 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 -- . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.