View Issue Details

IDProjectCategoryView StatusLast Update
0033464LazarusIDEpublic2020-12-31 13:38
ReporterValdas Jankūnas Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinux 64b 4.13.0-37-genericOSKubuntu 17.10 
Product Version1.9 (SVN) 
Summary0033464: Component Tree in Object Inspector autoexpands
DescriptionTry attached example:
 - collapse tree branch "Panel2" in ObjectInspector;
 - add new component in to Form.
OR
 - collapse tree branch "Panel2" in ObjectInspector;
 - open AnchorEditor for "Panel1";
 - disable/enable Top anchor.

After that Component Tree in Object Inspector becomes all-expanded.

This behavior is especially bad/annoying when working with project which contains many components: space of monitor is not enormous so you collapsing nodes in object inspector for easier navigation; after one change (mentioned earlier) all nodes suddenly becomes expanded.
Additional InformationAfter code analysis I found:
 - in file "components/ideintf/propedit.pp" procedure "TPropertyEditorHook.Modified" is called;
 - which calls "TPropHookModifiedWithName(FHandlers[htModifiedWithName][i])(Sender, PropName)" in same file;
 - execution jumps to procedure "TMainIDE.PropHookModified" in file "ide/main.pp";
 - where "ObjectInspector1.FillComponentList" is called;
 - execution jumps to procedure "TObjectInspectorDlg.FillComponentList" in file "components/ideintf/objectinspector.pp";
 - where "ComponentTree.RebuildComponentNodes" is called;
 - execution jumps to procedure "TComponentTreeView.RebuildComponentNodes" in file "components/ideintf/componenttreeview.pas";
 - there "Items.Clear" is called which destroys all info on collapsed/expanded state (also there is call to "RootNode.Expand(true)");

My thought: there expanded/collapsed state save/restore is needed.
TagsComponentTreeView
Fixed in Revisionr64133, r64313
LazTarget-
Widgetset
Attached Files

Relationships

related to 0037434 resolvedJuha Manninen Object Inspector TreeView should not show nodes user has hidden - unless a hidden control is selected. 

Activities

Valdas Jankūnas

2018-03-20 13:16

reporter  

test.zip (66,401 bytes)

Juha Manninen

2018-03-20 16:48

developer   ~0107290

I fixed the AnchorEditor case in r57539.
You have already analyzed the code. Maybe you can find a solution for the case when a component is added.
Remember, the methods are called from many places. The updates between IDE windows pass back and forth.
Some time ago I optimized the updates and redrawing. Now the OI TreeView is not rebuild when a property name is passed to TPropertyEditorHook.Modified. Earlier the TreeView was rebuild even after changing a single property.

Juha Manninen

2020-11-13 22:56

developer   ~0126900

Now the tree does not expand after a component is added. Please test.
Deleting a component still expands the tree. I will keep the related issue open for that.

> My thought: there expanded/collapsed state save/restore is needed.
It feels like an overkill. At least I am not going to implement it. However a patch would be accepted, I have nothing against a persistent expanded/collapsed state if somebody implements it.

Juha Manninen

2020-12-30 13:00

developer   ~0127936

> My thought: there expanded/collapsed state save/restore is needed.

First I thought it means persistent memory for the expanded/collapsed state over Lazarus sessions. It would require saving the state to a configuration file.
Now I realized we need to remember the state inside one session when a user switches between designer forms.
I plan to implement it and thus reopen this report.

Juha Manninen

2020-12-31 13:38

developer   ~0127972

I implemented the expanded/collapsed state memory. Please test.

Issue History

Date Modified Username Field Change
2018-03-20 13:16 Valdas Jankūnas New Issue
2018-03-20 13:16 Valdas Jankūnas File Added: test.zip
2018-03-20 13:18 Valdas Jankūnas Tag Attached: ComponentTreeView
2018-03-20 16:41 Juha Manninen Assigned To => Juha Manninen
2018-03-20 16:41 Juha Manninen Status new => assigned
2018-03-20 16:48 Juha Manninen Note Added: 0107290
2020-07-28 22:41 Juha Manninen Relationship added related to 0037434
2020-11-13 22:56 Juha Manninen Status assigned => resolved
2020-11-13 22:56 Juha Manninen Resolution open => fixed
2020-11-13 22:56 Juha Manninen Fixed in Revision => r64133
2020-11-13 22:56 Juha Manninen LazTarget => -
2020-11-13 22:56 Juha Manninen Note Added: 0126900
2020-12-30 13:00 Juha Manninen Status resolved => assigned
2020-12-30 13:00 Juha Manninen Resolution fixed => open
2020-12-30 13:00 Juha Manninen Note Added: 0127936
2020-12-31 13:38 Juha Manninen Status assigned => resolved
2020-12-31 13:38 Juha Manninen Resolution open => fixed
2020-12-31 13:38 Juha Manninen Fixed in Revision r64133 => r64133, r64313
2020-12-31 13:38 Juha Manninen Note Added: 0127972