Solved

Treeview question for Lischke

Posted on 2000-05-18
4
206 Views
Last Modified: 2010-04-04
Hi all,

How can I traverse a tree. I am using Lischke's TreeNT and would like to be able to traverse the tree, check a node's associated data and then decide whether or not to manipulate the node (ie. bold it or color it). Maybe even put a checkbox radiobutton next to it. Although the colors will suffice.

I would appreciate some help. Thanx.
Fats
0
Comment
Question by:ffelaar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
Lischke earned 72 total points
ID: 2820779
Hi ffelaar,

iterating through it tree is quite easy when using the usual navigation functions like GetNext, GetNextVisible, GetNextSibling, GetNextChild or GetNextSelected (similar for previous nodes). So what you essentially need is a start point and the proper navigation function in a loop:

var
  Node: TTreeNTNode;
  Data: PMyData;

begin
  Node := TreeNT1.GetFirstNode;
  while Assigned(Node) do
  begin
    Data := Node.Data;
    // act here depending on data
    ...
    // get next node in order (could also be the sibling etc.)
    Node := Node.GetNext;
  end;
end;

Ciao, Mike
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2846801
Did you read my comment?
0
 

Author Comment

by:ffelaar
ID: 2883841
Comment accepted as answer
0
 

Author Comment

by:ffelaar
ID: 2883842
Thank you.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question