Wieso sollte das nicht gehen?
Beispiel:
Delphi-Quellcode:
type
TNodeObject = class
Caption:string;
end;
TTableA = class(TNodeObject)
Name:string;
end;
TTableB = class(TNodeObject)
end;
TNodeData = record
Table:TNodeObject;
end;
PNodeData = ^TNodeData;
:
:
procedure TForm.OnCreate...
begin
VST.NodeDataSize := sizeof(TNodeData);
end;
procedure TForm.OnVSTChange(Sender..., Node...
var Data:PNodeData;
begin
Data:=Sender.GetNodeData(Node);
if assigend(Data) then begin
if Data^.Table is TTableA then begin
TTableA(Data^.Table).Caption:='Caption: TableA';
TTableA(Data^.Table).Name:='TableA';
end if Data^.Table is TTableB then begin
TTableB(Data^.Table).Caption:='Caption: TableB';
end;
end;
end;