Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Disabling auto-create forms
Fri, Mar 24 2006 8:55 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Trying to find some useful site about the D2006 IDE I found this

> The problem is that Delphi's form designer tends to "invite" you
> to abuse global variables for forms, by always creating a new global var
> for every form you add (not to mention that every new form gets
> auto-instantiated, as well, and you gotta remove that code manually)

That is just flat-out wrong. You don t have to remove that code manually, you only need to turn off the option to auto-create forms in the project
options. This option has been there for a long time in Delphi.

I seem to recall this from some time back, but I can't find it anymore - can someone help a poor old blind man?

Roy Lambert
Fri, Mar 24 2006 9:49 AMPermanent Link

"Ralf Mimoun"
Roy Lambert wrote:
> Trying to find some useful site about the D2006 IDE I found this
>
>> The problem is that Delphi's form designer tends to "invite" you
>> to abuse global variables for forms, by always creating a new global
>> var for every form you add (not to mention that every new form gets
>> auto-instantiated, as well, and you gotta remove that code manually)
>
> That is just flat-out wrong. You don t have to remove that code
> manually, you only need to turn off the option to auto-create forms
> in the project options. This option has been there for a long time in
> Delphi.

Right. But creating that variable is really a pita. Nobody I know use that,
except maybe for a main datamodule or one very central form. I manage all
the rest via wrapper functions or class methods. An opption to switch off
that creation stuff would be very nice.

> I seem to recall this from some time back, but I can't find it
> anymore - can someone help a poor old blind man?

In D5 (sorry, my newest version is D6, and I use that only once a month or
so), it's in Environment Options/Preferences/Form Designer.

Ralf
Fri, Mar 24 2006 10:26 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ralf


Thanks - I knew I was blind

Roy Lambert
Fri, Mar 24 2006 1:20 PMPermanent Link

Jon Lloyd Duerdoth
For lurkers:

Tools | Options | VCL designer  {in d2006}
    - auto create forms and datamodules


Jon


Ralf Mimoun wrote:
> Roy Lambert wrote:
>> Trying to find some useful site about the D2006 IDE I found this
>>
>>> The problem is that Delphi's form designer tends to "invite" you
>>> to abuse global variables for forms, by always creating a new global
>>> var for every form you add (not to mention that every new form gets
>>> auto-instantiated, as well, and you gotta remove that code manually)
>>
>> That is just flat-out wrong. You don t have to remove that code
>> manually, you only need to turn off the option to auto-create forms
>> in the project options. This option has been there for a long time in
>> Delphi.
>
> Right. But creating that variable is really a pita. Nobody I know use
> that, except maybe for a main datamodule or one very central form. I
> manage all the rest via wrapper functions or class methods. An opption
> to switch off that creation stuff would be very nice.
>
>> I seem to recall this from some time back, but I can't find it
>> anymore - can someone help a poor old blind man?
>
> In D5 (sorry, my newest version is D6, and I use that only once a month
> or so), it's in Environment Options/Preferences/Form Designer.
>
> Ralf
Wed, Apr 5 2006 2:27 PMPermanent Link

> Right. But creating that variable is really a pita. Nobody I know use
> that, except maybe for a main datamodule or one very central form. I
> manage all the rest via wrapper functions or class methods. An opption
> to switch off that creation stuff would be very nice.

FWIW, I like that global variable existing. It serves two purposes. First,
when you want to write the code to create the form you just type the
variable name and hit Ctrl-F9. Delphi asks if you want to add the form's
unit to the references. Task one done. Then go to the form's unit, cut
that var and variable and paste it into your new code and you now have the
correct variable and type set. Write the rest of the code and you are
sorted.

/Matthew Jones/
Image