Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

Visual Form Inheritance

18 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

Hi all,

I found the following bug report on mantis:
http://bugs.freepascal.org/view.php?id=705

Which seems to indicate that VFI is implemented, but I'm unsure as to the what level it working from reading the comments.

VFI works, but just not in the IDE at design time? Meaning that I can inherit from an ancestor form, but the ancestor's controls will not show up in design time, but are drawn at runtime?

At worst, I just need methods to be inherited from a base form and appears to be working, but I was curious as to the "Visual" part of VFI at design time or if that will be planned?

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Michael Van Canneyt
to Mattias Gärtner
Mattias G?rtner wrote 21 lines
Zitat von Lee Jenkins : > > Hi all, > > I found the following bug report on mantis: > http://bugs.freepascal.org/view.php?id=705 > > Which seems to indicate that VFI is implemented, but I'm unsure as to the > what level it working from reading the comments. > > VFI works, but just not in the IDE at design time? Meaning that I can > inherit from an ancestor form, but the ancestor's controls will not show up in design time, but are drawn at runtime? > > At worst, I just need methods to be inherited from a base form and appears to > be working, but I was curious as to the "Visual" part of VFI at design time or > if that will be planned? AFAIK there are two things missing: - Easy creating descendant forms via 'New ...' dialog

But this is the essence of VFI ?
Without this, how can one say that VFI works ?

Michael.

Reply by email

Lee Jenkins
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Mattias G?rtner wrote 25 lines
Zitat von Lee Jenkins : > Hi all, > > I found the following bug report on mantis: > http://bugs.freepascal.org/view.php?id=705 > > Which seems to indicate that VFI is implemented, but I'm unsure as to the > what level it working from reading the comments. > > VFI works, but just not in the IDE at design time? Meaning that I can > inherit from an ancestor form, but the ancestor's controls will not show up in design time, but are drawn at runtime? > At worst, I just need methods to be inherited from a base form and appears to > be working, but I was curious as to the "Visual" part of VFI at design time or > if that will be planned? AFAIK there are two things missing: - Easy creating descendant forms via 'New ...' dialog - When ancestor and descendant is open at the same time in the designer and you change a property of the ancestor, then the descendant properties needs to be changed too. Beside that VFI works.

Good 'nuff for me.

Thanks Mattias.

Warm Regards, Lee

Reply by email

Lee Jenkins
to Michael Van Canneyt: But this is the essence of VFI ? Without this, how can one say that VFI works ? Michael.
Michael Van Canneyt wrote 25 lines
On Wed, 7 May 2008, Mattias G?rtner wrote: > Zitat von Lee Jenkins : > >> Hi all, >> >> I found the following bug report on mantis: >> http://bugs.freepascal.org/view.php?id=705 >> >> Which seems to indicate that VFI is implemented, but I'm unsure as to the >> what level it working from reading the comments. >> >> VFI works, but just not in the IDE at design time? Meaning that I can >> inherit from an ancestor form, but the ancestor's controls will not show up in > design time, but are drawn at runtime? >> At worst, I just need methods to be inherited from a base form and appears to >> be working, but I was curious as to the "Visual" part of VFI at design time or >> if that will be planned? > AFAIK there are two things missing: > - Easy creating descendant forms via 'New ...' dialog But this is the essence of VFI ? Without this, how can one say that VFI works ?

If guess just FI...?

Warm Regards, Lee

Reply by email

Graeme Geldenhuys
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…

2008/5/7 Mattias G?rtner :

Show quoted text 7 lines
AFAIK there are two things missing: - Easy creating descendant forms via 'New ...' dialog - When ancestor and descendant is open at the same time in the designer and you change a property of the ancestor, then the descendant properties needs to be changed too. Beside that VFI works.

Do you still need to manually edit the descendant form's .lfm file to say 'inherited' instead of 'object' in the first line? I remember that if the descendant didn't say 'inherited' in the .lfm file the 'visual' part didn't work in the forms designer.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Michael Van Canneyt: But this is the essence of VFI ? Without this, how can one say that VFI works ? Michael.
Show quoted text 29 lines
On Wed, 7 May 2008, Mattias G?rtner wrote: > Zitat von Lee Jenkins : > > > > > Hi all, > > > > I found the following bug report on mantis: > > http://bugs.freepascal.org/view.php?id=705 > > > > Which seems to indicate that VFI is implemented, but I'm unsure > > as to the what level it working from reading the comments. > > > > VFI works, but just not in the IDE at design time? Meaning that > > I can inherit from an ancestor form, but the ancestor's controls > > will not show up in > design time, but are drawn at runtime? > > > > At worst, I just need methods to be inherited from a base form > > and appears to be working, but I was curious as to the "Visual" > > part of VFI at design time or if that will be planned? > > AFAIK there are two things missing: > - Easy creating descendant forms via 'New ...' dialog But this is the essence of VFI ? Without this, how can one say that VFI works ?

