Register to post in forums, or Log in to your existing account
 

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Sun Feb 27, 2005 4:16 am   

Getting a Node in a Tree
 
Is there a quick way to get a node from a tree? I have a node named Rooms is there any quick way i can get reference to do this? :P

Thanks:X
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Mar 01, 2005 8:08 am   
 
Not exactly sure what you are asking. The currently selected node of a tree can be obtained via the Tree.CurrentNode property. If you have an object assigned to this node, you can get access to it via the Data property of the Node. Take a look at the property list for the zTree object. I haven't filled in a lot of details yet, but at least you'll see the various property and method names for the Tree component.
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Tue Mar 01, 2005 8:50 am   
 
Example tree thingie

Code:
Node 1
   ... Node A
   ... Node B
Node 2
  ... Node C
  ... Node D
Node 3
  ... Node E
  ... Node F


Say I wanted to add another node to the thingie of node 2, how would i do this?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Mar 01, 2005 7:40 pm   
 
Ahh, OK, I see...

Well, the "Find" method isn't implemented yet. It has to do some fancy stuff to locate a node anywhere in the tree, and I want it to be compatible with XML tree stuff.

And I also notice that I haven't even documented the properties and methods for the zNode object, nor are any of the zNode methods currently exported.

So, right now the only way to do this is if you kept the object link to Node 2 when it was originally added to the tree, which you probably didn't.

Let's see...hmm...one thing you might try is this:

set N = core.FindControl( "Node 2")

and see if you get anything with that. I don't remember if nodes are entered into the global namespace for zApp or not. If they are, then this should find them. Then you can use the statement:

set NewNode = Tree.AddChild( N, "Node G")

to add a new node to the one that you found above.
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Wed Mar 02, 2005 2:07 am   
 
Object required: 'core.FindControl(...)'

=X

Thanks for your help with this... *thinks* :P
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Mar 02, 2005 6:50 am   
 
Once I get the new DevExpress Tree component integrated, I'll be adding all of the methods that you need for this. So, it should be better in a week or two. Sorry for the trouble.
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Wed Mar 02, 2005 11:19 am   
 
That's awesome :D
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Mar 25, 2005 12:11 am   
 
I've added the documentation that I promised for zTree and zNode. In the current CVS build you can now search for nodes. To answer your original question, here is how you'd do it.
Code:
Set Node = Tree.Find( "Node 2")
Node.AddChild( "New Node")

There is both a zTree.Find and zTree.FindText function. The first one searches based upon the variant data that you used when creating a node, while the second searches purely on the displayed text.

The only thing in the documentation that isn't implemented in the current build is the ability to add <NODE> tags within the <TREE> tag to create the tree structure at design-time. That ability will be in the next build.
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Fri Mar 25, 2005 10:51 am   
 
YAY! :P Now i have to convince someone to buy zApp for me... XD
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2009 Zugg Software. Hosted on Wolfpaw.net