Recent

Author Topic: Lazarus Object Inspector is inactive  (Read 12057 times)

max2

  • New Member
  • *
  • Posts: 10
Lazarus Object Inspector is inactive
« on: December 25, 2021, 10:47:29 pm »
I was trying an example with which Lazarus comes. But now the Object Inspector is completely inactive and F11 nor F12 work.How can I enable it ?  O:-)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Lazarus Object Inspector is inactive
« Reply #1 on: December 25, 2021, 11:06:38 pm »
The CheckBox demo has no .lfm form file. Everything is done by code.
Choose a different project. There are plenty of examples with designer forms.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

max2

  • New Member
  • *
  • Posts: 10
Re: Lazarus Object Inspector is inactive
« Reply #2 on: December 25, 2021, 11:17:54 pm »
Sound like a good advice but doesn't work.
ALmost none of the files in the example directory has no .lfm associated with it, please see the attachment.

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Object Inspector is inactive
« Reply #3 on: December 25, 2021, 11:49:47 pm »
Have you opened one of the projects there ?  The OI only shows the form  associated with the pas file you have open in the editor.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Bart

  • Hero Member
  • *****
  • Posts: 5288
    • Bart en Mariska's Webstek
Re: Lazarus Object Inspector is inactive
« Reply #4 on: December 25, 2021, 11:53:51 pm »
Most of the examples in that folder create their forms in code, except testall.lpi project, so simply open that.
Many of the examples in the subdirectories of examples do have forms though.

Bart

max2

  • New Member
  • *
  • Posts: 10
Re: Lazarus Object Inspector is inactive
« Reply #5 on: December 26, 2021, 12:09:52 am »
Now after your advice the F12 key works. BUT the Form Environment displays a form without any items which are present after compilation. So how can I open them in Form Environment ? Please see the attachment.

max2

  • New Member
  • *
  • Posts: 10
Re: Lazarus Object Inspector is inactive
« Reply #6 on: December 26, 2021, 12:11:23 am »
another attachment with form ater pressing F12 with no relationship to the compiled one.

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Object Inspector is inactive
« Reply #7 on: December 26, 2021, 07:13:09 am »
OK, in the testall, testall.pp does not have a form associated with it. All it does is call another unit, testallform.pp that does have a form.

So, open that other unit and you will see what you expect.

Its a bit of a pity that the example project was not saved with the interesting form being opened by default, it would be a lot clearer for new users.

So, in TestAll, put the cursor on the word, tesallform on the Uses line, press Alt - UpArrow

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Object Inspector is inactive
« Reply #8 on: December 26, 2021, 07:51:02 am »
Discussion Mode On

I don't think I have looked at the Lazarus examples before, having just done so now, I am not convinced I'd refer a beginner to them in the future.

Firstly, we start with everything selected and thats 360 projects, mostly demonstrating some relatively advanced techniques. Good example of what they are trying to show but not suitable for beginners IMHO.

Do we need a button labeled "beginners projects" ?  That shows a small number of projects that -

  • Open by default with all units loaded.
  • Have a useful readme.txt
  • Don't feature any "look how clever I am" code ?

We do have lots of other, beginners content particularly on the wiki, but that "example projects" button is pretty tempting.

Davo

Discussion mode off

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Object Inspector is inactive
« Reply #9 on: December 26, 2021, 10:37:19 am »
1) Getting a form / Testing F12 (or Menu: "View" > "Toggle Form/Unit")

Menu: "Project" > "New Project"
Then choose: "Application"

This will have an empty form. And you can add Buttons, Labels, .... on that form.


2) Form not part of the "single block" one window (Form is not docked)

You notice the form is not part of the big single IDE window.

There is a package (Menu "Package" > "Install/Uninstall packages") named "DockedFormEditor".

