Gies,Brad wrote:
> MySecondCollectionItem = class(TCollectionItem)
> Private
>   FAnotherValue = integer
> Published
>   Property AnotherValue : integer read FAnotherValue write
> FAnotherValue;
> End;
> 
> MySecondCollection = class(TOwnedCollection)
>   // all the properties.
> End;
> 
> MyFirstCollectionItem = class (TCollectionItem)
> private
>   fsomeValue : integer;
>   fSecondCollection : TSecondCollection;
> published
>   property SomeValue : integer read fsomeValue write fsomeValue;
>   property SecondCollection : TSecondCollection
>               read fSecondCollection
>               write fSecondCollection;
> end;

That's not how to write a property for an object type that's meant to be 
operated by the Object Inspector.

Give the property a setter method, and in that method, copy the contents 
of the input object to the internal one.

This means your TFirstCollectionItem will need to have a constructor 
where it creates itself an instance of TSecondCollection. (And the 
corresponding destructor.)

> This e-mail or communication, including any attachments, is intended only for 
> the person or entity
> to which it is addressed and may contain confidential and/or legally 
> privileged material.  Any review,
> retransmission, dissemination or other use of, or taking of any action in 
> reliance upon, this
> information by persons or entities other than the intended recipient is 
> prohibited.  If you received
> this message in error, please contact the sender immediately and permanently 
> delete all copies,
> electronic or other, you may have or from your computer. Any disclosure, 
> copying, distribution,
> reliance or use of the contents or information received in error is strictly 
> prohibited.
> The foregoing applies even if this notice is imbedded in a message that is 
> forwarded or attached.

Ugh. Are you and your employer aware that your messages are archived on 
a public Web site?

-- 
Rob
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk

Reply via email to