Autor Beitrag
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Do 20.11.08 23:27 
Liebe Delphiexperten,

ich möchte pro Zeile(also pro Datensatz) in meinem VirtualTree (VirtualStringTree/VirtualDrawTree?!?) die enthaltenen Daten mehrzeilig darstellen. Ok, klingt kompliziert, daher hier ein Bild zur Verdeutlichung:

user defined image

Ein Eintrag(Node) des VirtualTree sollte aus einer Überschrift in der ersten Zeile (im Bild: "Some Things - Lasgo") und weiteren Informationen in der zweiten Zeile (im Bild: "13 tracks", "album length"...) bestehen...

Gibt es da was vorgefertigtes? Muss ich mir da selbst was basteln(wie?)


Vielen Dank schon mal für eure Bemühung! :)
platzwart Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Fr 21.11.08 16:50 
Niemand eine Idee?

Eventuell in einer OwnerDraw-Methode das ganze selbst zeichnen?
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Sa 22.11.08 17:03 
Hi,

ich habe das damals glaube ich so gelöst, dass ich die VTEditors verwendet habe.
D.h. ich habe im Event CreateEditor zum Anzeigen des Editors die Klasse TMemoEditLink als Link angegeben.
Das wirst du zumindest brauchen, wenn du die Eingabe mehrzeilig darstellen und verändern möchtest.

Ansonsten dürfte dir das Event MeasureItem reichen.
Dort ermittelst du die Nodehöhe für die gewünschte Zeile anhand der Funktion ComputeNodeHeight.
Zudem musst du IMHO bei den TreeOptions (MiscOptions) noch toVariableNodeHeight einstellen.

Sofern ich nicht etwas vergessen habe, müsste es damit klappen.

MfG
odg

_________________
Stellen Sie sich bitte Zirkusmusik vor.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 23.11.08 12:22 
Es gibt vom VirtualTreeView ja auch Demos zum runterladen.
In einem dieser Demos wird die Verwendung von mehrzeiligen Items gezeigt.

_________________
In the beginning was the word.
And the word was content-type: text/plain.