On Mon, 15 Aug 2005 00:09:37 +0200
Marc Weustink <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
> > On Sat, 13 Aug 2005 23:20:05 +0200
> > Tom Verhoeff <[EMAIL PROTECTED]> wrote:
> >
> >
> >>On Sat, Aug 13, 2005 at 01:20:49PM +0200, Mattias Gaertner wrote:
> >>
> >>>On Thu, 11 Aug 2005 11:01:17 +0200
> >>>Marc Weustink <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>>Alexander Todorov wrote:
> >>>>
> >>>>>>2. Why can't multiple forms of the "same name" be created?
> >>>>>> Delphi has no problems with this.
> >>>>>
> >>>>>
> >>>>>In delphi the two forms are not with the exact same name. At work we
> >>>>>have an application with many forms that can be opened many times.
> >>>>>When TfMyForm is opened for the firms time its name is fMyForm
> >>>>>(suppose you named it this way in OI). The second time its opened
> >>>>>(e.g. obj := TfMyForm.Create) it has name something like fMyForm_1,
> >>>>>the third fMyForm_2 and so on.
> >>>>>I think when creating form dynamically Delphi automatically adds
> >>>>>numbers after the name to prevent errors. This is at least what i
> >>>>>have seen.
> >>>>
> >>>>DUH.... I've never noticed this. I tried it with Delphi 6 and indeed,
> >>>>the name is postfixed with _i
> >>>>
> >>>>Think we need to implement that.
> >>>
> >>>Implemented.
> >>
> >>I updated my Lazarus to rev. 7497 and rebuilt all. But the attached
> >>project still fails for me. There are two buttons: each create an
> >>instance of TMyForm. That form shows its name. The second creation
> >>still fails.
> >>
> >>Can someone confirm that the attached project works on another platform
> >>(I use powerpc-darwin)?
> >>
> >>In my application-being-ported-from-Delphi, I do notice some difference,
> >>because the error message Duplicate Name, now shows a postfix _1
> >>(but not on all failing occasions).
> >
> >
> > You create the two forms with Owner Self (=MainForm).
> > This is not allowed. The components of a form must have unique names or
> > none.
> >
> > Create with Owner 'Application'. This will auto rename the forms.
>
> This is not the same as in delphi.
> There names are fixed in TReader.ReadRootComponent which uses
> FindGlobalComponent (which looks in Screen.Forms). This is independent
> of the owner of the form
I don't know, why the Screen forms must have separate names, but
nevertheless: implemented.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives