[Lazarus] Lazarus updates dfm not lfm and changes to form NOT being shown at run time.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Lazarus updates dfm not lfm and changes to form NOT being shown at run time.

Peter Williams
Hi All,

I have a Lazarus project which I ported from a Delphi one. It has 2 units with a form each e.g. unit1, form1 & unit2, form2. I used the Tools conversations menu items to convert it and the forms and units. 

It all works fine except that when I change form1, then changes are made to form1.dfm and not to form1.lfm.

Can someone please help me check out why the wrong form is being updated. I know this because when I edit form1, and run it, the changes do not appear when I run it. I see the form1.lfm which has not been changed. It seems that form1.dfm is getting changed.

Best Regards,
Peter / pew

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus updates dfm not lfm and changes to form NOT being shown at run time.

Mattias Gaertner
On Sat, 19 Mar 2011 11:10:26 +1100
Peter Williams <[hidden email]> wrote:

>
> Hi All,
> I have a Lazarus project which I ported from a Delphi one. It has 2 units with a form each e.g. unit1, form1 & unit2, form2. I used the Tools conversations menu items to convert it and the forms and units.
> It all works fine except that when I change form1, then changes are made to form1.dfm and not to form1.lfm.
> Can someone please help me check out why the wrong form is being updated. I know this because when I edit form1, and run it, the changes do not appear when I run it. I see the form1.lfm which has not been changed. It seems that form1.dfm is getting changed.

When the IDE opens/saves a form it first searches for a file with the
same name as the unit but with the extension '.lfm'. If this is not
found it searches for a '.dfm'.
I just tested with a form1.pas, form1.lfm and form1.dfm: only the
form1.lfm was changed.

Please try this:
rename the form1.dfm to form1.dfm_old
Then edit the form. Do you get any error? What file is changed?

Mattias

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

[Lazarus] SOLVED - RE: Lazarus updates dfm not lfm and changes to form NOT being shown at run time.

Peter Williams
Hi Mattias,

> Date: Sat, 19 Mar 2011 07:49:14 +0100
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Lazarus] Lazarus updates dfm not lfm and changes to form NOT being shown at run time.
>
> On Sat, 19 Mar 2011 11:10:26 +1100
> Peter Williams <[hidden email]> wrote:
>
> >
> > Hi All,
> > I have a Lazarus project which I ported from a Delphi one. It has 2 units with a form each e.g. unit1, form1 & unit2, form2. I used the Tools conversations menu items to convert it and the forms and units.
> > It all works fine except that when I change form1, then changes are made to form1.dfm and not to form1.lfm.
> > Can someone please help me check out why the wrong form is being updated. I know this because when I edit form1, and run it, the changes do not appear when I run it. I see the form1.lfm which has not been changed. It seems that form1.dfm is getting changed.
>
> When the IDE opens/saves a form it first searches for a file with the
> same name as the unit but with the extension '.lfm'. If this is not
> found it searches for a '.dfm'.
> I just tested with a form1.pas, form1.lfm and form1.dfm: only the
> form1.lfm was changed.
>
> Please try this:
> rename the form1.dfm to form1.dfm_old
> Then edit the form. Do you get any error? What file is changed?
Everything now works as expected. I found that in unit1.pas there was a {$R *.dfm} statement which I needed to change to {$R *.lfm}.

I appears that the Tool for converting Delphi DFM forms to Lazarus LFM forms needs to be updated so that it's unit then has a {$R *.lfm} statement instead of the dfm one.

>
> Mattias

PEW

> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus