1

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

Community
  • 1
  • 1
daven11
  • 2,905
  • 3
  • 26
  • 43

1 Answers1

3

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • When you create the package it is framework agnostic as @Jerry said, you can then add a new form and have the choice of vcl or firemonkey, from then on the framework is set. There may be other ways to set the packages framework. It would be good to have some sort of way to change and see this from the IDE, no doubt it will come in future releases. Thanks for your help. – daven11 Aug 22 '14 at 22:24
  • 1
    @daven11 I personally doubt they will introduce an option to change this from the IDE. This is simply because when you begin a package, you're expected to already know the framework you intend to use and will never have a reason to change it. Imagine such an option would break a package if it allowed you to change it. So when you start the new package, you should already know if you want it to be `VCL` or `FMX` (or other) and never will change it. Only in rare occasions of experimentation such as your own would you want to change it. – Jerry Dodge Aug 23 '14 at 05:16