Lazarus

Programming => LCL => Topic started by: egsuh on January 28, 2022, 08:14:59 am

Title: Please confirm on the rtti controls' actions
Post by: egsuh on January 28, 2022, 08:14:59 am
Hi,
I love RTTI controls. I'd like to confirm following.

I assign a property name to RTTI controls during design. That is,

         RTTIControl.Link.TIPropertyName := SomePropertyOfMyComponent;

And I assign its TiObject dynamically during runtime, i.e.

         RTTIControl.Link.TIObject := MyComponent;

But assigning   RTTIControl.Link.TIObject := nil;    seems to raise exception if the TIPropertyName remains.

Is this true?

Title: Re: Please confirm on the rtti controls' actions
Post by: egsuh on January 28, 2022, 08:32:04 am
Changing tiobject causes problem, whether it's nil or not.
Title: Re: Please confirm on the rtti controls' actions
Post by: egsuh on January 28, 2022, 09:03:49 am
Can I use RTTI controls only with TComponent descendants, not with TPersistent?
Title: Re: Please confirm on the rtti controls' actions
Post by: Thaddy on January 28, 2022, 10:43:41 am
Can I use RTTI controls only with TComponent descendants, not with TPersistent?
Well, TPersistent causes its descendants to have RTTI information, because it is compiled in {$M+} state, so in principle this should be possible for any Tpersistent derived class.. Note that the properties should be published, not public.
TinyPortal © 2005-2018