Recent

Author Topic: [SOLVED] Help: The Form has disappeared from View Project Forms  (Read 652 times)

valter.home

  • Jr. Member
  • **
  • Posts: 75
Hello everybody. Unfortunately I made a mess while saving a new unit. I cannot list the exact steps but I realized that I was saving the Form unit with another name, I canceled it but now I no longer have access to the Form during the design phase. The application is compiled and starts normally but no more warnings appear in the Messages window.
Where could I look to restore it?
It's a disaster, there are thousands of lines of code and a form with a very complex TPageControl. Rebuilding everything would be a tough job.
« Last Edit: April 17, 2021, 06:28:06 pm by valter.home »

howardpc

  • Hero Member
  • *****
  • Posts: 3716
Re: Help: The Form has disappeared from View Project Forms
« Reply #1 on: April 17, 2021, 05:38:17 pm »
You might have changed the settings, but a default Lazarus IDE generates a backup subdirectory in each project directory.
If you have this, start by looking there.

AL

  • Full Member
  • ***
  • Posts: 226
Re: Help: The Form has disappeared from View Project Forms
« Reply #2 on: April 17, 2021, 05:57:10 pm »
If your program compile and run, the form/unit is still there.
Look in the project inspector (menu: project/project inspector) and try to re-add your .pas unit  and .lfm to the project.
Laz 2.1.0, fpc 3.3.1, Win10
Laz 2.1.0, fpc 3.3.1, Mac OS Mojave running on VMWare
Laz 2.1.0  fpc 3.3.1 Ubuntu 20.04

valter.home

  • Jr. Member
  • **
  • Posts: 75
Re: Help: The Form has disappeared from View Project Forms
« Reply #3 on: April 17, 2021, 06:27:33 pm »
I solved it by creating a new project, overwriting the .lfm file with that of my application, modifying some data in the .lpr file, setting File and Required Packages in the Project inspector and finally copying my units to the new project.
I had a bad time.
Thanks for your feedback.

wp

  • Hero Member
  • *****
  • Posts: 8373
Re: [SOLVED] Help: The Form has disappeared from View Project Forms
« Reply #4 on: April 17, 2021, 07:09:08 pm »
I've seen similar issues, and it fact it is very easy to destroy packages this way: Create a new project. Add a chart to the form. Suppose you want to look up something about TChart in the TAChart package - I ctrl-click on the identifier TChart in the editor to open the TAGraph unit. Then something happens to distract my attention, and I do not realize that the TAGraph unit is the active file in the editor. Now I want to save the new project: with TAGraph still active in the editor I select routinely select "File" > "Save As", navigate to the folder which should hold the new project, and enter a filename for the main form not realizing that I am writing TAGraph under a new name to a new location! I usually realize this issue in the next step when the IDE asks me whether the old TAGraph.pas should be deleted. But even if I say "no" - it's too late: the file already has been relocated!

So, always be at the highest level of attention when saving new files. The file to be saved must always be the active file in the editor!
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

valter.home

  • Jr. Member
  • **
  • Posts: 75
Re: [SOLVED] Help: The Form has disappeared from View Project Forms
« Reply #5 on: April 17, 2021, 08:15:01 pm »
Quote
when the IDE asks me whether the old TAGraph.pas should be deleted

That's exactly what happened! But as you say it was too late...

Quote
The file to be saved must always be the active file in the editor!

Of course, it must be so, unfortunately I was distracted but this will never happen again. As always we learn from mistakes... but today it went really well, a lot of fear but I recovered everything.

 

TinyPortal © 2005-2018