Forum > Packages and Libraries
Unresponsive hints of TVirtualDrawTree + error in demo
trexet:
PR for VT got merged!
--- Quote from: trexet on June 27, 2024, 04:23:16 pm ---What about fixing the empty Hint field in the DrawTreeDemo of vst_advanced demo? Should I make a PR in the Lazarus gitlab repo?
--- End quote ---
wp:
Cannot compile blikblum's V5 now: In CMHintShow, there is now "DoGetHintKind(HitInfo.HitNode, HitInfo.HitColumn, FHintData.HintKind)" but FHintData only has a field "Kind" after your change. After replacing the HintKind by Kind here and two lines further down it does compile and install, though. How then can I test whether the patch works? Do you have a demo project which showed the original issue? You were referring to the "Advanced" demo, but are there any changes that I must make to this project?
trexet:
--- Quote from: wp on July 04, 2024, 01:11:52 pm ---Cannot compile blikblum's V5 now: In CMHintShow, there is now "DoGetHintKind(HitInfo.HitNode, HitInfo.HitColumn, FHintData.HintKind)" but FHintData only has a field "Kind" after your change. After replacing the HintKind by Kind here and two lines further down it does compile and install, though. How then can I test whether the patch works? Do you have a demo project which showed the original issue? You were referring to the "Advanced" demo, but are there any changes that I must make to this project?
--- End quote ---
Thanks, pushed a fix. I've could mistyped it when moved the changes from my local package instance to the V5 repo.
As for test, you can test hints responsiveness with the existing Demo (WindowsXP or DrawTree would are convenient as they show hints by default).
To test system-drawn text hints of VDT, you can modify the DrawTree demo by adding these handlers:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TDrawTreeForm.VDT1GetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; var HintText: String);var Data: PShellObjectData;begin Data := Sender.GetNodeData(Node); if Column = 0 then HintText := Data.Display;end; procedure TDrawTreeForm.VDT1GetHintKind(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; var Kind: TVTHintKind);begin if Column = 0 then Kind := vhkText else Kind := vhkOwnerDraw; // with #34 quickfix that can be without else: // if Column = 0 then Kind := vhkText;end;
Note that the Hint property of VDT must not be empty for the vhkOwnerDraw hints ever to show as I mentioned earlier.
wp:
Thanks, got it working finally...
Committed changes to Lazarus port of VTV (incl. non-empty Hint property in the DrawTreeDemo).
--- Quote from: trexet on July 04, 2024, 03:48:09 pm ---Note that the Hint property of VDT must not be empty for the vhkOwnerDraw hints ever to show as I mentioned earlier.
--- End quote ---
Why is this necessary? Looks like something still is missing.
There is also an issue with the hints of the filename column of the DrawTreeForm because the hints are drawn too far away from the nodes (see attachment).
Navigation
[0] Message Index
[*] Previous page