Solved

Treeview question for Lischke

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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