Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Feb : Question: TCollectionItem & naming
| Subject: | Question: TCollectionItem & naming |
| Posted by: | "Jon Lennart Aasenden" (post_nospam_nojunk@jurasoft.no) |
| Date: | Sat, 26 Feb 2005 10:34:14 |
Hi guys.
I have a component that implements a published TCollection decendant,
allowing me to add collectionitems at designtime. Everything works fine,
except for when i tried to add events to these collectionitems.
Whenever i (for example) add two collectionitems, then switch the inspector
to events, and add some event code to the first item - the second item
refuse to create it's own evenhandler, but steals the once used by item1!
Both use the same eventhandler!
No, they dont reference the some shared stuff, they are indevidual
instances.
I believe the problem lies with the naming of each instance, as they seem to
take the name directly from the class. I want it to be like TFields, or
TAction, so that each collectionitem get's it's own, unique name that can be
referenced from code.
Is there a TComponentCollectionItem in VCL i dont know about?
So, is there any way i can define spesific names to each child
collectionitem. I believe this would also solve the first problem, since
collectionitem2 seems to feel it has rights to own the eventhandlers of
collectionItem1.....
I have used borlands standard example for implementing a collection, and it
works great except for the above.
Jon Lennart Aasenden