Einzelnen Beitrag anzeigen

SneakyBagels
(Gast)

n/a Beiträge
 
#32

AW: Große Probleme mit VirtualStringTree

  Alt 18. Jun 2017, 20:10
Funktioniert alles leider nicht.
Ich brauche leider ja auch die anderen Columns.

Chaotisch aber so sieht es aus
Delphi-Quellcode:
procedure TForm2.VSTDrawText(Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex; const Text: string; const CellRect: TRect;
 var DefaultDraw: Boolean);
var
 Data: TVSTData;
 DrawFormat: Cardinal;
 R: TRect;
 s: string;
begin
 DefaultDraw := False;
 R := CellRect;

 if Column = 0 then
  R.Left := R.Left + VST.Indent;

 Data := Node.GetData<TVSTData>;

 // TargetCanvas.TextOut(CellRect.Left, CellRect.Top + 2, Text);

 DrawFormat := DT_NOPREFIX or DT_VCENTER; // or DT_SINGLELINE;
 // if Data.bHasDescription then
 // R.Top := R.Top - 14;

 // Winapi.Windows.DrawTextW(TargetCanvas.Handle, PWideChar(Text), Length(Text), R, DrawFormat);

 if Data.bHasDescription and (Column = 0) then
  begin
   s := '123 123 123 123 123 ' + sLineBreak + '123 123 123 123 123 123 123 123 123 123 ';
   // R.Top := R.Top + 28;
   // TargetCanvas.TextOut(CellRect.Left, CellRect.Top + 18, s);
   Winapi.Windows.DrawTextW(TargetCanvas.Handle, PWideChar(s), Length(s), R, DrawFormat);
  end
 else if (Column = 0) then
  Winapi.Windows.DrawTextW(TargetCanvas.Handle, PWideChar(Text), Length(Text), R, DrawFormat);
end;

Geändert von SneakyBagels (18. Jun 2017 um 20:13 Uhr)
  Mit Zitat antworten Zitat