Hello,
I have problem with DefineClassByRTTI. If I use old DefineClass (old RTTI) I have got all inherited properties. For exmaple
DefineClass(TMyForm)
I have got published properties from TMyForm and TForm and TCustomForm etc. It's ok and expected
But when I use:
DefineClassByRTTI(TMyForm)
I see only published properties from TMyForm. I think problem is in DefineClass in TatClasses. There is
// define properties
if Options.CustomProperties then
props := Options.Properties
else
props := rtype.GetDeclaredProperties; ----------------------------------- HERE
for prop in props do
begin
if (prop <> nil) and (prop.Visibility in Options.VisibilityFilter) and (prop.PropertyType <> nil) then
begin
if prop.IsReadable then
Getter := FScripter.GenericPropGetterMachineProc
and GetDeclaredProperties only lists properties in current class. If we need inherited properties also we have to use GetProperties. I have changed code on my side to:
// define properties
if Options.CustomProperties then
props := Options.Properties
else
props := rtype.GetProperties; ---------------------- HERE
for prop in props do
begin
if (prop <> nil) and (prop.Visibility in Options.VisibilityFilter) and (prop.PropertyType <> nil) then
begin
if prop.IsReadable then
Getter := FScripter.GenericPropGetterMachineProc
This should work ok. I tested it and it works as expected. I think it's a bug in original code. Am I right?
Thank you