In order to make Delphi component/control available for all (currently) available platforms I have to write
[ComponentPlatforms(pidWin32 or pidWin64 or pidOSX32 or pidiOSSimulator or pidiOSDevice or pidAndroid)]
before component/control declaration:
type
[ComponentPlatforms(pidWin32 or ...)]
TMyComponent = class(TComponent)
end;
Is there a shorter way of writing that component supports all current and future 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With