Recent

Author Topic: [SOLVED]Lost graphic of Form1  (Read 4007 times)

muonman

  • Newbie
  • Posts: 6
[SOLVED]Lost graphic of Form1
« on: November 21, 2018, 03:22:45 pm »
I have been using Lazarus for many years on and off and it is excellent, well done all developers. I have recently returned to a project shelved 5 years ago and am continuing development steadily with no issues other than my own ineptitude. My program is working fine BUT in the IDE I cannot  find the graphic of one of my forms although it displays and functions at run-time. I noticed it when I wanted to add an item to a TCombobox and could not find the Form. I edited the code in the .frm file to no effect and had to edit the text in the .lrs file which is not ideal. Any thoughts?
« Last Edit: November 23, 2018, 06:09:45 pm by muonman »

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Lost graphic of Form1
« Reply #1 on: November 21, 2018, 03:31:54 pm »
I don't understand. What graphic is lost? What Form you cannot find?

You can go to Project -> Forms ... and open it. Also, open Project Inspector and check if all files are there. Or check Paths in Project Options (node Compiler Options -> Paths).
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

muonman

  • Newbie
  • Posts: 6
Re: Lost graphic of Form1
« Reply #2 on: November 21, 2018, 03:56:42 pm »
A little more detail is needed.  I designed and built a package of 8 forms several years ago. At that time it was possible to click Project > Forms... and see all my forms listed (Form1 to Form8) Today the program works fine but if I try and locate Form1 in order to modify it its form is nowhere to be found (so far) Clicking Project > Forms... lists Form2 to Form8. The files Form1.(lrs,lfm,pas,o) are all present in the project directory OK.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lost graphic of Form1
« Reply #3 on: November 21, 2018, 06:23:27 pm »
[...] Clicking Project > Forms... lists Form2 to Form8. The files Form1.(lrs,lfm,pas,o) are all present in the project directory OK.

If the files are really there you can try to re-add the form to the project in the Project inspector.

To make sure there's no problem with Form1.lfm/Form1.pas use "File ->Open" to open Form1.lfm and then whack F12 a couple times to pass from the form in the editor to the form in the designer and, finally, to the source Unit1.pas in the editor.
« Last Edit: November 21, 2018, 06:34:06 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

muonman

  • Newbie
  • Posts: 6
Re: Lost graphic of Form1
« Reply #4 on: November 22, 2018, 09:52:14 am »
Thanks for the hints. To avoid confusion the working name of Form1 in my package is Main.
I loaded Main.frm and Main.pas and from Main.frm in the editor tried the F12 toggle which yielded the following error:

>Unable to find the component class "TLTCPComponent" It is not registered via RegisterClass and no lfmwas found. It is needed by unit: /home/nigel/GPI/main.pas

I can compile and run my package and the TCP component is clearly there because all my network functions work??
I have to confess to not fully understanding the Registering concept in Lazarus, I thought it was a concept left behind with MS Windows but I am only a physicist :)

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lost graphic of Form1
« Reply #5 on: November 22, 2018, 12:29:17 pm »
Unable to find the component class "TLTCPComponent" It is not registered via RegisterClass and no lfmwas found. It is needed by unit: /home/nigel/GPI/main.pas

That's from the lNet package, isn't it? Make sure you have the package installed (Lazarus' menu "Packages") and, if not, install it so its components/classes get "registered". See lNet: Installation in the wiki.

Do the same for any other third-party packages you used.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

muonman

  • Newbie
  • Posts: 6
Re: Lost graphic of Form1
« Reply #6 on: November 23, 2018, 03:31:28 pm »
I think I have sussed it out. The problem of the missing form was a consequence of the IDE not completing the loading of the project. Fortuitously everything except the Form graphic, with its pointers to the TLTCPcomponent, was loaded hence all my code development worked OK, as the form shown in the IDE is just for humans. I have now moved my query to the General Tab under IDE and now concerns the ppu in "wrong" place error that stopped the build of the IDE. Thanks for your help
Now to find out how to terminate this thread :)

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Lost graphic of Form1
« Reply #7 on: November 23, 2018, 05:34:18 pm »
Now to find out how to terminate this thread :)

That's easy :D
Edit the very first post and put "[SOLVED] Lost graphic of Form1" as the post's subject.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

muonman

  • Newbie
  • Posts: 6
Re: Lost graphic of Form1
« Reply #8 on: November 23, 2018, 06:08:57 pm »
Thanks Lucamar.

 

TinyPortal © 2005-2018