Re: Count all nodes in a treeview
- From: "John Rogers" <johnrogers2345@xxxxxxx>
- Date: Sat, 29 Dec 2007 10:26:29 -0600
Hi Pete,
the above statement, you want to iterate the nodes in some specific
order. Do you literally need a counter that is assigned to each node
in order? Or are you simply looking for a specific order of
enumeration?
When I wrote my function to save and load the tree, I wrote it using
the
ItemIndex of the nodes in the tree. In CBuilder the nodes will go from
1-?? however many you have in the tree when doing the recursion.
Even if the nodes are nested 10 deep the numbers will still go in
order.
// in c# the numbers will be like this as you pointed out
Parent Node: 0
Child Node: 0
Parent Node: 1
Child Node: 1
Parent Node: 2
Child Node: 2
// in cbuilder the numbers will be like this
Parent Node: 1
Child Node: 2
Parent Node: 3
Child Node: 4
Parent Node: 5
Child Node: 6
I don't see anything in the code C++Builder code you posted that
would help me understand how you're currently reconstituting the
tree based on
Not yet, I was just posting the storing of the tree to get it to work.
Rebuilding
the tree would be a lot more difficult. I didn't attempt that one
yet.
As near as I can tell from what you've posted, C++Builder has hidden
some (most? all?) of the recursive nature of your data structure
from you, handling that all behind the scenes. Which I suppose is
fine for a specific purpose, but it seems to have put you at a
disadvantage with
Absolutely right, C++Builder keeps a lot of items behind the scenes so
you
can write code faster. As a matter of fact, I just found out the
other day from
a friend who codes in Delphi and has been using C# for quite a while.
He told
me that the same person who wrote Delphi wrote C#. I kinda wondered
how come
the syntax is so close, and the IDE looks almost the same in Delphi,
C++Builder, and
C#.
C# also hides a lot of the behind the scenes options when using the
extensive library
called the toolbox. This makes developing a lot easier and faster for
the developer.
Thanks again for you help Pete.
John
.
- References:
- Count all nodes in a treeview
- From: John Rogers
- Re: Count all nodes in a treeview
- From: Pedro Luna Montalvo
- Re: Count all nodes in a treeview
- From: John Rogers
- Re: Count all nodes in a treeview
- From: Peter Duniho
- Re: Count all nodes in a treeview
- From: John Rogers
- Re: Count all nodes in a treeview
- From: John Rogers
- Re: Count all nodes in a treeview
- From: Peter Duniho
- Count all nodes in a treeview
- Prev by Date: Re: SOS...SOS...SOS
- Next by Date: Re: Multidimensional Packed Bit Array
- Previous by thread: Re: Count all nodes in a treeview
- Next by thread: Re: Count all nodes in a treeview
- Index(es):
Relevant Pages
|