4

I'm porting a app to FreePasal/Lazarus & found that their form converter is not good. I have a small utility app, and each time I do a change I need to reconvert, relayout and reimport graphics. Plus, some things are messed up.

I wonder if exist a automatic tool for convert the DFM files to delphi sourcecode, so I can do this more easily. Is not problem if the sourcecode is not FPC compatible.

mamcx
  • 15,916
  • 26
  • 101
  • 189

2 Answers2

11

The free GExperts plug-in has a "components to code" feature. Install it in your Delphi IDE and open the form you wish to convert. Select the components and invoke the command, and it will place equivalent creation and initialization code on the clipboard for you to paste wherever you need it.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
2

Updating to trunk versions of both Lazarus (0.9.29) and FPC (2.5.1) might also be a solution.

Several things have changed:

  • last month sb started working on the converters (Juha)
  • FPC 2.4+ bring the resource handling closer to Delphi (no more .lrs)
Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • I test that version. Well done! I remove all that lsr nonsense & the form have less errors in rendering. However, not work read from .dfm on osx, only lfm, but by now is good enough – mamcx Mar 15 '10 at 18:39
  • There is some JVCL tool to strip properties from dfms (useful when using recent Delphi's DFMs in older versions). I tried cleaning them this way, and linking the .dfms directly in lazarus worked. – Marco van de Voort Apr 17 '10 at 09:53
  • Meanwhile the world has turned a few times more, and a 2.4.2 with a corresponding lazarus that will also fix the OS X is starting it's release candidate cycle – Marco van de Voort Oct 12 '10 at 08:40