Recent

Author Topic: [SOLVED] Project Inspector — nodes always expanded  (Read 584 times)

furious programming

  • Hero Member
  • *****
  • Posts: 858
[SOLVED] Project Inspector — nodes always expanded
« on: January 11, 2023, 06:09:26 pm »
Currently, the Project Inspector window can display the tree of files existing in the project, but each time the content of this tree is changed, it collapses (sic!)... I would like the file tree in this window to always be fully expanded, every node, no matter how many there are.

Can anyone suggest what to do so that after each action regarding the file tree (adding, deleting, moving a file, etc.), the tree is expanded? Currently, any action on project files causes the tree to be collapsed (re-created?), so the hack would simply be to expand the tree right after recreating it. What and in which file do you need to add to implement such a hack?

Thank you in advance for your help.
« Last Edit: January 11, 2023, 11:04:24 pm by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

Thaddy

  • Hero Member
  • *****
  • Posts: 14384
  • Sensorship about opinions does not belong here.
Re: Project Inspector — nodes always expanded
« Reply #1 on: January 11, 2023, 08:26:22 pm »
Such a feature will considerably slow down the painting, certainly on complex programs with many branches.... And so slow down your user experience. Do you really want to do that?

(And no, there is not a solution for loosing speed in this case.)
« Last Edit: January 11, 2023, 08:28:26 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Project Inspector — nodes always expanded
« Reply #2 on: January 11, 2023, 10:06:56 pm »
Such a feature will considerably slow down the painting, certainly on complex programs with many branches....

Are you running Lazarus on your refrigerator that you're worried about the control's painting performance? What kind of answer is that anyway? Have you ever seen any other IDE (like Visual Studio Code, IntelliJ IDEA, Unity or whatever) hide the content of the project tree for fear of rendering performance?

Quote
And so slow down your user experience.

Do you want to know what my "user experiences" are like?

The Project Inspector window currently it is probably the most useless window in the entire IDE. It can barely display a file tree and can't do almost anything else. I can't sort the files myself, I can't rename the file, I can't open the file directory in the file explorer, I can't keep a branch (or many branches) open, because each time a change in the tree results in the collapse of the entire tree and I have to manually expand them over and over again. And the more files I add to the project, the more time I waste expanding interesting branches and keeping them that way. This window is one big useless abomination, that is constantly irritating and keeps me wasting my time.

Quote
Do you really want to do that?

No, I don't want that, I want to conveniently use the file tree as it is done in other IDEs. That's why I want to manually modify the IDE code and keep all branches up so I don't waste any more time. Is this a sufficient answer to your question?
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Project Inspector — nodes always expanded
« Reply #3 on: January 11, 2023, 10:48:00 pm »
Okay, I made it. A bit of a shortcut, but the important thing is that it works the way I want it to — the content of the tree is fully expanded all the time, adding and removing files does not collapse the tree (filtering as well), collapsing branches is completely disabled, and the buttons are hidden. Well, I hid this groupbox at the bottom, because I don't know what it is for and I don't use it anyway (so it is by default hidden).

If someone also needs to see the full tree of project files, here is the instruction on how to do it.

  • Open the file Lazarus/ide/projectinspector.pas and show the form with F12.
  • Go to the designer and select treeview.
  • Go to the Object inspector window (Properties page), expand the property Options and check the tvoAutoExpand, uncheck the tvoKeepCollapsedNodes, check the tvoNoDoubleClickExpand and uncheck the tvoShowButtons.
  • Go to the Object inspector window (Events page), generate OnCollapsing event and add the following line to it:
Code: Pascal  [Select][+][-]
  1. procedure TProjectInspectorForm.ItemsTreeViewCollapsing(Sender: TObject; Node: TTreeNode; var AllowCollapse: Boolean);
  2. begin
  3.   AllowCollapse := False;
  4. end;

Done. If you want to additionally hide this groupbox at the bottom, select the PropsGroupBox control and set its Height to 0. Finally, select Tools -> Build Lazarus in the main IDE menu and recompile the IDE. After restarting the IDE, the project file tree will always be fully expanded and you will not be able to collapse branches (both with mouse and keyboard). Tested on Windows 10.
« Last Edit: January 11, 2023, 11:06:19 pm by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

 

TinyPortal © 2005-2018