简体   繁体   English

将fmx表单添加到Delphi Package

[英]Add fmx form to Delphi Package

As the title says really. 正如标题所说的那样。 How can I add an FMX form to a delphi package? 如何将FMX表单添加到delphi包中? In the package I have a Tpanel descendant component - which is all installed fine. 在包中我有一个Tpanel后代组件 - 所有安装都很好。 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) (我不想在设计时使用FMX表单 - 只是在运行时,所以我只想在包中包含FMX表单,但组件有设计时属性)

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. 似乎我只能在包中添加一个VCL表单 - 当我右键单击并向包中添加'new'时,它会尝试将VCL添加到包中 - 这是我不想要的。 I want to run it on OSX. 我想在OSX上运行它。

I've found plenty of adding VCL forms eg Adding forms and frames to packages probably something obvious I'm missing - tia 我发现有很多添加VCL表单,例如向包中添加表单和框架可能是我很遗憾的东西 - tia

Delphi XE6 on Windows 8/OSX target Delphi XE6在Windows 8 / OSX上的目标

Packages have affinity to a particular framework. 包对特定框架具有亲和力。 Your package appears to be a VCL package. 您的包似乎是VCL包。 In the .dproj file you will find 在.dproj文件中,您将找到

<FrameworkType>VCL</FrameworkType>

Change this to 将此更改为

<FrameworkType>FMX</FrameworkType>

to have affinity to FireMonkey. 与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. 大概你选择了VCL。 Or the package was created before FMX existed and the project upgrade process added (correctly) the VCL framework setting. 或者在FMX存在之前创建了包,并且项目升级过程(正确地)添加了VCL框架设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM