unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, VirtualTrees, StdCtrls, Buttons;
type
PTreeData = ^TTreeData;
TTreeData =
record
FCaption:
String;
FColumn1:
String;
end;
type
TForm1 =
class(TForm)
Button1: TButton;
Vst: TVirtualStringTree;
SpeedButton1: TSpeedButton;
procedure Button1Click(Sender: TObject);
private
function AddVSTStructure(AVST: TCustomVirtualStringTree;
ANode: PVirtualNode; ARecord: TTreeData): PVirtualNode;
procedure Button3Click(Sender: TObject);
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
TreeData: TTreeData;
begin
VST.NodeDataSize:=SizeOf(TTreeData);
VST.BeginUpdate;
for I:=0
to 100
do
begin
TreeData.FCaption:='
Node-Nummer: '+IntToStr(I);
AddVSTStructure(VST,
nil,TreeData);
end;
VST.EndUpdate;
end;
function TForm1.AddVSTStructure(AVST: TCustomVirtualStringTree; ANode: PVirtualNode;
ARecord: TTreeData): PVirtualNode;
var
Data: PTreeData;
begin
Result:=AVST.AddChild(ANode);
Data:=AVST.GetNodeData(Result);
Avst.ValidateNode(Result, False);
Data^.FCaption:=ARecord.FCaption;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
end;
end.