Recent

Author Topic: using DFM in both Delphi and Lazarus  (Read 13777 times)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: using DFM in both Delphi and Lazarus
« Reply #15 on: September 20, 2016, 06:59:19 pm »
Back in the day I used the simple DfmToLfm converter here to convert Delphi forms to Lazarus forms:

http://wiki.lazarus.freepascal.org/XDev_Toolkit

The idea is that I would only make form design changes on the Delphi side, then convert the forms whenever I wanted to test with Lazarus.

This also provided a way to correct some LCL deficiencies on Mac, specifically to substitute a Mac font instead of the .dfm font. And also to set some controls' TabStop property to False so that tabbing skips over controls that cannot receive focus on Mac (TButton, TComboBox, TRadioGroup, etc.).

Surely a simple converter from .lfm back to .dfm would be possible too.


tk

  • Sr. Member
  • ****
  • Posts: 361
Re: using DFM in both Delphi and Lazarus
« Reply #16 on: September 20, 2016, 09:03:06 pm »
But then, why is it necessary to recompile the Lazarus project with Delphi?

We also maintain code to be compilable both in Delphi and Lazarus in some cases. For example, our SW has been developed in Delphi with Alphacontrols, for Win. Since there is no Alphacontrols in Lazarus, the Linux version has native look. We don't want to drop Alphacontrols for Win, so Delphi project is still necessary.

And we use only one dfm for each form. There are some layout problems with this but it is better than maintaining dfm+lfm.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: using DFM in both Delphi and Lazarus
« Reply #17 on: September 20, 2016, 09:07:22 pm »
But then, why is it necessary to recompile the Lazarus project with Delphi?
The Delphi version works.
The Lazarus version is still not usable in real life. Too many regressions.

With the code compiled in Delphi I can ensure that this code is still okay
even though I changed a lot ..
usually using latest Lazarus release version with Windows 10

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: using DFM in both Delphi and Lazarus
« Reply #18 on: September 20, 2016, 10:46:39 pm »
A simple project setting to leave the forms alone would be best.

I myself use a lot of code between Lazarus and Delphi. Though the GUI ones are mostly test programs for codebases that are shared between them, I also have one zeos application.

But currently there are still too many regression problems that I don't have time to actively pursue.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: using DFM in both Delphi and Lazarus
« Reply #19 on: September 04, 2020, 01:40:09 pm »
Does anyone know a convertor from LFM to DFM?
I supoposed Delphi does not have an inbuilt converter.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: using DFM in both Delphi and Lazarus
« Reply #20 on: September 04, 2020, 03:49:57 pm »
Simply rename the .lfm file to have extension .dfm. When loading into Delphi there will be errors due to unknown properties you only can select to ignore them.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: using DFM in both Delphi and Lazarus
« Reply #21 on: September 04, 2020, 11:17:37 pm »
Thanks, renaming sound simple enough.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018