views:

99

answers:

1

I am exploring this subject again, from a slightly different angle than before:

I have TForm descendant which is used in a couple of other components as a dialog, that I'd like to add as a property an array of counted TFrame descendants.

What multi-item property approach should I use for this? (Array, TList, TObjectList, TCollection, TOwnedCollection, etc).

(I'd also love to know, conceptually, "why")

+2  A: 

The easiest is to base this on a TCollection.

Write a TCollectionItem descendant wrapper around your TFrame.

Make sure that when the TFrame instance is freed by someone else, that your TCollectionItem gets notified!

Use a construction like mentioned here and here for that.

--jeroen

Jeroen Pluimers