From d2695ee087ef57be43207bc34c5c2dcd7df4fd18 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 27 Oct 2011 16:50:34 +0200 Subject: tree: Added a note about the limitation of Node.HasChildren call. For now, please use Node.Count instead. --- src/gui/fpg_tree.pas | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/fpg_tree.pas') diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index 83ddddbb..578cc133 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -28,6 +28,9 @@ unit fpg_tree; we want a main column covering the tree. Then extra columns for user text and data. * Implement event handlers the user can hook into and do custom drawing. + * TfpgTreeNode.HasChildren property is not fully implemented yet. The + property is not update when you do .Append() or .AppendText() calls. It + such cases .Count is prefered. } {.$Define Debug} @@ -455,6 +458,7 @@ begin FLastSubNode.Next := ANode; FLastSubNode := ANode; + FHasChildren := True; end; function TfpgTreeNode.FindSubNode(AText: string; ARecursive: Boolean): TfpgTreeNode; @@ -756,6 +760,7 @@ begin Remove(tn); tn.Free; end; + FHasChildren := False; end; function TfpgTreeNode.ParentTextColor: TfpgColor; -- cgit v1.2.3-70-g09d2