Is there simpler way of saying that Delphi component/control is supported on all platforms?

There is no simpler way, but you could define those as one constant:

const
  AllCurrentPlatforms = 
    pidWin32 or pidWin64 or pidOSX32 or 
    pidiOSSimulator or pidiOSDevice or pidAndroid;

and use that each time you create a new component. But, assuming you don't produce that many components, what is wrong with writing it out in full, the few times it is needed?

I also assume that if you simply omit the attribute, the component will be considered as supporting all platforms. You could test that.


There is actually a similar constant AllPlatforms in ToolsAPI/PlatformAPI but that unit is not for general runtime use.


Simpler, absolutely hacky, way of making component/control available for all platforms:

  [ComponentPlatforms(0)]

or in another way

  [ComponentPlatforms($FFFF)]

Tags:

Delphi