Sign in Join

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

Mailing lists / lazarus / 2011-01

VFI

8 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

Hi

I started to test the Visual Form Inheritance feature after reading about Michael Van Canneyt's many forms.
I never really used that feature in Delphi myself.

In:
File -> New... -> Inherited Item -> Inherited Component there are the existing forms of the current project. A new inherited form can be made based on them.
IMO the header "Inherited Component" is wrong. It should be "Inherited Form". It is misleading because also components can be inherited but these are not components.
How to register other forms there?

I found:
http://wiki.lazarus.freepascal.org/IDE_Development#VFI_- _Visual_Form_Inheritance

which seems valid. The feature mostly works but has couple of small issues.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 11 lines
Hi I started to test the Visual Form Inheritance feature after reading about Michael Van Canneyt's many forms. I never really used that feature in Delphi myself. In: File -> New... -> Inherited Item -> Inherited Component there are the existing forms of the current project. A new inherited form can be made based on them. IMO the header "Inherited Component" is wrong. It should be "Inherited Form".

All designer base classes: forms, frames, datamodules and customs from designer mediators.

It is misleading because also components can be inherited but these are not components.

?

How to register other forms there?

What do you mean?

Show quoted text 5 lines
I found: http://wiki.lazarus.freepascal.org/IDE_Development#VFI_- _Visual_Form_Inheritance which seems valid. The feature mostly works but has couple of small issues.

True.

Mattias

Reply by email

Unknown author
to Mattias Gaertner
Mattias Gaertner wrote 26 lines
On Tue, 18 Jan 2011 02:20:43 +0200 Juha Manninen wrote: > Hi > > I started to test the Visual Form Inheritance feature after reading about > Michael Van Canneyt's many forms. > I never really used that feature in Delphi myself. > > In: > File -> New... -> Inherited Item -> Inherited Component > there are the existing forms of the current project. A new inherited form can > be made based on them. > IMO the header "Inherited Component" is wrong. It should be "Inherited Form". All designer base classes: forms, frames, datamodules and customs from designer mediators. > It is misleading because also components can be inherited but these are not > components. ? > How to register other forms there? What do you mean?

Registering a custom form in the IDE, I suppose.

See the components/customform package. It demonstrates how to add your own forms to the IDE File-New menu.

The projecttemplates package also shows this, but it is more hard to follow.

Michael.

Reply by email

Juha Manninen
to Unknown author

kirjoitti tiistai 18 tammikuu 2011 10:18:51:

Show quoted text 8 lines
>> How to register other forms there? > > What do you mean? Registering a custom form in the IDE, I suppose. See the components/customform package. It demonstrates how to add your own forms to the IDE File-New menu.

I installed components/customform/LazCustForms package to Lazarus.

Then I added package components/customform/demo/appforms to my test application. Appforms has :

  RegisterCustomForm(TAppForm,'AppForms');
  RegisterCustomForm(TDBAppForm,'AppForms');

called from initialization section which looks promising.

Then I run my test app but I still don't see anything new in File -> New... The Inherited Item -> Inherited Component section has the forms from my applications, nothing else. Those forms can be inherited nicely, no problem there. All other sections are empty.
I have missed something obvious (again).

Juha

Reply by email

Juha Manninen
to Mattias Gaertner: On Tue, 18 Jan 2011 02:20:43 +0200 All designer base classes: forms, frames, datamodules…

Mattias Gaertner kirjoitti tiistai 18 tammikuu 2011 03:38:20:

Show quoted text 15 lines
> In: > File -> New... -> Inherited Item -> Inherited Component > > there are the existing forms of the current project. A new inherited form > can be made based on them. > IMO the header "Inherited Component" is wrong. It should be "Inherited > Form". All designer base classes: forms, frames, datamodules and customs from designer mediators. > It is misleading because also components can be inherited but these are > not components. ?

Components are typically located in component palette. TEdit and TButton are components. You can inherit your own component from them, like: type TMyEdit = class(TEdit)
and you register that new component to the palette, too.

Visual Form Inheritance is different. It deals with form designer and .lfm form files. Now, Inherited Item -> Inherited Component lists Form1 and Form2 from my project. They are forms, not components, so "Inherited Component" title is misleading.

Juha

Reply by email

Unknown author
to Juha Manninen: kirjoitti tiistai 18 tammikuu 2011 10:18:51: I installed…
Juha Manninen wrote 23 lines
kirjoitti tiistai 18 tammikuu 2011 10:18:51: >>> How to register other forms there? >> >> What do you mean? > > Registering a custom form in the IDE, I suppose. > > See the components/customform package. It demonstrates how to add your own > forms to the IDE File-New menu. I installed components/customform/LazCustForms package to Lazarus. Then I added package components/customform/demo/appforms to my test application. Appforms has : RegisterCustomForm(TAppForm,'AppForms'); RegisterCustomForm(TDBAppForm,'AppForms'); called from initialization section which looks promising. Then I run my test app but I still don't see anything new in File -> New... The Inherited Item -> Inherited Component section has the forms from my applications, nothing else. Those forms can be inherited nicely, no problem there. All other sections are empty. I have missed something obvious (again).

The new custom forms are not under 'Inherited items' but are straight under 'New Items' ?

Michael.

Reply by email

Mattias Gaertner
to Juha Manninen: Mattias Gaertner kirjoitti tiistai 18 tammikuu 2011 03:38:20: Components are typically…
Show quoted text 26 lines
Mattias Gaertner kirjoitti tiistai 18 tammikuu 2011 03:38:20: > > In: > > File -> New... -> Inherited Item -> Inherited Component > > > > there are the existing forms of the current project. A new inherited form > > can be made based on them. > > IMO the header "Inherited Component" is wrong. It should be "Inherited > > Form". > > All designer base classes: forms, frames, datamodules and customs from > designer mediators. > > > It is misleading because also components can be inherited but these are > > not components. > > ? Components are typically located in component palette. TEdit and TButton are components. You can inherit your own component from them, like: type TMyEdit = class(TEdit) and you register that new component to the palette, too. Visual Form Inheritance is different. It deals with form designer and .lfm form files. Now, Inherited Item -> Inherited Component lists Form1 and Form2 from my project. They are forms, not components, so "Inherited Component" title is misleading.

Well, they are all components.

About "component" palette:
The component palette contains the components you can put onto a designer form:
1. Components without an ancestor stream (e.g. TButton)
2. a button for frame, which is VFI with inlining. Delphi has a third: component templates, which are components with an initializing stream. That's easy to implement.

The components you can not put onto a designer form, TWriter calls them "root components", are in the "new dialog".

I think the term 'inhrited forms' would be misleading, because "inherited components" also contains any kind of root components: frames, datamodules and custom root components.

Mattias

Reply by email