John Kouraklis 94 Posted October 28, 2018 I've got a few components I developed in FMX and when I install them on the IDE they do not show all the platforms when you hover over them in the palette. How do I enable this? I followed some components by Delphi in the source code but couldn't locate how they do it. TIA Share this post Link to post
pyscripter 694 Posted October 28, 2018 From the documentation: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/64-bit_Windows_Application_Development. Making Your Components Available at Design Time and Run Time Following are the two ways the IDE decides whether or not a component is available for each platform. (Here "available" means appearing on the palette, and checked by the IDE. The IDE does not do any compile-time checking other than verifying the existence of component unit.) Both methods described here rely on data embedded in the Win32 run-time (or design+run-time) package that implements the components. The IDE cannot load packages built for platforms other than Win32 in the IDE, so the IDE must defer to the Win32 package for information. The RAD Studio build system automatically embeds an RC_DATA resource in the Win32 package binary named PLATFORMTARGETS, which is a bitmask of the pidXXX constants in System.Classes.pas and reflects the package project's targeted platforms. The IDE reads this resource when the package is loaded and uses the resource data to decide, for example, whether or not to disable the component(s) in the palette when an unsupported platform is active. Targeting multiple platforms with a component package implies a contract between the component developer and the IDE. The IDE assumes that if a component package project targets multiple platforms and the developer distributes the Win32 run-time package to customers (and all the associated compilable and linkable files), the developer will also distribute all the necessary compilable, linkable, and run-time bits for the other targeted platforms as well. Individual components can use the ComponentPlatformsAttribute class attribute to override the data in PLATFORMTARGETS, using a bitmask of the same constants in the Classes unit. For example: type [ComponentPlatformsAttribute(pidWin32 or pidWin64)] // Only supported on Win32 and Win64 TMyComponent = class(TComponent) private ... end; So to get the components to be usable with other plagorms, all you need to do is before you compile the Design package to add the other platform to it. They won't be used but just being there makes the build system to include the appropriate resource flagging the package as usable for the platforms. I have tested this and it works! 2 3 Share this post Link to post
John Kouraklis 94 Posted October 28, 2018 Aha...I knew there was such an attribute but was unable to find it in the docs. Sometimes, I feel you need to know where everything is in the documentation Ευχαριστώ 🙂 Share this post Link to post
Cristian Peța 107 Posted October 31, 2018 I discovered this looking in FMX sources. Share this post Link to post
Andrea Magni 75 Posted November 8, 2018 (edited) A nice hack from @Dalija Prasnikar here: https://stackoverflow.com/questions/27486939/is-there-simpler-way-of-saying-that-delphi-component-control-is-supported-on-all HTH Edited November 8, 2018 by Sherlock Added name tag so the user will be notified and may add something helpful to the subject. 2 1 Share this post Link to post