BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TCollection

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Matthijs ter Woord
Guest





PostPosted: Wed Aug 27, 2003 4:31 pm    Post subject: TCollection Reply with quote



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





PostPosted: Tue Sep 02, 2003 8:11 pm    Post subject: Re: TCollection Reply with quote



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





PostPosted: Wed Sep 03, 2003 12:21 pm    Post subject: Re: TCollection Reply with quote



Quote:
You can't.

is there another way to do this?

Matthijs ter Woord



Back to top
Robert Cerny
Guest





PostPosted: Thu Sep 04, 2003 11:59 am    Post subject: Re: TCollection Reply with 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

Quote:
You can't.

is there another way to do this?

Matthijs ter Woord






Back to top
Matthijs ter Woord
Guest





PostPosted: Thu Sep 04, 2003 1:37 pm    Post subject: Re: TCollection Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.