Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


October 19, 2011

From VCL to FireMonkey

A significant issue for Delphi developers (and a hot topic at CodeRage 6) is how to migrate VCL applications to FireMonkey or make VCL and FM forms coexist in a single application.

A significant issue for Delphi developers (and a hot topic at CodeRage 6) is how to migrate VCL applications to FireMonkey or make VCL and FM forms coexist in a single application.

Converting From VCL to FireMonkey

There are currently two tools that I know of for converting VCL forms (not the actual code behind them, only the DFM elements) to FireMonkey. One of them is Mida , which happens to be done by an Italian developer, the second is MonkeyGroomer . I was discussing this topic last week at a workshop, mentioned taht there is an interesting tool with a odd business model (you have to pay for the tool and there is little upfront information), when a person in the audience raised his hand and told me he was the author. I pushed him to explain his tool better, and over the weekend he did this video:

I'm going to play with this tool and test it in the coming days and I'll blog again about it. It seems that Mida is currently more complete than MonkeyGroomer, at least on the VCL side. In fact, the MonkeyGroomer tool started as a converter from VGScene, now being extended for VCL. Bit difference is that this last tool is free (currently, not sure about fugture plans), while Mida is priced at 99 Euros. Again, I'll look more into these tools and let you know my honest opinion.

Using VCL And FireMonkey Together

Another options, mostly meant as a temporary solution, is to add FireMonkey forms to a VCL application as a migration step. At the end, you'll have a converted application. One demonstration of how to manage this process comes from Steven Ball of Embarcadero UK. His blog post is has basically only a video:

Another option is to simply mix forms in the project, and while the Delphi IDE will try to works against this, Simon Stuart today has released MonkeyMixer . Here is the video demonstrating the process of building mixed applications with and without his IDE plugin:

That's all for now, but I'm sure many tools will appear helping migration of VCL programs.





 

7 Comments

From VCL to FireMonkey 

First I want to thank you for blogging about this
topic, and again for mentioning both MonkeyGroomer and
MonkeyMixer.

I just want to emphasize the point that both
MonkeyMixer and MonkeyGroomer are 100% free, will
always be free, and are being heavily maintained and
improved!
In fact, the next release of MonkeyGroomer (supporting
VCL) will integrate MonkeyMixer's functionality
directly into one plugin!

MonkeyGroomer uses a highly robust method to work its
magic! Basically, it uses a series of "Conversion
Model Scripts" which provide the MonkeyGroomer engine
with all the information it needs to know about VCL
and FireMonkey types, as well as sets of instructions
on how to convert from VCL to FireMonkey for each
individual type!

The scripts can auto-update from an online repository
(automatically), and users can produce their own!
Third-party VCL vendors who decide to target
FireMonkey can also produce and provide conversion
scripts for their own components, extending the
coverage of MonkeyGroomer's conversion capabilities!

MonkeyGroomer doesn't just interpret your VCL Forms'
DFM files and spit out their FMX equivalent, it also
updates the associated .PAS sources for you and
modifies the DPR and DPROJ files, saving everyone even
more time and hardship!

If MonkeyGroomer doesn't recognize a component in use
in your application, it will attempt to locate a
conversion script from the online repository! If it
locates one, it will be used, if not it will inform
you in a report at the end of the process!

Jeff Lefebvre and myself also plan to make
MonkeyGroomer inform you of any platform specifics,
and any controls/code in your application which would
prevent you from targeting other platforms.
We're also discussing the idea of making this check
for cross-platform (or platform-inspecific)
alternatives you can use to allow you to target other
platforms with minimal fuss.

Hope this information helps, and just so you know...
this information has been given exclusively to Marco
Cantú's blog!
Comment by Simon J Stuart [http://www.simonjstuart.com] on October 19, 17:32

From VCL to FireMonkey 

 A small question remains for me unaswered, though 
rather obvious. MonkeyGroomer can convert units which 
uses 3rd party components only if there is FMX set of 
theses components installed and there are convertion 
scripts in repository, right? Probably, custom 
scripts in repository are needed when VCL and FMX 
namespaces of the components differ not only by the 
base properties and you need to map or transform 
them. Looking forward to try it myself :) Thank you!
Comment by IL [] on October 20, 06:24

