FMX: Problem Components in package would not install. RegisterComponents is not working.

    • Offizieller Beitrag

    Well, this took a while to find out.....

    Our components work nicely when created at runtime but how to create a package to install them into the IDE?

    Problem: The usual way with "Register" and "RegisterComponents" does not work - the package is installed but does not contain any components.

    The answer was: The unit name which contains the "Register" procedure may not contain an underscore "_". If it does, registration does not work.

    It may also may not contain a dot "." - so you cannot use the prefix FMX. ...

    (I wonder why it apparently works with FMX.StdCtrls, but maybe it does not and the components are pulled in by a different unit)

    • Offizieller Beitrag

    Components also have to be marked with an attribute. Otherwise they cannot be inserted on a form once other platforms have been activated.

    Example:

    [ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32)]

    TWPFMXPagePropDlg = class(FMX.WPUtil.TWPFMXCustomAttrDlg)

    In case of WPTools FMX it was necessary to rename the dialog components to not use the same name as the VCL edition of WPTools. Otherwise Delphi showed a message that the name was already registered.

    The main components, such as TWPRichText use the same name, so it is actually not a big problem and WPTools FMX works side by side with the VCL edition.