Einzelnen Beitrag anzeigen

generic

Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.415 Beiträge
 
Delphi XE5 Professional
 
#11

Re: .... nochmals VirtualStringTree

  Alt 8. Okt 2004, 22:56
wie waere es mit sowas:

Delphi-Quellcode:
vst.nodedatasize:=sizeof(tobject)

type
  tmonat = class
    a,b: string;
    c: integer;
  end;
  twoche = class
    d: integer;
  end;
  tprojekt = class
    name, usw: string;
  end;

 
  monat:=tmonat.create();
 
  node:=vst.addchild(nil, monat);

  woche:=twoche.create();
  node:=vst.addchild(node, woche);

  proj:=tprojekt.Create();
  vst.addchild(node, proj);


procedure vst.onfreenode
  tobject(vst.getnodedata(node)).free;


procedure vst.ongettext;

obj:=tobject(vst.getnodedata(node));
if obj is tmonat then
  with tmonat(obj) do
    case column of
      0: celltext:=a;
      1: celltext:=b;
    end;

if obj is twoche then
  with twoche (obj) do
    case column of
      0: celltext:=d;
    end;

if obj is tproject then
  with tproject(obj) do
    case column of
      0: celltext:=name;
      1: celltext:=usw;
    end;
  Mit Zitat antworten Zitat