Oh, come on. This is too simple.
You can already create easily any kind of inherited component. Just close the designer form and change the ancestor in the source. The only missing thing is a dialog, that do this in on step. I already wondered why you didn't provide a dialog yourself. You wrote the project templates, so I know you are skilled.

Anyway, here is "the essence":
I found a nice patch for this in bug 1287. I simplified and extended it and now you can inherit forms, datamodules, frames and custom component classes via the new dialog.

Lazarians are spoiled.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
> > > At worst, I just need methods to be inherited from a base form > > > and appears to be working, but I was curious as to the "Visual" > > > part of VFI at design time or if that will be planned? > > > > AFAIK there are two things missing: > > - Easy creating descendant forms via 'New ...' dialog > > But this is the essence of VFI ? > Without this, how can one say that VFI works ? Oh, come on. This is too simple. You can already create easily any kind of inherited component. Just close the designer form and change the ancestor in the source.

I didn't know that this "works", hence my question :-)

The only missing thing is a dialog, that do this in on step. I already wondered why you didn't provide a dialog yourself. You wrote the project templates, so I know you are skilled.

Thank you for the confidence...

The point was simply that I didn't know the above works. I always wondered what exactly you meant with "VFI works" :)

Anyway, here is "the essence": I found a nice patch for this in bug 1287. I simplified and extended it and now you can inherit forms, datamodules, frames and custom component classes via the new dialog.

Great news, I'll test it ASAP :-)

Lazarians are spoiled.

I know this since a long time, even without VFI :-)

Now we need to convince the rest of the world of this :-)

Michael.

Reply by email

Lee Jenkins
to Mattias Gaertner: On Wed, 7 May 2008 18:14:45 +0200 (CEST) Oh, come on. This is too simple. You can already…
Mattias Gaertner wrote 43 lines
On Wed, 7 May 2008 18:14:45 +0200 (CEST) Michael Van Canneyt wrote: > > On Wed, 7 May 2008, Mattias G?rtner wrote: > >> Zitat von Lee Jenkins : >> >>> Hi all, >>> >>> I found the following bug report on mantis: >>> http://bugs.freepascal.org/view.php?id=705 >>> >>> Which seems to indicate that VFI is implemented, but I'm unsure >>> as to the what level it working from reading the comments. >>> >>> VFI works, but just not in the IDE at design time? Meaning that >>> I can inherit from an ancestor form, but the ancestor's controls >>> will not show up in >> design time, but are drawn at runtime? >>> At worst, I just need methods to be inherited from a base form >>> and appears to be working, but I was curious as to the "Visual" >>> part of VFI at design time or if that will be planned? >> AFAIK there are two things missing: >> - Easy creating descendant forms via 'New ...' dialog > But this is the essence of VFI ? > Without this, how can one say that VFI works ? Oh, come on. This is too simple. You can already create easily any kind of inherited component. Just close the designer form and change the ancestor in the source. The only missing thing is a dialog, that do this in on step. I already wondered why you didn't provide a dialog yourself. You wrote the project templates, so I know you are skilled. Anyway, here is "the essence": I found a nice patch for this in bug 1287. I simplified and extended it and now you can inherit forms, datamodules, frames and custom component classes via the new dialog. Lazarians are spoiled.

That is a good thing, isn't it? Its a reflection of the Lazarus developers and community's skill and generosity, IMO. :)

Warm Regards, Lee

Reply by email

Lee Jenkins
to Lee Jenkins: I found the following bug report on mantis: http://bugs.freepascal.org/view.php?id=705…
Lee Jenkins wrote 16 lines
Hi all, I found the following bug report on mantis: http://bugs.freepascal.org/view.php?id=705 Which seems to indicate that VFI is implemented, but I'm unsure as to the what level it working from reading the comments. VFI works, but just not in the IDE at design time? Meaning that I can inherit from an ancestor form, but the ancestor's controls will not show up in design time, but are drawn at runtime? At worst, I just need methods to be inherited from a base form and appears to be working, but I was curious as to the "Visual" part of VFI at design time or if that will be planned?

Nice job on adding this to the New dialog. Looks great.

Warm Regards, Lee

Reply by email

Joao Morais
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Mattias G?rtner wrote 5 lines
AFAIK there are two things missing: - Easy creating descendant forms via 'New ...' dialog - When ancestor and descendant is open at the same time in the designer and you change a property of the ancestor, then the descendant properties needs to be changed too.

Here I cannot create something like this:

(1) TAbstract = class(TForm)
Panel

(2) TNotSoAbstract = class(TAbstract)
SomeButtonInsideTheInheritedPanel

