Solved

Treeview question for Lischke

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

17 Experts available now in Live!

Get 1:1 Help Now