Solved

Treeview question for Lischke

Posted on 2000-05-18
4
195 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now