VCL Delphi

Title: How to add data manually to a tree view, from a Texteditor
unit Unit1;
// Suppose you want to add data to a TTreeView object but
// you prefer to prepare your data from a word processor,
// for example MS WORD.
//
// The first thing you have to know is that the text related
// to each node is saved on standard text format on the file
// corresponding to the tree view. The text of each node is
// preceded by tab (#9) characters deppending on the level of
// the node. Nodes at root level don't have tab (#9) characters,
// nodes whose parent is at root level have one tab character
// preceding it's text, and so on.
// You have to add one tab (#9) for each level different than root.
// Nodes are each on one line.
// So, you create your file from MS WORD following the rules
// mentioned. A tipical document could be the following -long
// spaces correspond to tab (#9) characters-:
//
// Node 1
// Node 1, 1
// Node 1, 2
// Node 1, 3
// Node 2
// Node 2, 1
// Node 2, 2
// Node 2, 2, 1
// Node 2, 2, 2
// Node 2, 3
//
// Once you create your document you "save as" it with
// format "Only Text". This option generates a document
// with extension ".txt". In the example below the file is named
// "test.txt"
//
// Then you simply read your data with procedure "LoadFromFile".
//
// If you want to read the data again form MS WORD, you
// read the corresponding ".txt" file.
//
// YOU HAVE TO BE CAREFUL NOT TO ADD SPACES BETWEEN
// THE TAB CHARACTERS AND TEXT RELATED TO NODES.
// IF YOU DO, YOU WON'T BE ABLE READ YOUR DATA.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls;
type
TForm1 = class(TForm)
TreeView1: TTreeView;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
// The following procedure read the data created woth MS WORD
TreeView1.LoadFromFile('c:\test.txt');
end;
end.