Recent

Author Topic: Ghost of a Frame?  (Read 5175 times)

William Marshall

  • Jr. Member
  • **
  • Posts: 52
Ghost of a Frame?
« on: October 19, 2014, 10:29:59 pm »
     I accidentally added a Frame to a form.  (I meant to add a Panel, but hit the wrong button.)  I deleted it, but now whenever I click on
any of the forms in my project, I get a window telling me to "Select Frame".  I deleted the frame, and there is no TFrame in the Object
Inspector.  I can't do anything in the Designer at all now.  How do I get rid of that window?  (I'm just beginning Lazarus - programming,
really.  I hope this is not an omen.)  Thanks for your help to a complete newbie.
Lazarus 1.8.0; fpc 3.0.4; Windows 10

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Ghost of a Frame?
« Reply #1 on: October 19, 2014, 11:06:43 pm »
Yes, it seems the Lazarus frame functionality may be broken in the latest release.
If you close Lazarus and delete your misbehaving project (.lpi, .lpr, *.pas/*.pp) you should find the IDE is back to normal and does not shove a "Select Frame" dialog at you all the time.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Ghost of a Frame?
« Reply #2 on: October 19, 2014, 11:21:33 pm »
Does it work in trunk?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Ghost of a Frame?
« Reply #3 on: October 19, 2014, 11:45:06 pm »
this behavior was as told from @William Marshall and in 1.2.4 forgot to mention it in the butracker ...

after adding the frame you have to click to the arrow icon is the first icon on the tollbar from the left and everything works as expected
« Last Edit: October 19, 2014, 11:50:26 pm by Never »
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

William Marshall

  • Jr. Member
  • **
  • Posts: 52
Re: Ghost of a Frame?
« Reply #4 on: October 20, 2014, 01:25:37 am »
Thank you for your replies.  I apologize for my own naive comments here.

howardpc: I really am a complete newbie, but I have written a fair amount of code for this project.  Do I really have to delete it all and
start again?

JuhaManninen: What's "trunk"?

Never: I've already deleted the frame (and won't be adding another one).  What can I do now?
Lazarus 1.8.0; fpc 3.0.4; Windows 10

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Ghost of a Frame?
« Reply #5 on: October 20, 2014, 09:46:45 am »
JuhaManninen: What's "trunk"?
The latest development version.

Lazarus code is stored in a source code version control system, subversion, which has a "trunk" and various "branches". The trunk is the newest code; whenever releases are made, they split off into branches (e.g. Lazarus 1.2). Each branch can receive fixes etc so new subreleases can be made (1.2.2, 1.2.4, 1.2.6...).
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Ghost of a Frame?
« Reply #6 on: October 20, 2014, 10:08:30 am »
howardpc: I really am a complete newbie, but I have written a fair amount of code for this project.  Do I really have to delete it all and
start again?

Perhaps not. There are always several ways to skin a cat.
First it may be that Never's suggestion (click on the Component Palette selection arrow icon when the project opens) may cure the problem.

If that does not help, try editing your project's main .lpr file, if it contains a reference to the ghost frame. Did you originally create a frame (File->New->Frame, OK) ? You edit this file via Project->View Project source.
If so it will look something like this:
Code: [Select]
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1, Unit2
  { you can add units after this };

{$R *.res}

begin
  RequireDerivedFormResource := True;
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
Look at the uses clause. Your project may have numerous units. In this example the "Unit2" (or whatever applies in your case) in the uses clause is the name of the frame unit. If you have such a frame unit specified here, simply delete it.

You probably have a backup of your work saved in a \backup directory (depending on your Lazarus settings, but it is there by default). If so, restoring a backup may get you going again, provided it comes from a time before the frame incident.

Failing that, start a new empty project, and add components until its main form matches what you want. You can copy and paste any other forms and/or units needed from your original project (both .pas and .lfm will be needed for forms). You'll have to adjust the main form's uses clause to reflect these new hand-added units.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Ghost of a Frame?
« Reply #7 on: October 20, 2014, 11:38:33 am »
@William Marshall
if you delete it already add one again
and click on the arrow immediately after you add it
I know it sounds *scrambled* but this is what worked for me

Edit :*** except this trick with the arrow when you add a new frame
 frames are responding as expected
« Last Edit: October 20, 2014, 11:49:56 am by Never »
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

William Marshall

  • Jr. Member
  • **
  • Posts: 52
Re: Ghost of a Frame?
« Reply #8 on: October 20, 2014, 09:48:03 pm »
Thank you all again for your help.  Never turns out to be the hero here.  I hadn't noticed that the Component Palette selection arrow wasn't
highlighted, so the Frame button was apparently on permanently.  Clicking the arrow fixed the problem.  I hope other problems I will have
(I'm sure there will be many) will be solved so easily, though with less near-panic on my part.
Again, many thanks to all of you.
Lazarus 1.8.0; fpc 3.0.4; Windows 10

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Ghost of a Frame?
« Reply #9 on: October 20, 2014, 10:54:19 pm »
@JuhaManninen just test it with trunk the behavior is the same as mentioned from @William Marshall
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

 

TinyPortal © 2005-2018