Recent

Author Topic: Forms only appearing as .lfm code when I open a project  (Read 3165 times)

eurythmic

  • New Member
  • *
  • Posts: 36
Forms only appearing as .lfm code when I open a project
« on: October 08, 2015, 06:42:56 pm »
Hi,

I have written a project with two forms. When I open the project it only shows me the code of the forms, not the actual form view. Going to View > Forms just opens the code view too. The program runs fine but I can't get at the forms. Any ideas?!

Thanks,

Sophie

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Forms only appearing as .lfm code when I open a project
« Reply #1 on: October 09, 2015, 03:16:36 pm »
Do you mean that you can see the code of the .lfm file ? Like:
Code: Pascal  [Select][+][-]
  1. object Form1: TForm1
  2.   Left = 234
  3.   Height = 240
  4.   Top = 137
  5.   Width = 320
  6.   Caption = 'Form1'
  7.   ClientHeight = 240
  8.   ClientWidth = 320
  9.   LCLVersion = '1.4.2.0'
  10.   object Button1: TButton
  11.     Left = 176
  12.     Height = 56
  13.     Top = 25
  14.     Width = 108
  15.     Caption = 'Button1'
  16.     TabOrder = 0
  17.   end
  18. ...
  19.  

Or that you can see the code of the concerned unit ? Like the 'Unit.pas' unit for the 'Form1.lfm' form.


In the second case, a wrong position for the form could be a possible explanation: look at the left and top properties of your form for the offending .lfm files in the object inspector.

Or your .lfm files might be "altered" in the first case ? Could you post one of them in this case (in a zip file for instance) ?

Is it happening only for this project, or even also for a new fresh project for instance ?
« Last Edit: October 09, 2015, 03:18:11 pm by ChrisF »

eurythmic

  • New Member
  • *
  • Posts: 36
Re: Forms only appearing as .lfm code when I open a project
« Reply #2 on: October 10, 2015, 06:35:35 pm »
Thanks - it's the .lfm code that I can see. It only happens for a particular project. I'll check the form position when I get to work on Monday and see if this is the culprit!

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Forms only appearing as .lfm code when I open a project
« Reply #3 on: October 10, 2015, 08:44:42 pm »
If you can see the .lfm code, the form position check is most probably irrelevant.

You may eventually make a try by deleting (save it before) your .lps file before opening your project.

There is an option to see the the source form "View source (.lfm)" indeed, but theoretically it shouldn't forbid you to see the form.

If you've converted a Delphi project, or if you've got dependency troubles, you may also eventually have a look at this -a bit old- article:

http://jessicarbrown.com/blog/2012/09/24/debugging-forms-ported-from-delphi-to-lazarus/


 

TinyPortal © 2005-2018