Recent

Author Topic: Form-Designer messes Application  (Read 2377 times)

DiscipleOfCode

  • Newbie
  • Posts: 2
Form-Designer messes Application
« on: November 21, 2017, 11:15:05 pm »

I "accidently" changed the Parent of a TabSheet in the Form-Designer to Form1.
(And was dumb enough to push the Compile-Button...)
Now the Application seems to be broken, at least the project1.res file is being messed!
Trying to delete it in the Object-Inspector fails with an access-violation and in the Form-Designer it is complete invisible now!
I still cant find a proper way to revert the wrong Parent-Setting but there is need for that, because a lot of Code is linked to this evil TabSheet, so what to do now ???
Just hoping, there will be soon a fix for that ugly issue out there,
because the resource Handling  of Lazarus acts
now truly RAD-like for me (Rapid Application Destruction).

my OS: Linux Mint 17.2 Rafaela Mate Desktop
my Lazarus Version: i386-linux-gtk2 1.4.2 , fpc: 2.6.4

(Btw: A first testing with Windows 1.6.4 Version offers the same ridiculous behaviour!!!)
Great Work Lazarus though, but a lil bit of Disappointment

jamie

  • Hero Member
  • *****
  • Posts: 6091
Re: Form-Designer messes Application
« Reply #1 on: November 21, 2017, 11:21:25 pm »
open the lfm which is a text file and correct the parenting of the tabsheets.

 Do this without the project loaded.

 If you have deleted items, they may not be there anymore, but, there used to be a
backup folder, and if you are serious about your app, you should be keeping backup copies
of your project.
The only true wisdom is knowing you know nothing

DiscipleOfCode

  • Newbie
  • Posts: 2
Re: Form-Designer messes Application
« Reply #2 on: November 21, 2017, 11:26:47 pm »
Thanks for the Reply, I guess:
You can correct the parenting of the TabSheets in the *.lfm
but be aware that you cant reuse that Tab later again, coz its NO more registered in the (Laz) resource. Ok, lets live with that...

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Form-Designer messes Application
« Reply #3 on: November 21, 2017, 11:55:56 pm »
You can correct the parenting of the TabSheets in the *.lfm
but be aware that you cant reuse that Tab later again, coz its NO more registered in the (Laz) resource. Ok, lets live with that...
No, the *.lfm file is the master. Form's components and parent-child relations are defined there. You don't need any extra resource for it.
Such a corruption is one of the few situations where you need to edit the *.lfm file directly. The designer should prevent this happening I guess.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Form-Designer messes Application
« Reply #4 on: November 22, 2017, 04:05:16 am »

I "accidently" changed the Parent of a TabSheet in the Form-Designer to Form1.
(And was dumb enough to push the Compile-Button...)
which form-designer? lazarus form designer? if yes then why not revert the unit to the svn revision you started with?
Now the Application seems to be broken, at least the project1.res file is being messed!
Messed how? when in doubt take a backup of the file and delete so the IDE can recreate it for you.

Trying to delete it in the Object-Inspector fails with an access-violation and in the Form-Designer it is complete invisible now!
I still cant find a proper way to revert the wrong Parent-Setting but there is need for that, because a lot of Code is linked to this evil TabSheet, so what to do now ???
the lfm file is text based you can open it and edit the properties there I recommend to do it outside the IDE with the IDE closed for starters (as already advised).

Just hoping, there will be soon a fix for that ugly issue out there,
because the resource Handling  of Lazarus acts
now truly RAD-like for me (Rapid Application Destruction).
It is, isn't it? but I steel do not understand which form designer you talking about and what it has to do with the project1.res

You can correct the parenting of the TabSheets in the *.lfm
but be aware that you cant reuse that Tab later again, coz its NO more registered in the (Laz) resource. Ok, lets live with that...
Sorry you lost me what do your mean it is not registered with the resource? There are only two states of resource it is present and loaded or not present and it never loads the property values. the only thing that can go wrong is to improperly edit the lfm and break the hierarchy of its items.
Any way a more concrete example is needed with specific failure description we can't help if we only know your interpretation of the situation we need access to the problematic behaviour.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018