[fpc-devel] Streaming readonly properties

Michael Van Canneyt michael at freepascal.org
Wed Dec 13 21:54:06 CET 2006



On Wed, 13 Dec 2006, Vincent Snijders wrote:

> Michael Van Canneyt schreef:
> > 
> > On Tue, 12 Dec 2006, vsnijders at quicknet.nl wrote:
> > 
> > > As said in an earlier mail I have problems streaming the property
> > > EditLabel: TBoundLabel read FEditLabel;
> > > of a TLabeledEdit with fpc 2.1.1.
> > >
> > > Some discussion on #fpc led to the conclusion that streaming a readonly
> > > persistant should be allowed, because you write to the properties of the
> > > readonly persistant property.
> > >
> > > Attached is a proposal to fix it.
> > 
> > Delphi does not stream readonly properties. So we won't either.
> > 
> > The proper solution for this is support for csSubComponent in TComponent.
> 
> Can you elaborate a bit, what you mean by that? What should be changed and
> where?

Delphi has a ComponentState csSubComponent. This flag should be set
if you publish a property of type TComponent, and the TComponent instance
is 'owned' by the object that publishes it, i.e. it's NOT a reference to 
an other existing TComponent.

The owned TComponent has 'csSubComponent' in it's componentstyle. This tells
delphi to stream the component's properties as part of it's owning component, 
and not just a reference to it.

The IDE will need support for this, as well TComponent and the streaming system. 
(The latter part is probably the easy part ;) )

Michael.



More information about the fpc-devel mailing list