> As part of a component I would like one of the properties to be a list of
> controls that have a canvas property. Now I realise that I could traverse
> all the components owned by the form to determine if it had a TCanvas
> property. However what I don't understand is:
> 
> - What type do I make the property? TPersistent?
> - If I did the above there would be a need to typecast the property. There
> must be a better way to do that aside from if The_Control is TImage then
> TImage(The_Control).Canvas etc.

You will have to do a casting to each parent class_type or use RTTI to get
the address of the canvas property (and then the actual value of the property)
and cast that value to TCanvas to send directly to the canvas... This should
be possible... Your list of controls should probably be TControl, a dynamic
array should be fine unless you're going to do deletions...

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to