From 6d91bd35109e10ee5543309debe5b160d30dc47c Mon Sep 17 00:00:00 2001 From: vincents Date: Wed, 5 Mar 2008 08:25:02 +0000 Subject: [PATCH] LCL: call TreeView OnExpanded event after the screen has been updated (bug #10946) git-svn-id: trunk@14418 - --- lcl/include/treeview.inc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc index 6c91c21f45..58104ca268 100644 --- a/lcl/include/treeview.inc +++ b/lcl/include/treeview.inc @@ -558,12 +558,6 @@ begin //DebugLn('[TTreeNode.DoExpand] Self=',DbgS(Self),' Text=',Text, //' HasChildren=',HasChildren,' ExpandIt=',ExpandIt,' Expanded=',Expanded); if HasChildren and (Expanded<>ExpandIt) then begin - if (TreeView<>nil) then begin - if ExpandIt then - TreeView.Expand(Self) - else - TreeView.Collapse(Self); - end; if ExpandIt then Include(FStates,nsExpanded) else begin @@ -578,6 +572,10 @@ begin tvsTopItemNeedsUpdate,tvsBottomItemNeedsUpdate, tvsScrollbarChanged,tvsMaxRightNeedsUpdate]); Update; + if ExpandIt then + TreeView.Expand(Self) + else + TreeView.Collapse(Self); end; end; end;