Einzelnen Beitrag anzeigen

Igotcha

Registriert seit: 22. Dez 2003
544 Beiträge
 
Delphi 2006 Professional
 
#12

Re: VirtualStringTree und OnLoadNode

  Alt 21. Jun 2005, 00:12
Zitat von GuenterS:
So bin gerade nach Hause gekommen und habe versucht Deine Änderungsvorschläge einzubauen, jedoch funktioniert das mit dem kleinen Beispielprojekt überhaupt nicht. Es wird nach wie vor nur 'Node' angezeigt.
Err, "Node" ist der Defaulttext für Nodeeinträge

Mittels "OnGetText" musst Du den Text setzen. In dem Event steuerst Du, welche Information in welcher "Column" angezeigt werden soll.

Beispiel:

Delphi-Quellcode:
procedure TKOM.VTISTGetText(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
  var CellText: WideString);
var
  myData: PIstData;
begin
    myData:=VTIST.GetNodeData(Node);
    Node.Align:=3;
  if (TextType=ttNormal) AND (myData.FGTyp<>6) then
  begin
    case Column of
    0: Celltext:=myData.FGBez;
    1: Celltext:=format('%.0n', [myData.FMonat[0]]);
    2: Celltext:=format('%.0n', [myData.FMonat[1]]);
    3: Celltext:=format('%.0n', [myData.FMonat[2]]);
    4: Celltext:=format('%.0n', [myData.FMonat[3]]);
    5: Celltext:=format('%.0n', [myData.FMonat[4]]);
    6: Celltext:=format('%.0n', [myData.FMonat[5]]);
    7: Celltext:=format('%.0n', [myData.FMonat[6]]);
    8: Celltext:=format('%.0n', [myData.FMonat[7]]);
    9: Celltext:=format('%.0n', [myData.FMonat[8]]);
    10: Celltext:=format('%.0n', [myData.FMonat[9]]);
    11: Celltext:=format('%.0n', [myData.FMonat[10]]);
    12: Celltext:=format('%.0n', [myData.FMonat[11]]);
    13: Celltext:=format('%.0n', [myData.FMonat[12]]);
    14: Celltext:=format('%.0n', [myData.FMonat[13]]);
    15: Celltext:=format('%.0n', [myData.FMonat[14]]);
    16: Celltext:=format('%.0n', [myData.FMonat[15]]);
    17: Celltext:=format('%.0n', [myData.FMonat[16]]);
    18: Celltext:=format('%.0n', [myData.FMonat[17]]);
    end;
  end;
Gruß Igotcha
  Mit Zitat antworten Zitat