From VCL to FireMonkey 

Hello. 
Another possibility along with the joint use forms is to 
use packages that I've explained in this post from my 
blog last week. 

http://neftali.clubdelphi.com/?p=1835

Regards.
Comment by Neftalí -Germán Estévez- [http://neftali.clubdelphi.com/] on October 20, 08:51

Mida 

I agree with Simon for thanks to Marco for the 
visibility of a product

regardless of the choice that is certainly useful to 
many people.


I would like to clarify what the project Mida is, 
first of all is not only a converter components.

The goal is to create a real converter applications 
from VCL to FireMonkey.


Are converted and handled more than 200 components 
and the number rises from version to version,

DataModule are supporting very well, the. pas, 
projects (. dpr) both Delphi and C++ Builder.


At the end of the conversion comes in very detailed 
log of work done, parts are portable and advice
to help in porting to FireMonkey.


All recalled by the 'IDE with a click.



Recently available the new version of Mida 1.5 with 
support for LiveBindings and C++ Builder XE2.

http://www.youtube.com/watch?v=QQ_GD1flFRU


Given a traditional application (not a test form with 
two TButton) with standard Delphi components dbaware
you can now get a complete working application 
FireMonkey, with components such as: TBindScopeDB and 
TBindingsList


as well as the bidirectional links are created and 
ready to use.

are supported all db with FireMonkey support.



The next target is, still missing about 30% of the 
work, is to allow an extension custom for 
transformation component

easily creatable by a company that produces VCL 
components or directly by users.

all downloaded automatically from our servers.



The version 2.0 but will extend further limit.

Conversion will be managed (intelligent) the SOURCE 
CODE of all project, can help significantly in the 
conversion of code pascal when is not compatile with 
FireMonkey. 

The code changes are very often not easily 
upgradeable on search / replace.


Mida has a modest cost, two hours of work of an 
employee, the savings are significant.

For a manual VCL conversion the weeks (months?) 
become a few days.




Best Regards

Mauro Botta

http://midafiremonkey.wordpress.com
Comment by Mauro Botta [http://midafiremonkey.wordpress.com] on October 20, 10:15

Mida 1.7 update 

After the upgrade to Mida 1.5 that has added support 
for LiveBindings and C++Builder XE2

i am pleased to present the availability of Mida V. 
1.7 for Delphi and C++Builder XE2


The new main features :

* Custom conversion for components and property not 
supported from Mida

This implementation is really important.

Mida operates nearly 250 components, but if you have 
some components that you create you can teach at Mida 
what class FireMonkey convert

You can move the value from one property to another, 
too. ( .caption -> .text )


* Image support ( The images within TImage now being 
converted into FireMonkey – PNG / JPG …. )

* New interface

Video Link Mida 1.7:
http://www.youtube.com/watch?v=bFuSe4HKoNc

Best Regards

Mauro Botta
http://midafiremonkey.wordpress.com
Comment by Mauro Botta [http://midafiremonkey.wordpress.com] on October 30, 21:55

From VCL to FireMonkey 

Great page Marco. 

For further reading, there is also now an example of getting VCL apps to 
call a DLL with a FireMonkey form in it. This requires the GDI+ to be initialised. This is required from the application calling the DLL and is as 
simple as adding Winapi.GDIPOBJ to the uses clause.
 
The blog also has links to a C# version using the same DLL and example 
code in Code Central.

Happy coding! Stephen
Comment by Stephen Ball [http://blogs.embarcadero.com/stephenball/2011/10/10/writing-a-firemonkey-dll-for-use-with-a-vcl-application/] on November 25, 12:55

Anchors 

Does anyone know if these tools, also convert Anchors to 
the FireMonkey equivalent?
Comment by Jarno [] on March 14, 23:08


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.