[lazarus] Custom LCL components still bugging me

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Nov 15 18:06:19 EST 2002


On 15 Nov 2002 16:28:31 -0600
Tony Maro <tony at maro.net> wrote:

> On Fri, 2002-11-15 at 15:34, Tony Maro wrote:
> > 
> > I just created a new application, made two forms.  Added no procedures,
> > uses, objects or anything.
> > 
> > Both forms appear instantly when the application is run. Isn't it true
> > that only the main form (first in list) should be shown?
> > 
> 
> And it does this even without custom components compiled in.  
> 
> This is a recent bug addition... I haven't had this problem with
> multiple forms until now.  All this time I thought it was my custom
> components but it appears it may have been a coincidence.  But you're
> right Andrew, it appears to be a saving boolean property setting issue.

6 mails in 6 hours. Not rude, but somewhat talkactive, aren't you? ;)
Ok, I will refer to your 7 mails plus the two answers:

The AV:
Application.CreateForm created forms with the statement:
Ref:=NewForm.Create(Self);
This allocates the instance, calls the constructor and afterwards sets the
reference (FrmMain). With Visible=True the constructor created the handle
and fires some events, in which you used the FrmMain variable, which was not
set at the moment.
This was incompatible to the VCL. I fixed that. The LCL now uses the VCL
trick: First allocate the instance, then set the reference and then call the
constructor.

Visible forms:
The form editor creates Forms with visible:=true.
I will check if this can be changed. As Andrew mentioned, there is a problem
with default values for Boolean properties. Borlands compiler uses a special
value to indicate the default. The fpc does not use such tricks.


Mattias






More information about the Lazarus mailing list