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.

Graeme, how have you solved the problem?

Mattias

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

Reply via email to