Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
component property check ?
#2
IW has a history running back over 20 years so I cant say why Font was not added in a base or given an interface, but it wasnt. As you've seen Font is introduced on various end classes.

Thus the way to do what you want is RTTI and dynamically check for the Font properties.

Delphi since 2006 or so has Extended RTTI which is a bit easier to work with. It works from C++ builder as well.

17 uses RTTI extensively.

A small snippet:

function T17Reflector.GetProperty(aObj: TPersistent; const aName: string): TRttiInstanceProperty;
begin
Result := _Context.GetType(aObj.ClassType).GetProperty(aName) as TRttiInstanceProperty;
end;
Reply


Messages In This Thread
component property check ? - by SorenJensen - 09-18-2019, 06:01 AM
RE: component property check ? - by kudzu - 09-18-2019, 02:08 PM
RE: component property check ? - by SorenJensen - 09-18-2019, 03:20 PM
RE: component property check ? - by kudzu - 09-24-2019, 02:57 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)