Recent

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

valter.home

  • Jr. Member
  • **
  • Posts: 81
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: 4144
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

  • Sr. Member
  • ****
  • Posts: 256
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 3.1, fpc 3.2.2, Win10
Laz 3.1  fpc 3.2.2, MacOS Monterey running on VMWare/Win 10
Laz 3.1  fpc 3.2.2 Ubuntu 20.04

valter.home

  • Jr. Member
  • **
  • Posts: 81
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: 11830
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!

valter.home

  • Jr. Member
  • **
  • Posts: 81
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