How do you access data?

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Nicho
Newbie
Newbie
Posts: 13
Joined: Mon Jul 09, 2007 12:00 am
Location: Adelaide Australia
Contact:

How do you access data?

Post by Nicho » Tue Nov 25, 2008 9:48 am

I have replaced a Delphi TreeView with a TeeTree DBTree. On the dblclick event I used to determine if the user clicked on a parent not by the fllowing:
**
SelNode := TheTree.Selected;
If SelNode <> Nil then ParentNode := SelNode.Parent
else Parentnode := Nil;
**
With DBTree:-

1.How do I determine what level was chosen?
2.How do I access the Text string that was clicked on?

The downloaded tutorial doesn't work (on windows vista).

Thanks
Bruce

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Tue Nov 25, 2008 11:18 pm

Hi Bruce,

You can use the DblClickShape event for this purpose. The Sender argument contains a reference to the clicked shape.

The level property of a TTreeNodeShape provides information where the node is positioned in the tree (0 equals root level).

References of parent(s) are provided through the parent and parents property.

The text shown in the tree can be accessed through the Text or SimpleText property

Best regards,
tom

Nicho
Newbie
Newbie
Posts: 13
Joined: Mon Jul 09, 2007 12:00 am
Location: Adelaide Australia
Contact:

Post by Nicho » Tue Nov 25, 2008 11:33 pm

Thank you Tom - that's provided all the answers I need.

Best regards
Bruce

Post Reply