| View previous topic :: View next topic |
| Author |
Message |
Matthijs ter Woord Guest
|
Posted: Wed Aug 27, 2003 4:31 pm Post subject: TCollection |
|
|
Hi
i want to create a component which has a TCollection property.
in that collection i want to store TMyCollectionItem descendants.
how do i make clear to the object inspector to show a list of available
descendant classes?
Matthijs ter Woord
|
|
| Back to top |
|
 |
Robert Cerny Guest
|
Posted: Tue Sep 02, 2003 8:11 pm Post subject: Re: TCollection |
|
|
You can't.
TCollection can't be polymorphic, which means it can handle only one class
of items.
--
Robert Cerny
http://codecentral.borland.com/codecentral/ccWeb.exe/author?authorid=18355
"Matthijs ter Woord" <matthijs (AT) terwoord (DOT) nl> wrote
| Quote: | I want to create a component which handles TRegistry settings
in the component you have to add an item for each setting you want:
DatabaseServer: TMyStringItem
MaxProgramInstanceCount: TMyIntegerItem
TMyStringItem:
+ Has OnValidate Event
+ Has Mask property
+ Has PasswordChar property
etc
TMyIntegerItem:
+ Has OnValidateEvent
+ Has Min property
+ Has Max property
etc
how to accomplish this
|
|
|
| Back to top |
|
 |
Matthijs ter Woord Guest
|
Posted: Wed Sep 03, 2003 12:21 pm Post subject: Re: TCollection |
|
|
is there another way to do this?
Matthijs ter Woord
|
|
| Back to top |
|
 |
Robert Cerny Guest
|
Posted: Thu Sep 04, 2003 11:59 am Post subject: Re: TCollection |
|
|
Of course, there is always another way, at least two for this case.
One is to create a superset collectionitem (item that has all properties for
all needed types), with default values for properties it would not weight
much.
Another is to have list of items, but you would have to handle streaming and
create a custom property editor.
--
Robert Cerny
http://codecentral.borland.com/codecentral/ccWeb.exe/author?authorid=18355
"Matthijs ter Woord" <matthijs (AT) terwoord (DOT) nl> wrote
| Quote: | You can't.
is there another way to do this?
Matthijs ter Woord
|
|
|
| Back to top |
|
 |
Matthijs ter Woord Guest
|
Posted: Thu Sep 04, 2003 1:37 pm Post subject: Re: TCollection |
|
|
so no standard delphi stuff?
Matthijs ter Woord
"Robert Cerny" <robert.qwe.cerny (AT) neosys (DOT) xrs.qwe.si> schreef in bericht
news:bj7ggi.2rk.1 (AT) neosys (DOT) xrs.si...
| Quote: | Of course, there is always another way, at least two for this case.
One is to create a superset collectionitem (item that has all properties
for
all needed types), with default values for properties it would not weight
much.
Another is to have list of items, but you would have to handle streaming
and
create a custom property editor.
--
Robert Cerny
http://codecentral.borland.com/codecentral/ccWeb.exe/author?authorid=18355
"Matthijs ter Woord" <matthijs (AT) terwoord (DOT) nl> wrote in message
news:3f55dc51 (AT) newsgroups (DOT) borland.com...
You can't.
is there another way to do this?
Matthijs ter Woord
|
|
|
| Back to top |
|
 |
|