@@ -10,7 +10,7 @@ interface
1010
1111uses
1212 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
13- StdCtrls, VirtualTrees, ImgList, ExtCtrls, UITypes;
13+ StdCtrls, VirtualTrees, ImgList, ExtCtrls, UITypes, System.ImageList ;
1414
1515const
1616 // Helper message to decouple node change handling from edit handling.
@@ -125,7 +125,7 @@ procedure TPropertiesForm.VST3GetText(Sender: TBaseVirtualTree; Node: PVirtualNo
125125 if TextType = ttNormal then
126126 case Column of
127127 0 :
128- if Node.Parent = Sender.RootNode then
128+ if Sender.NodeParent[Node] = nil then
129129 begin
130130 // root nodes
131131 if Node.Index = 0 then
@@ -134,7 +134,7 @@ procedure TPropertiesForm.VST3GetText(Sender: TBaseVirtualTree; Node: PVirtualNo
134134 CellText := ' Origin' ;
135135 end
136136 else
137- CellText := PropertyTexts[Node.Parent .Index, Node.Index, ptkText];
137+ CellText := PropertyTexts[Sender.NodeParent[Node] .Index, Node.Index, ptkText];
138138 1 :
139139 begin
140140 Data := Sender.GetNodeData(Node);
@@ -150,9 +150,9 @@ procedure TPropertiesForm.VST3GetHint(Sender: TBaseVirtualTree; Node: PVirtualNo
150150
151151begin
152152 // Add a dummy hint to the normal hint to demonstrate multiline hints.
153- if (Column = 0 ) and (Node.Parent <> Sender.RootNode ) then
153+ if (Column = 0 ) and (Sender.NodeParent[Node] <> nil ) then
154154 begin
155- HintText := PropertyTexts[Node.Parent .Index, Node.Index, ptkHint];
155+ HintText := PropertyTexts[Sender.NodeParent[Node] .Index, Node.Index, ptkHint];
156156 { Related to #Issue 623
157157 Observed when solving issue #623. For hmToolTip, the multi-line mode
158158 depends on the node's multi-lin emode. Hence, append a line only
@@ -177,7 +177,7 @@ procedure TPropertiesForm.VST3GetImageIndex(Sender: TBaseVirtualTree; Node: PVir
177177begin
178178 if (Kind in [ikNormal, ikSelected]) and (Column = 0 ) then
179179 begin
180- if Node.Parent = Sender.RootNode then
180+ if Sender.NodeParent[Node] = nil then
181181 Index := 12 // root nodes, this is an open folder
182182 else
183183 begin
@@ -201,7 +201,7 @@ procedure TPropertiesForm.VST3Editing(Sender: TBaseVirtualTree; Node: PVirtualNo
201201 with Sender do
202202 begin
203203 Data := GetNodeData(Node);
204- Allowed := (Node.Parent <> RootNode ) and (Column = 1 ) and (Data.ValueType <> vtNone);
204+ Allowed := (Sender.NodeParent[Node] <> nil ) and (Column = 1 ) and (Data.ValueType <> vtNone);
205205 end ;
206206end ;
207207
@@ -213,7 +213,7 @@ procedure TPropertiesForm.VST3Change(Sender: TBaseVirtualTree; Node: PVirtualNod
213213 with Sender do
214214 begin
215215 // Start immediate editing as soon as another node gets focused.
216- if Assigned(Node) and (Node.Parent <> RootNode ) and not (tsIncrementalSearching in TreeStates) then
216+ if Assigned(Node) and (Sender.NodeParent[Node] <> nil ) and not (tsIncrementalSearching in TreeStates) then
217217 begin
218218 // We want to start editing the currently selected node. However it might well happen that this change event
219219 // here is caused by the node editor if another node is currently being edited. It causes trouble
@@ -249,7 +249,7 @@ procedure TPropertiesForm.VST3PaintText(Sender: TBaseVirtualTree; const TargetCa
249249
250250begin
251251 // Make the root nodes underlined and draw changed nodes in bold style.
252- if Node.Parent = Sender.RootNode then
252+ if Sender.NodeParent[Node] = nil then
253253 TargetCanvas.Font.Style := [fsUnderline]
254254 else
255255 begin
@@ -274,7 +274,7 @@ procedure TPropertiesForm.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node:
274274 S := SearchText;
275275 SetStatusbarText(' Searching for: ' + S);
276276
277- if Node.Parent = Sender.RootNode then
277+ if Sender.NodeParent[Node] = nil then
278278 begin
279279 // root nodes
280280 if Node.Index = 0 then
@@ -284,7 +284,7 @@ procedure TPropertiesForm.VST3IncrementalSearch(Sender: TBaseVirtualTree; Node:
284284 end
285285 else
286286 begin
287- PropText := PropertyTexts[Node.Parent .Index, Node.Index, ptkText];
287+ PropText := PropertyTexts[Sender.NodeParent[Node] .Index, Node.Index, ptkText];
288288 end ;
289289
290290 // By using StrLIComp we can specify a maximum length to compare. This allows us to find also nodes
0 commit comments