From 7ca04abba01619705be865ec3e6c9431876c234a Mon Sep 17 00:00:00 2001 From: liujianjun Date: Tue, 16 Jul 2024 09:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3tree=E8=8A=82=E7=82=B9visible?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E6=AC=A1=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funcext/tvclib/utslvcltree.tsf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/funcext/tvclib/utslvcltree.tsf b/funcext/tvclib/utslvcltree.tsf index c98dcfe..1532068 100644 --- a/funcext/tvclib/utslvcltree.tsf +++ b/funcext/tvclib/utslvcltree.tsf @@ -1101,7 +1101,18 @@ type TcustomTreeCtlNode = class(tsluibase) // it.UpDateHierarchy(); if Expanded and Owner.NodeInList(self) and it.Visible then //处理节点visibe 的问题 begin - preItem := FItems[idx-1]; + /////////////////处理隐藏节点导致插入次序显示问题///////////////////// + tidx := idx; + while tidx>0 do + begin + tidx--; + preItem := FItems[tidx]; + if preItem and preItem.Visible then + begin + break; + end else preItem := 0; + end + /////////////////////////////// bx := 0; if preItem then bx := Owner.GetItemIndex(preItem.GetLastShowNode())+1; else bx := owner.GetItemIndex(self)+1;