Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Virtual Treeview - manueller Zeilenumbruch in Zelle (https://www.delphipraxis.net/117539-virtual-treeview-manueller-zeilenumbruch-zelle.html)

micha888 20. Jul 2008 10:16


Virtual Treeview - manueller Zeilenumbruch in Zelle
 
Hallo,

ich möchte mehrere Strings in einer Zelle darstellen. Jeder String sollte in einer eigenen Zeile stehen.
Versucht habe ich folgende Kombinationen:

Delphi-Quellcode:
procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
  var CellText: WideString);
begin
  Celltext := tx1 + WideChar(#11) + tx2
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
  var CellText: WideString);
begin
  Celltext := tx1 + WideChar(#13) + tx2
end;

procedure TForm1.VirtualStringTree1GetText(Sender: TBaseVirtualTree;
  Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
  var CellText: WideString);
begin
  Celltext := tx1 + WideChar(#13) + WideChar(#10) + tx2
end;
Es werden bei allen Varianten immer nur "Quadrätchen dargestellt", ein Zeilenumbruch wird nicht ausgeführt.

Hat jemand eine Idee, wie ich das hinbekomme?

Michael

toms 20. Jul 2008 15:56

Re: Virtual Treeview - manueller Zeilenumbruch in Zelle
 
Hallo

Hier eine Antwort auf die Frage "Breaking text with #13#10 in Text?" von Mike Lischke aus seinem Forum:

Zitat:

Well, the problem is with the used APIs. In VirtualTrees.pas there is a DrawTextW implementation that deals with embedded new line chars. However this does not handle automatic word break. So on Windows NT/2k/XP I use the built-in API (Unicode is needed), which obviously does not handle hard line breaks then (although I expected it to work).

You can file a bug report if you think this is a serious limitation. Interestingly enough, so far nobody else missed hard line breaks.

mkinzler 20. Jul 2008 16:11

Re: Virtual Treeview - manueller Zeilenumbruch in Zelle
 
Dann bleibt ja nur eine eigene Implementation dieser Funktion

micha888 20. Jul 2008 19:45

Re: Virtual Treeview - manueller Zeilenumbruch in Zelle
 
Hallo und Danke für eure Antworten.
Sieht so aus, als müsste ich mich da tiefer mit beschäftigen.

Michael


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz