如何在一个应用程序中同时使用VCL和FMX? [英] How to have both VCL and FMX in one application?

查看:1902
本文介绍了如何在一个应用程序中同时使用VCL和FMX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VCL应用程序和漂亮的隔离VCL代码。我想包括Mac猴子表单Mac OSX支持。



我计划使用大量的IFDEF来确定应该使用VCL构建Windows还是Mac OSX使用FireMonkey。 / p>

不幸的是,如果应用程序是VCL,则无法从项目经理中添加MacOS平台。



有一种方法来黑客这种不知何故?可能手动调整.dpr和.dproj文件?

解决方案

b
$ b


  • 以FireMonkey应用程序开始

  • 添加OS X平台目标

  • IFDEF,以便您可以在VCL或FireMonkey之间选择



这不是很难做到这一点的1 form项目,添加所有现有的东西从你当前的VCL dpr。



这可能实际上导致你能够弄清楚如何.dpr和.dproj的VCL和FireMonkey不同我试过一次,但是在短期内做得太多了,所以为了将来的研究而搁置了)。



注意:



在您的DPR文件中放置IFDEF时要非常小心。 Delphi IDE拥有DPR文件,并将删除IFDEFS,例如当您添加新表单或更改一些项目属性时。


I have a VCL application and pretty isolated VCL code. I would like to include Fire Monkey forms for Mac OSX support.

I plan using heavily IFDEF to determine should I build for Windows with VCL or for Mac OSX with FireMonkey.

Unfortunately there is no way to add MacOS platform from the Project Manager if the application is VCL one.

Is there a way to hack this somehow? Maybe manually tweak the .dpr and .dproj files?

解决方案

What about doing it the other way around:

  • start with a FireMonkey application
  • add the OS X platform target
  • IFDEF it so that you can chooise between VCL or FireMonkey

It is not that hard to do this for a 1-form project, then add all the existing stuff from your current VCL dpr.

This might actually lead you to be able to figure out how the .dpr and .dproj of VCL and FireMonkey differ (I tried once, but it was too much to do in a short term way, so I shelved it for future research).

Note:

Be very careful when putting IFDEF in your DPR files. The Delphi IDE owns DPR files, and will remove the IFDEFS, for instance when you add new forms or change some project properties.

这篇关于如何在一个应用程序中同时使用VCL和FMX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