New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiline broken (since update from 5.3.0 to 6.4.1) #675
Comments
Joachim, I investigated this and found that it was changed in 5.5 in issue #557, mentioned as #447 in CHANGES. file. It's quite a length discussion in there with original issue for which this was done not found at that time. I you can go through that and recall why that change was made, it will help. I think it was better in earlier code not to measure height in setchildcount and postpone it till the Paint as the earlier code was doing. |
Afterthought: One solution is to reset the vsHeightMeasured state of each node on EndUpdate. This should work for old applications relying on a measure of node height at first paint time. At the same time, any new applications will not break. However, we also need to test with a large number of nodes to see if BeginUpdate/EndUpdate is slowed down by that code introduced in #557. |
I did some experiments. But there is a big problem. The design change that was made in VTV makes it too slow for the same code.
I think we need to revisit that old issue and see why the change was made and then see if the filtering problem can be fixed in some other way. |
I think the line
Should be part of the |
The old version however did not calculate the scrollbars correctly, because it calculated the actual node height on a |
I understand. But I think any height calculation should be postponed to
after EndUpdate in the traditional way if possible. I'm coming in after a
long gap on this. I will reinspect the code to see if that is possible.
…On Tue, Feb 28, 2017 at 2:52 PM, Joachim Marder ***@***.***> wrote:
Compiled the test program with my changes above for OnInitNode
to make it work with the latest VTV source. Ran the test again.
It takes almost 2 secs to finish. It's much slower now.
The old version however did not calculate the scrollbars correctly,
because it calculated the actual node height on a toVariableNodeHeight
scenario only for the visible nodes. This was what #557
<#557>
targeted.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#675 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATX-xg_nwB5vMtmesbLnRy7BM0Imo7Anks5rg-dugaJpZM4K9hrU>
.
|
But it should continue to support the old code that does it in the standard
TreeView way where the nodes are added and data is assigned immediately.
The analogy should still work and should be as fast as possible. Huge
capacity is the main feature of VTV but it should not be at the cost of
reduced speed that the modifications have caused. Earlier version is
extremely fast with the same loop.
…On Mon, Jan 9, 2017 at 12:42 AM, Joachim Marder ***@***.***> wrote:
I think the line
Data.S := GenerateString;
Should be part of the OnInitNode event handler. Whenever you change the
node's stringafter the node has been initialzed, you need to clear the
flagvsHeightMeasuredfromTVirtualNode.States`.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#675 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATX-xv_M9QI7PaBZVzbCli8iczOs_79Xks5rQTUAgaJpZM4K9hrU>
.
|
As long as the height is calculated for all nodes correctly, and so the scrollbars, I don't see any problem with that.
Doing the height calculation in
But at the price of wrong scrollbar behavior. I don't think we should trade wrong behavior for speed. The current version is still as fast as the old version in case you have constant node heights. If someone wants maximum speed, he has to follow the virtual paradigm. And he has the choice to perform complex calculations in |
@joachimmarder
Should we close this issue with the label "Breaking change"? |
Yes.
Since nothing was changed for this issue in V6.7 I would use a label like WONTFIX or INVALID for this issue. |
Hi,
we have an App that uses Multiline support in TreeView. Since we updated from 5.3.0 to 6.4.1 our TreeView has only Single-Line Nodeheight instead of the MultiLine-Height. As if every Node had only 1 Text-Line.
We debuged a little and found out that the old TreeView 5.3.0 does not fire the OnMeasureItem while in BeginUpdate; EndUpdate; The 6.4.1 on the other hand does.
we do the following when building our Tree:
The OnMeasureItem is called from SetChildCount. In the V5.3.0 you will find the following comment:
// The actual node height will later be computed once it is clear
// whether this node has a variable node height or not.
I think there is some problem introduced in some Version after 5.3.0. Specially while in BeginUpdate; EndUpdate; It is more efficient when only calculating Stuff when we are no more in an Update-Mode.
I Attach a Simple Demo.
V5.3.0:
V6.4.1:
Demo:
VirtualTreeViewMultiLine.zip
The text was updated successfully, but these errors were encountered: