#
Include Phantom Target Declarations
use "PhantomTarget.dec";
System("PhantomTarget.exe");
PhantomTarget._Controls.TreeVie_w.Select();
# Add a top level item
TreeView.Edit1.SetText("Top");
TreeView._Insert.Click();
# Add some children to Top
TreeView.SysTreeView321.Select("Top");
TreeView.Edit1.SetText("Child1");
TreeView._Insert.Click();
TreeView.Edit1.SetText("Child2");
TreeView._Insert.Click();
# Add some children to Top.Child1
TreeView.SysTreeView321.Select("Top.Child1");
TreeView.Edit1.SetText("SubChild1");
TreeView._Insert.Click();
TreeView.Edit1.SetText("SubChild2");
TreeView._Insert.Click();
# Expand/Collapse functions
TreeView.SysTreeView321.Expand("Top.Child1");
TreeView.SysTreeView321.Collapse("Top.Child1");
TreeView.SysTreeView321.Collapse("Top");
TreeView.SysTreeView321.Expand("Top");
# Item state functions
TreeView.SysTreeView321.Select("Top.Child1");
disp(TreeView.SysTreeView321.GetCount());
disp(TreeView.SysTreeView321.GetSelected());
disp(TreeView.SysTreeView321.IsExpanded("Top"));
disp(TreeView.SysTreeView321.IsExpanded("Top.Child1"));
# Exit out
TreeView.OK.Click();
PhantomTarget.Close();
|