summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-04-27 19:56:02 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-04-27 19:56:02 +0100
commit5611d5b29fae879011cbabf6feceb073cb23b08a (patch)
tree7b82f3830579ed35fd0087c0094ea12cf1c221d8 /src
parent6ffa508e88ae69d78361903c7334e58f8d520710 (diff)
downloadfpGUI-5611d5b29fae879011cbabf6feceb073cb23b08a.tar.xz
treenode: new overloaded constructor and FTree moved to protected section.
Diffstat (limited to 'src')
-rw-r--r--src/gui/fpg_tree.pas16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas
index d0526974..7da5205c 100644
--- a/src/gui/fpg_tree.pas
+++ b/src/gui/fpg_tree.pas
@@ -84,7 +84,6 @@ type
FText: TfpgString;
FTextColor: TfpgColor;
FHasChildren: Boolean;
- FTree: TfpgTreeView;
procedure SetCollapsed(const AValue: boolean);
procedure SetInactSelColor(const AValue: TfpgColor);
procedure SetInactSelTextColor(const AValue: TfpgColor);
@@ -97,8 +96,11 @@ type
procedure SetHasChildren(const AValue: Boolean);
procedure DoTreeCheck(ANode: TfpgTreeNode);
procedure SetStateImageIndex(const AValue: integer);
+ protected
+ FTree: TfpgTreeView;
public
- constructor Create;
+ constructor Create; overload;
+ constructor Create(ATreeView: TfpgTreeView; AText: TfpgString); overload;
destructor Destroy; override;
// node related
function AppendText(AText: TfpgString): TfpgTreeNode;
@@ -395,7 +397,8 @@ begin
FData := nil;
FFirstSubNode := nil;
FLastSubNode := nil;
- FText := '';
+ FText := '';
+ FTree := nil;
FImageIndex := -1;
FStateImageIndex := -1;
FCollapsed := True;
@@ -412,6 +415,13 @@ begin
FInactSelTextColor := clUnset;
end;
+constructor TfpgTreeNode.Create(ATreeView: TfpgTreeView; AText: TfpgString);
+begin
+ Create;
+ FText := AText;
+ FTree := ATreeView;
+end;
+
destructor TfpgTreeNode.Destroy;
begin
if FParent <> nil then