diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-18 17:04:08 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-08-18 17:04:08 +0200 |
commit | abbc6564e5ff58e746a29555f519011c499d08fb (patch) | |
tree | 0b51bbec25c19c91ce09c035f9d42a2d4637fd2e | |
parent | 7598ce84655d253a92f48c8d807cef3d49624ada (diff) | |
download | fpGUI-abbc6564e5ff58e746a29555f519011c499d08fb.tar.xz |
Treeview: Two now methods added. FullCollapse and FullExpand.
-rw-r--r-- | src/gui/fpg_tree.pas | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gui/fpg_tree.pas b/src/gui/fpg_tree.pas index e58cf6f9..5f12ea1f 100644 --- a/src/gui/fpg_tree.pas +++ b/src/gui/fpg_tree.pas @@ -223,6 +223,8 @@ type function GetColumnWidth(AIndex: word): word; procedure GotoNextNodeUp; procedure GotoNextNodeDown; + procedure FullCollapse; + procedure FullExpand; property Font: TfpgFont read FFont; // Invisible node that starts the tree property RootNode: TfpgTreeNode read GetRootNode; @@ -1101,6 +1103,34 @@ begin Selection := NextNode(Selection); end; +procedure TfpgTreeView.FullCollapse; +var + n: TfpgTreeNode; +begin + n := NextNode(RootNode); + repeat + if n <> nil then + begin + n.Collapse; + end; + n := NextNode(n); + until n = nil; +end; + +procedure TfpgTreeView.FullExpand; +var + n: TfpgTreeNode; +begin + n := NextNode(RootNode); + repeat + if n <> nil then + begin + n.Expand; + end; + n := NextNode(n); + until n = nil; +end; + procedure TfpgTreeview.PreCalcColumnLeft; var Aleft: TfpgCoord; |