Solved

Treeview question for Lischke

Posted on 2000-05-18
4
213 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month3 days, 18 hours left to enroll

630 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