0

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")

Community
  • 1
  • 1
Jamo
  • 3,238
  • 6
  • 40
  • 66

1 Answers1

2

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 Wiert Pluimers
  • 23,965
  • 9
  • 74
  • 154