daven11
daven11

Reputation: 3035

Add fmx form to Delphi Package

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

Upvotes: 1

Views: 1692

Answers (1)

David Heffernan
David Heffernan

Reputation: 613442

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.

Upvotes: 3

Related Questions