TreeView truncating my Node Captions why ? lazarus / 21-General ---------------------------------------------------------------------- Weitentaaal · 2021-06-07 13:02 Hello So my Attached Picture and the Caption should describe my Problem. Any1 got an Idea ? Thanks in advice ---------------------------------------------------------------------- wp · 2021-06-07 15:53 Is this the standard LCL TTreeview? AFAIK, it has no immediate built- in checkbox support. And in the LCL TTreeView I do not see this issue. I am confused... Or are you talking of VirtualTreeView? It has a multi-column mode which works with several columns, like in a StringGrid. If you entered this and your node text exceeds the width of the 0-th column, it looks exactly like in your screenshot. Moreover, your TreeView screenshot shows wrapped node text in two lines. This is also no standard behaviour. You must be using custom- painting. But without seeing your code, nobody can solve your issue. ---------------------------------------------------------------------- wp · 2021-06-07 21:44 I know. But the standard TTreeView does not show ellipses even for long text, and it does not show checkboxes and it does not show multi- line nodes. So, the user musts do some custom-painting, and without seeing this code there's nothing that we can do. ---------------------------------------------------------------------- Weitentaaal · 2021-06-08 05:35 Sorry my Bad ... was using VirtualtreeView and all of my Nodes are Multiline so if it would be to long it should create a new Line. But this Caption is like 2-3 Chars too long and then it gets truncated. Edit: Here is how i add Nodes Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i            dbExecute(RsSprachen, 'SELECT * FROM Sprachen WHERE ID = ' + Query.FieldByName('BezID').AsString);           Node := VST.AddChild(Root);           Data := VST.GetNodeData(Node);           Data^.Bezeichnung := RsSprachen.FieldByName(FeldD).AsString;         Data^.Tag:= Query.FieldByName('ID').AsString;           VST.MultiLine[Node] := True;  The Node height for multiline gets calculated corretly. ---------------------------------------------------------------------- wp · 2021-06-08 08:04 The truncation ellipsis ('...') somewhere in the middle of your screenshot indicate that you activated the GridExtensions option. If you turn this off, does the issue disappear? ---------------------------------------------------------------------- Weitentaaal · 2021-06-08 12:47 No the issue still here. But what exactly does this ? The Description is "Use some special enhancements to simulate and support grid behavior." But what behavior does get supported ? Edit: Found out that this is happening to every Node if the text is exceeding the column width, but only for about 3-5 chars, If there are more Chars then a New Line will get generated. ---------------------------------------------------------------------- Weitentaaal · 2021-06-09 14:12 Does no one have any idea what I could be doing wrong ? ---------------------------------------------------------------------- wp · 2021-06-09 14:47 Seeing https://github.com/JAM-Software/Virtual-TreeView/issues/174 I think that this is a bug of VTV. It probably is fixed in the official version, but the Lazarus version is way behind... If you prepare a compilable demo for me which shows the issue I can try to apply the fixes mentioned in that report. ---------------------------------------------------------------------- lucamar · 2021-06-09 15:30 Quote from: Weitentaaal on June 09, 2021, 04:12:37 pmDoes no one have any idea what I could be doing wrong ? I might be wrong but I think the problem is (was?) that the code doesn't find a good place to cut the line (e.g. a space) before reaching too soon the end of the string, so it cuts close to the end and adds the "..." instead of going back and breaking it up at a previous "delimiter". I kind of remember WrapText() (or a similar function) had the same problem when the string exceeded the max length by a few chars and the last word was very long, like the Spanish "solamente" or one of those tongue-twisters Northern folks are so fond of ---------------------------------------------------------------------- Weitentaaal · 2021-06-10 08:16 Thanks Guys... so if its a bug i have to use my creativity Quote from: wp on June 09, 2021, 04:47:35 pmSeeing https://github.com/JAM-Software/Virtual-TreeView/issues/174 I think that this is a bug of VTV. It probably is fixed in the official version, but the Lazarus version is way behind... If you prepare a compilable demo for me which shows the issue I can try to apply the fixes mentioned in that report. My Project is way to big :/ i would be faster if i would rewrite a demo programm for yo. I Did try to write 1 but i just couldn't simulate the problem anymore. i don't know if its just a mistake i did somewhere.Quote from: lucamar on June 09, 2021, 05:30:21 pmQuote from: Weitentaaal on June 09, 2021, 04:12:37 pmDoes no one have any idea what I could be doing wrong ? I might be wrong but I think the problem is (was?) that the code doesn't find a good place to cut the line (e.g. a space) before reaching too soon the end of the string, so it cuts close to the end and adds the "..." instead of going back and breaking it up at a previous "delimiter". I kind of remember WrapText() (or a similar function) had the same problem when the string exceeded the max length by a few chars and the last word was very long, like the Spanish "solamente" or one of those tongue-twisters Northern folks are so fond of Did u Fix this somehow ? ---------------------------------------------------------------------- Zvoni · 2021-06-10 09:57 1) Is it a VirtualTreeView or VirtualStringTree? (Your "VST" implies VirtualStringTree!) --> https://forum.lazarus.freepascal.org/index.php/topic,53957.0.html 2) What i find odd, is that you set the captions of the Node(s), and then afterwards you set the Node to Multiline Have you tried to set MultiLine for the Node as the first thing after creating it, and then filling the Captions? And don't forget to invalidate the Node and/or to refresh the Tree again! ---------------------------------------------------------------------- dseligo · 2021-06-10 15:34 Quote from: Weitentaaal on June 10, 2021, 10:16:41 amI Did try to write 1 but i just couldn't simulate the problem anymore. i don't know if its just a mistake i did somewhere. If you can't recreate problem in test case then there is a good chance that you made mistake in your program or you set something in your program that triggers the problem. If other advices won't help you, you'll have to analyze part by part and see when problem start/stop showing. Maybe you can start by creating new form with TreeView in your program and see if there is a problem with that one. ---------------------------------------------------------------------- dseligo · 2021-06-10 15:36 Maybe TreeView uses some fixed font to calculate width and you changed font? That would explain difference of length when text goes to new line.