- I have not used/tested it
- It may be only in Lazarus 2.2 (If you can't find it in 2.0.12, then try download 2.2RC2)
- I do not know, if it works ok. I think some people use it with success. Other people said they have problems.
  You need to test yourself.

If you test "DockedFormEditor", and you see a problem: Ask here, and if the answer is "it is a bug" => then please report it on our bugtracker (search first, if already reported).

Remember: It can only be fixed, if someone makes a report.


3) Examples / Example folder

They are not made for "first steps in Pascal". Also not for "first steps with the IDE".
They are not a tutorial or introduction.

3a) Documentation
We know that documentation is not perfect. And that it can be hard to find the correct "help page".

We had some help, from some volunteers. (Great efforts, many thanks to those).

You can try the following pages to start:
- https://wiki.lazarus.freepascal.org/Portal:New_Users
- https://wiki.lazarus.freepascal.org/Lazarus_Documentation#The_Lazarus_User_Guides
- https://wiki.lazarus.freepascal.org/Main_Page
- Look at entries that start with "Lazarus" https://wiki.lazarus.freepascal.org/Category:Tutorials?from=l
- google ;)


dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Object Inspector is inactive
« Reply #10 on: December 26, 2021, 12:30:10 pm »
Martin,
    neither the OP nor I mentioned creating a new project, docking nor the quality of documentation.

The remaining issue, suitability of examples, is moot. We all agree that they are not particularly suited to (nor intended for) a beginner. But that is not clear, especially to a beginner. That is the issue.

David

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

wp

  • Hero Member
  • *****
  • Posts: 11906
Re: Lazarus Object Inspector is inactive
« Reply #11 on: December 26, 2021, 12:52:25 pm »
I agree with dbannon that "someone" should rewrite most of the example projects in the top-level "examples" folder in a more conventional way. I am willing to contribute. But there is already the first problem. I will be doing this on Windows - this means the layout will be perfect on Windows. But when a Linux or mac user opens the same project he will see misaligned and overlapping controls - the typical mess of poorly-designed cross-platform programs. To get it right I'd have to use the Anchor Editor - but this is beyond "beginner level" because when the controls on a form are fully anchored they cannot be repositioned with the mouse any more...

Beyond that I have problems classifying sample projects for beginners. What is a "beginner"? A well-experienced Lazarus user is certainly no "beginner" in the common sense, but he may be a "beginner" in TAChart when he never used this library.

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Object Inspector is inactive
« Reply #12 on: December 26, 2021, 01:26:50 pm »
I suspect we might be overthinking it really, the existing examples (and demos etc) are fine as long as they are not stumbled across by a beginner.  So, a very small handful of projects, 3 to 5 ?. But identified as 'beginner' projects. If the existing 'Examples" dialog included a "beginners" tickbox, then someone can easily tell that the other ones may not be suitable for a beginner.

Scaling can certainly be an issue but maybe, given some testing and limiting the scope, we can get away with it.

I very happy to help. Can test on Linux, both hi and low dpi. And an old Mac.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Lazarus Object Inspector is inactive
« Reply #13 on: December 26, 2021, 02:28:18 pm »
The Example Projects GUI needs a revamp.
There is an open issue:
 https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35446
and some related issues.
I made the GUI a long time ago. It is not good. I tried to copy features from some existing code dealing with example projects.
A new GUI should be simplified. Settings like the subdirectories should go into a dedicated pane in the global options window.
A ListView should be used now. It was very buggy in some widgetsets back then.

If somebody wants to implement it, please do. Add a comment to the issue if you work on it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9855
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Object Inspector is inactive
« Reply #14 on: December 26, 2021, 02:31:36 pm »
    neither the OP nor I mentioned creating a new project, docking nor the quality of documentation.
The OP had asked about docking in a different thread, and only hours after having gotten an answer, the OP started this thread. I therefore believe they may find the info on the docked designer useful (even if off topic to this thread).
The OP experiencing this issues while looking at examples does not give info whether they had or had not tried and succeeded/failed on a new project. Nor if his problem is generic, or only bound to examples. Thus, if I may opine, opening the thread into that direction might be helpful.

 

TinyPortal © 2005-2018