[fpc-pascal] Application.onChangeComponentCount ?

Sven Barth pascaldragon at googlemail.com
Sun Jun 16 11:06:44 CEST 2013


On 15.06.2013 18:58, Fred van Stappen wrote:
>  > Date: Sat, 15 Jun 2013 13:34:52 +0200
>  > From: pascaldragon at googlemail.com
>  > To: fpc-pascal at lists.freepascal.org
>  > Subject: Re: [fpc-pascal] Application.onChangeComponentCount ?
>  >
>  > On 15.06.2013 12:11, Fred van Stappen wrote:
>  > >
>  > >
>  > > Hello.
>  > >
>  > > Is there a plan to add a function like
> Application.onChangeComponentCount ?
>  > >
>  > > I want to catch a signal when a new form is created (or deleted).
>  > > I know that the best way is to create a parent form and from this use
>  > > the form.oncreate event.
>  > > But if the form has no parent the only way to know if a new form was
>  > > created (or deleted) is to check if Application.ComponentCount was
>  > > changed. (with a timer)
>  > > So i will be happy if a function like
>  > > "Application.onChangeComponentCount" is added in Application class.
>  > >
>  > > But maybe there is a other way to know if a new form was created (or
>  > > deleted) ?
>  >
>  > You should ask this on the Lazarus list. TApplication is part of the LCL
>  > not the FCL.
>  >
>  > Regards,
>  > Sven
>
> //////////////////////
>
>  > TApplication is part of the LCL not the FCL.
>
> Aaargh, ok, so sorry to disturb (but i will be happier if TApplication
> was part of FCL). ;-)

No, because TApplication needs references to GUI related things (e.g. on 
Windows a reference to a hidden application window). The FCL is not 
about GUI, so TApplication has no place there. For programs that don't 
need a GUI you can take a look at TCustomApplication in unit CustApp 
however (which TApplication also inherits from).

Regards,
Sven






More information about the fpc-pascal mailing list