On Sun, 16 Jan 2011 18:31:01 +0100 (CET)
Michael Van Canneyt <mich...@freepascal.org> wrote:

> 
> 
> On Sun, 16 Jan 2011, Mattias Gaertner wrote:
> 
> > On Sun, 16 Jan 2011 17:41:34 +0100
> > Hans-Peter Diettrich <drdiettri...@aol.com> wrote:
> >
> >> Mattias Gaertner schrieb:
> >>
> >>> Graeme, how does the fpgui writer support circles?
> >>> For example:
> >>>
> >>> object Edit1: TEdit
> >>>   AnchorSideLeft.Control = Label1
> >>> end
> >>> object Label1: TLabel
> >>>   AnchorSideTop.Control = Edit1
> >>> end
> >>
> >> Same question: how does LCL streaming support this?
> >>
> >> Circular references are something what never should be allowed, IMO. To
> >> me it suggests a bad design of AnchorDocking, and of AutoSize as well.
> >
> > Any dependency between components can create this problem.
> >> From the layout pov the above is not a circle, because one dependency
> > is horizontally and one is vertically.
> > Forward references happen quite often in lfm files. For example
> > the form's ActiveControl property references a control that is streamed
> > after the properties.
> >
> > How does TReader do it:
> > It keeps a list of open references and sets them as soon as the
> > component is created.
> >
> > One simple solution for the pascal writer could be: first create all
> > components and then set the properties. But then the code is
> > somewhat harder to read.
> >
> > TReader can even load multiple root components with circle
> > dependencies. The IDE supports this too, but I guess this is hardly
> > used and only a minor limitation for the pascal writer.
> 
> TForm/TDatamodule dependencies are in this category, and not so uncommon.

Normally only the form references the Datamodule, so you can
simply create the module before the form.
I meant, that TReader and IDE even support bidirectional references.
AFAIK not many programs use this.


> > Graeme, how have you solved the problem?
> 
> He has not. 
> I don't know of any inter-component property in fpGUI,
> except parent (which must be equal to Owner anyway).

Ah, well, that is a simple solution. ;)


Mattias

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to