AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Große Probleme mit VirtualStringTree
Thema durchsuchen
Ansicht
Themen-Optionen

Große Probleme mit VirtualStringTree

Ein Thema von SneakyBagels · begonnen am 17. Jun 2017 · letzter Beitrag vom 19. Jun 2017
 
SneakyBagels
(Gast)

n/a Beiträge
 
#28

AW: Große Probleme mit VirtualStringTree

  Alt 18. Jun 2017, 11:03
Ich habe eben mal ein bisschen mit toShowStaticText rumprobiert, bekomme das aber leider nicht hin, dass ich zwei Zeilen Text pro Node habe.
Aktuell verwende ich ja TargetCanvas.TextOut im OnDrawText zweimal, da klappt es. Winapi.Windows.DrawTextW wäre mir eigentlich lieber.

Aktuell ist es so
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;
 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
   // TargetCanvas.TextOut(CellRect.Left, CellRect.Top + 18, '123');
   s:='123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 '; // wird leider nicht komplett gezeichnet - nur "123 "
   R.Top := R.Top + 28;
   Winapi.Windows.DrawTextW(TargetCanvas.Handle, PWideChar(s), Length(s), R, DrawFormat);
  end;
end;

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


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz