JohnLM 23 Posted December 20, 2022 I was wondering if there was a program or tool or whatever you want to call it, for taking a VCL project and converting its components over to an FMX project and be able to open and continue working on it in the FMX environment. I have over time been in this situation, where I start out with VCL but later decide I could use this in Android. Today I'm in that situation. I mainly have tbuttons, tmemos, tpanels, tedits, and ttabs. Share this post Link to post
programmerdelphi2k 237 Posted December 20, 2022 in fact, not! because exists many differences between it. then, you always will have code it. in RAD you can find "reFind.exe" that allow "replace" occurrences by other, but you need create your script manually 1 Share this post Link to post
TigerLilly 16 Posted December 20, 2022 In fact, there is: http://midaconverter.com/ https://www.fmxexpress.com/convert-your-delphi-vcl-apps-to-firemonkey-with-mida/ 1 Share this post Link to post
limelect 50 Posted December 20, 2022 (edited) Try this for free https://github.com/e-delphi/VCL2FMX/ Edited December 20, 2022 by limelect Share this post Link to post
Lars Fosdal 1800 Posted December 20, 2022 Personally, I would probably not use such tools. The move from one visual component lib to another on a different platform is going to cause headaches. You would not want to do direct DB from a mobile device, you often can't use tabs and dialogs the same way - the UI form factor is different, touch vs mouse is different. If the biz logic is done in separate classes, such a move is not difficult to do manually. If it is tightly intertwined with GUI code - you will have a job on your hands. As for the state of Mida - the last update on their forums were in April 2019? 1 Share this post Link to post
Keesver 24 Posted December 20, 2022 Be careful with Mida. From my experience the software is not working. Although it can still be purchased, it won't run because at startup the software cannot contact their license server and then stops. I tried contacting the developer many times, never had a response. 1 Share this post Link to post
Angus Robertson 590 Posted December 20, 2022 I've started converting ICS VCL sample applications to FMX, using VCLToFireMonkeyFormConvtr.exe from: http://www.innovasolutions.com.au/delphistuf/ADUGVCLtoFMXConv.htm or https://github.com/rogerinnova/Delphi-Firemonkey-Dunit It is very basic, search and replace using an INI file, not looked at the Github version, but the zip download was for XE5 and the INI file needed several changes to bring to cope with the latest FMX forms. I mapped TListView to TStringGrid, TRadioGroup to TListBox, TBitBtn to TButton, TComboBox to TComboEdit, TRichEdit to TMemo, TPageControl to TTabControl, and a few other things. TGrid would be better than TStringGrid, except it uses virtual data (which the help fails to mention) which needs a lot of rewriting. TRadioGroup is the biggest problem, visually you can do it, but there is no simple ItemIndex to use, so TListBox with or without a separate caption is easier. I can share my INI file is anyone wants it, but it's a work in progress, several more samples to convert. Angus 1 Share this post Link to post
programmerdelphi2k 237 Posted December 20, 2022 (edited) in the end, basically, all will be a "find(s) and replace(s)"... and YOU'll have that code it! Edited December 20, 2022 by programmerdelphi2k Share this post Link to post
JohnLM 23 Posted December 22, 2022 I've been busy in several things that kept me busy. Life stuff. Anyway. I wanted to thank you all for all the info on this. I will read through it again some more, thanks. Share this post Link to post
scuba_maldives 0 Posted January 11 On 12/20/2022 at 11:24 AM, Angus Robertson said: I've started converting ICS VCL sample applications to FMX, using VCLToFireMonkeyFormConvtr.exe from: http://www.innovasolutions.com.au/delphistuf/ADUGVCLtoFMXConv.htm or https://github.com/rogerinnova/Delphi-Firemonkey-Dunit It is very basic, search and replace using an INI file, not looked at the Github version, but the zip download was for XE5 and the INI file needed several changes to bring to cope with the latest FMX forms. I mapped TListView to TStringGrid, TRadioGroup to TListBox, TBitBtn to TButton, TComboBox to TComboEdit, TRichEdit to TMemo, TPageControl to TTabControl, and a few other things. TGrid would be better than TStringGrid, except it uses virtual data (which the help fails to mention) which needs a lot of rewriting. TRadioGroup is the biggest problem, visually you can do it, but there is no simple ItemIndex to use, so TListBox with or without a separate caption is easier. I can share my INI file is anyone wants it, but it's a work in progress, several more samples to convert. Angus Would you be able to send me the file please. Ian. Share this post Link to post
Angus Robertson 590 Posted January 11 This is the INI file I used with VCLToFireMonkeyFormConvtr.exe, it also has a few ICS components that should not matter. Not used it a for a couple of years. Angus VCLToFireMonkeyFormConvtr.ini 1 Share this post Link to post
scuba_maldives 0 Posted January 12 Thank you. I am not sure if this is good or not. Does anyone have any better tools for doing the VCL to FMX translation please? Share this post Link to post
Lars Fosdal 1800 Posted January 13 I would recommend porting manually by hand after researching which components need to be replaced. If you separate the biz logic from the UI, that would not be as complicated as trying to do a UI to UI remapping. Share this post Link to post
GabrielMoraru 17 Posted January 21 (edited) I have done some tests using 4 different methods. None is sufficient. I will have to bring the the FMX to VCL converter up to date. I am working on it (I will put it in my git repository). Edited January 21 by GabrielMoraru Share this post Link to post
GabrielMoraru 17 Posted Sunday at 09:22 AM (edited) Update: the old convertor (9 years old) was brought up to date. This is the major update! It has: True unicode support! Fixed bugs Better file handling Smaller code English instead of spanish There is plenty of room for optimizations. I will try to update it as necessary. (Precompiled exe file available) PS: does anyone know how to reduce its size? It is 10MB! Edited Sunday at 09:23 AM by GabrielMoraru 2 Share this post Link to post
limelect 50 Posted Monday at 07:56 PM (edited) @GabrielMoraru You are missing cbAppDataFmx in your source and ccCore, too missing CR, LF not define and what is that? AppData:= TAppData.Create('MyCollApp'); AppData.CreateMainForm(TfrmMain, frmMain, False, True); // Main form Edited Monday at 08:03 PM by limelect Share this post Link to post
GabrielMoraru 17 Posted Monday at 09:21 PM (edited) 1 hour ago, limelect said: You are missing cbAppDataFmx in your source and ccCore, too missing The LightSaber goes through a massive change right now, because I want to make it FMX compatible. For 24h some files were missing indeed. Now everything should be fine. I think you have the old code. Please pull the new code. Let me know if something is still missing. _____________________________ PS: still ccCore.pas should not be missing. that the most important file from the whole library. _____________________________ TAppData is a replacement for TApplicationData. Does a few extra cool things compared to TApplication, such as: embedded support for "AppData" folder and INI files (the ini files knows how to save themselves to the AppData folder), support to save GUI state to disk and reload it when the next time the app starts (don't abuse it 🙂 ), support for exe version number, exe self-restart, support for self-translating GUI, support for Internet updater, logging system, app installer/uninstaller "RunningFirstTime" in this computer etc etc etc etc etc etc etc etc etc etc etc etc You have a demo in "Demo\Template App\TemplateApp.dpr" that shows all those capabilities of TAppData. _____________________________ At this point I make no guaranty about any file marked with "FMX". Fmx support at this point is highly experimental (though the Vcl2FMX compiles under FMX). _____________________________ I released another update for VCL2FMX. The code had a massive grudge against Unicode. I guess it was written in a Delphi before unicode? I think I made a mistake in updating that code. I should have written that from zero! Now it works. At least on one of my old VCL programs that I use for testing There was also a massive mem leak (the fastmm report log was 1.4MB! I cut it down to few KB). Edited Monday at 09:36 PM by GabrielMoraru Share this post Link to post
limelect 50 Posted Tuesday at 09:00 AM @GabrielMoraru Missing still cbAppDataFmx, ccCore maybe more Share this post Link to post
limelect 50 Posted Tuesday at 09:06 AM why save is in the middle of the form? Share this post Link to post
GabrielMoraru 17 Posted Tuesday at 07:59 PM (edited) 10 hours ago, limelect said: @GabrielMoraru Missing still ccCore Have you even tried to debug? 0. The file is present in Github. It was never missing: https://github.com/GabrielOnDelphi/Delphi-LightSaber/blob/main/ccCore.pas Which leads us to: 1. The main file of the project says that Vcl2Fmx requires the LightSaber library. Have you even downloaded the LightSaber library? Which leads us to: 2. You need to check your local files. Have you even tried to find it in your computer? If the Explorer returns a result it means that you have it. Which leads to: 3. Are your Paths set correctly? The Vcl2Fmx project needs to find the LightSaber library. Edited Tuesday at 08:04 PM by GabrielMoraru Share this post Link to post
limelect 50 Posted Tuesday at 08:17 PM (edited) It seems you don't read carefully still missing cbAppDataFmx Well I do not presume to be the debugger OK it seems you added the file later But now you use newer Delphi and mine is 10.2.3 so good luck. There are out there even Delphi 5 Stop guys using NEW (above 10) as not everybody has the luxury of buying every year a new Delphi. P.S I have been with Delphi since #1 Edited Tuesday at 08:27 PM by limelect 2 Share this post Link to post
limelect 50 Posted Tuesday at 08:45 PM (edited) Ok, I tried to fix all values of newer Delphi but got stacked as too much work; on file ccTextFile line 335 no s:= Stream.ReadStringA(1024*KB); so I do not feel like going on. P.S. I fixed 4 files by now but stopped. So good luck. Edited Tuesday at 08:46 PM by limelect Share this post Link to post