From 47de83ddda51711cc86152a76c57bf875a7dddbd Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 25 Aug 2010 15:11:21 +0200 Subject: Treeview bug fix: GotoNextNodeDown did not expand and traverse the last node in RootNode. --- src/gui/fpg_tree.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index 072ec729..37d2af22 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -1152,10 +1152,15 @@ begin end; procedure TfpgTreeView.GotoNextNodeDown; +var + lNode: TfpgTreeNode; begin - if Selection = RootNode.LastSubNode then + if (Selection = RootNode.LastSubNode) and (RootNode.LastSubNode.CountRecursive = 0) then Exit; - Selection := NextNode(Selection); + + lNode := NextNode(Selection); + if lNode <> nil then + Selection := lNode; end; procedure TfpgTreeView.FullCollapse; -- cgit v1.2.3-70-g09d2