dmitrybv 3 Posted August 26 Hello How to set which platforms my component supports? I found the System.Classes.ComponentPlatformsAttribute attribute, but it seems that there are other ways. For example, the TDataSource component does not have the ComponentPlatformsAttribute attribute set, but the Hint component palette shows that TDataSource supports all available platforms. Share this post Link to post
havrlisan 24 Posted August 26 You need to add an attribute to your class: [ComponentPlatformsAttribute(pidAllPlatforms)] TZxButton = class(TZxCustomButton) end; You also need to add System.Classes to your uses unit. Share this post Link to post
dmitrybv 3 Posted August 26 There is information that when adding a new platform to the list of target platforms of the package, all components of the package are considered fully functional on these platforms. Share this post Link to post
havrlisan 24 Posted August 26 14 minutes ago, dmitrybv said: There is information that when adding a new platform to the list of target platforms of the package, all components of the package are considered fully functional on these platforms. Correct. If you register your component that has the attribute I mentioned, it will display all the platforms in that hint you screenshotted. Share this post Link to post
Remy Lebeau 1394 Posted August 26 (edited) 2 hours ago, dmitrybv said: How to set which platforms my component supports? I found the System.Classes.ComponentPlatformsAttribute attribute By annotating it with the ComponentPlatforms attribute: https://docwiki.embarcadero.com/Libraries/en/System.Classes.ComponentPlatformsAttribute 2 hours ago, dmitrybv said: but it seems that there are other ways. Not that I'm aware of. Which ways are you thinking of? 2 hours ago, dmitrybv said: For example, the TDataSource component does not have the ComponentPlatformsAttribute attribute set, but the Hint component palette shows that TDataSource supports all available platforms. When a component does not indicate any specific platforms, then it is available for all platforms, limited only by the framework it uses. A VCL component without ComponentPlatforms will support all platforms that VCL supports, namely Windows 32bit and 64bit. An FMX component without ComponentPlatforms will support all platforms that FMX supports. TDataSource derives directly from TComponent and has no affinity to either VCL or FMX, so it will support whichever framework your project is using, and thus whichever platforms that framework supports. Edited August 26 by Remy Lebeau 1 Share this post Link to post