Form (2) works nice.

(3) TConcrete = class(TNotSoAbstract)

Form (3) always raise exceptions saying 'Duplicate name: A component named "Panel" already exists'. One message for each TAbstract member. 22-may snapshot. Known issue, or should I create a project that reproduces the problem and create a bug report?

Joao Morais

Reply by email

Mattias Gaertner
to Joao Morais
Show quoted text 23 lines
Mattias G?rtner wrote: > AFAIK there are two things missing: > - Easy creating descendant forms via 'New ...' dialog > - When ancestor and descendant is open at the same time in the > designer and you change a property of the ancestor, then the > descendant properties needs to be changed too. Here I cannot create something like this: (1) TAbstract = class(TForm) Panel (2) TNotSoAbstract = class(TAbstract) SomeButtonInsideTheInheritedPanel Form (2) works nice. (3) TConcrete = class(TNotSoAbstract) Form (3) always raise exceptions saying 'Duplicate name: A component named "Panel" already exists'. One message for each TAbstract member. 22-may snapshot. Known issue, or should I create a project that reproduces the problem and create a bug report?

Yes, please create a bug report.

Mattias

Reply by email

Vincent Snijders
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Sat, 24 May 2008 12:00:56 -0300 Joao Morais wrote: > Here I cannot create something like this: > > (1) TAbstract = class(TForm) > Panel > > (2) TNotSoAbstract = class(TAbstract) > SomeButtonInsideTheInheritedPanel > > Form (2) works nice. > > (3) TConcrete = class(TNotSoAbstract) > > Form (3) always raise exceptions saying 'Duplicate name: A component > named "Panel" already exists'. One message for each TAbstract member. > 22-may snapshot. Known issue, or should I create a project that > reproduces the problem and create a bug report? Yes, please create a bug report.

To me, someone who doesn't use VFI, it looks similar to http://bugs.freepascal.org/view.php?id=11148

It has a patch attached to it.

Vincent

Reply by email

Mattias Gaertner
to Vincent Snijders
Show quoted text 28 lines
Mattias Gaertner schreef: > On Sat, 24 May 2008 12:00:56 -0300 > Joao Morais wrote: > >> Here I cannot create something like this: >> >> (1) TAbstract = class(TForm) >> Panel >> >> (2) TNotSoAbstract = class(TAbstract) >> SomeButtonInsideTheInheritedPanel >> >> Form (2) works nice. >> >> (3) TConcrete = class(TNotSoAbstract) >> >> Form (3) always raise exceptions saying 'Duplicate name: A >> component named "Panel" already exists'. One message for each >> TAbstract member. 22-may snapshot. Known issue, or should I create >> a project that reproduces the problem and create a bug report? > > Yes, please create a bug report. > To me, someone who doesn't use VFI, it looks similar to http://bugs.freepascal.org/view.php?id=11148 It has a patch attached to it.

No, I think this is something different. The mail is about adding a component twice (once by every stream/lfm). The bug report is about a missing stream/lfm.

Mattias

Reply by email

Joao Morais
to Mattias Gaertner: On Sat, 24 May 2008 12:00:56 -0300 Yes, please create a bug report. Mattias
Mattias Gaertner wrote 18 lines
On Sat, 24 May 2008 12:00:56 -0300 Joao Morais wrote: > (1) TAbstract = class(TForm) > Panel > > (2) TNotSoAbstract = class(TAbstract) > SomeButtonInsideTheInheritedPanel > > Form (2) works nice. > > (3) TConcrete = class(TNotSoAbstract) > > Form (3) always raise exceptions saying 'Duplicate name: A component > named "Panel" already exists'. One message for each TAbstract member. > 22-may snapshot. Known issue, or should I create a project that > reproduces the problem and create a bug report? Yes, please create a bug report.

http://bugs.freepascal.org/view.php?id=11357

Joao Morais

Reply by email

Joao Morais
to Joao Morais
Joao Morais wrote 10 lines
Mattias Gaertner wrote: > On Sat, 24 May 2008 12:00:56 -0300 Joao Morais wrote: > >> Form (3) always raise exceptions saying 'Duplicate name: A component >> named "Panel" already exists'. One message for each TAbstract member. >> 22-may snapshot. Known issue, or should I create a project that >> reproduces the problem and create a bug report? > Yes, please create a bug report. http://bugs.freepascal.org/view.php?id=11357

Hello Mattias, many thanks for fixing this one. A small issue that still persists is that if I have:

Form1
Form2
Form3

I can open Form2 without opening Form1, but the IDE still complains if I open Form3 without opening Form2. You can use the same attachment to test yourself: open the project and ConcrFrm without opening InhFrm.

Thanks for your valuable skill and time.

Joao Morais

Reply by email