Recent

Author Topic: Adding an external form to a existing project  (Read 426 times)

What I can do

  • Full Member
  • ***
  • Posts: 127
Adding an external form to a existing project
« on: November 16, 2024, 05:51:19 pm »
Lazarus 3.4
Windows 10@64
Project: Add an existing form to present project.
I have a program that I made a Printer config Form
I liked it so I just added the uPrint to the user section of my next project and it worked perfect and flawless.
Great do the same to my next  project just add uPrint to the uses and all good.
wonderful lets do that again to another project but during compile
error can't find file for uPrint.pas
Humm, ok just open unit and it will show up in my Source Code windows
Wrong: not only did this not work for the third program it took away my Unit1 reference as the main window and now I have a new blank empty form that opens without any code  and my existing main unit is still in the Source code window and still has all my code and is still attached to main LPI file I just can't see it.

can anyone point me to the check point of file that starts up the lpi file that places which form is the main form.

VisualLab

  • Hero Member
  • *****
  • Posts: 614
Re: Adding an external form to a existing project
« Reply #1 on: November 17, 2024, 02:10:09 am »
In Delphi you could simply add the path to your libraries (and therefore to your file). In Lazarus there is no such thing as a list of libraries used in the IDE (or at least I haven't found such a solution). This is something I would like to see in Lazarus.

The only thing you can do is add the path to the library or module in the options of the created project. Only that this requires adding the path to each new project (even the smallest one). I would be very happy if it turns out that I am wrong :)

egsuh

  • Hero Member
  • *****
  • Posts: 1520
Re: Adding an external form to a existing project
« Reply #2 on: November 17, 2024, 05:11:08 am »
You can add Paths to  Project Options>Paths>Other Unit files.

Or, if you want to add existing form to a new or existing project, open the form file and "Project>add add editor file to project". Then the IDE will ask you whether to add the path to search paths.

 

TinyPortal © 2005-2018