1
votes

As the title says really. How can I add an FMX form to a delphi package? In the package I have a Tpanel descendant component - which is all installed fine. What I'd like to do is include a form in the package so that when I click on the panel at runtime the form pops up for example. (I don't want to use the FMX form at design time - just at runtime, so I just want to include the FMX form as in the package, the component has design time properties though)

It seems I can only add a VCL form to the package - when I right click and 'add new' to the package, it tries to add the VCL to the package - which I don't want. I want to run it on OSX.

I've found plenty of adding VCL forms e.g. Adding forms and frames to packages probably something obvious I'm missing - tia

Delphi XE6 on Windows 8/OSX target

1
Is the package an FMX package?David Heffernan
it includes fmx in the requires listdaven11
Can't you just add the unit to the project?David Heffernan
You must have made a VCL package and now you're trying to add an FMX form to it. By default, a package is neither VCL or FMX until you use one or the other. After that point, the whole package is locked into that framework.Jerry Dodge
(update) yes I edited the .dproj changed it to FMX and I can now add a FMX form. Thanksdaven11

1 Answers

3
votes

Packages have affinity to a particular framework. Your package appears to be a VCL package. In the .dproj file you will find

<FrameworkType>VCL</FrameworkType>

Change this to

<FrameworkType>FMX</FrameworkType>

to have affinity to FireMonkey.

Although I've not done so recently, I expect that you get to make the framework affinity choice when you create the package. Presumably you chose VCL. Or the package was created before FMX existed and the project upgrade process added (correctly) the VCL framework setting.