-
Notifications
You must be signed in to change notification settings - Fork 248
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
Method TVirtualTreeColumn.GetCaptionWidth
handles owner-drawn caption badly
#1250
Comments
Please respect our guidelines on the project homepage for submitting bugs. Please include your version of Virtual TreeView and attach a sample compiling project as ZIP to your report. If you already have a solution, please supply a patch file.
Well, that was 5 years ago. Maybe the original contributor @lyynxx can comment on this? |
Pardon, I've been in a bit of a hurry, yesterday. The issue is easy reproducible in HeaderCustomDrawDemo's tab of This applied, if one holds ctrl-key and double-clicks the column headers' edges, the columns are resized badly:
Unfortunately, I cannot provide a fix right now. I thought about delegating the text measurement to the already existing method |
For some reason I could not yet figure out, in
Have you tried the |
Yes. The values width is correct, based on the wrong value. Although, the way it's calculated duplicates a more sophisticated logic, elsewhere (see
I am aware of the |
I found the reason why the font size is so large: It was modified that way in
Well it couldn't as, it exists only in the derived class for the Virtual String Tree. Also, the events you mentioned are for painting the client area of the virtual string tree, they can't recognize if some text is from the client area or the header, which by the way has its own |
Since #925 was merged, header captions may be considered optionally in
TBaseVirtualTree.GetMaxColumnWidth
.Unfortunately, this is mostly insufficient for owner-drawn headers, as
TVirtualTreeColumn.GetCaptionWidth
calculates the text's total width by just callingGetTextExtentPoint32W(…)
. Since, in my case,FText
does not contain plain text, but a HTML-formatted string, the result is way too big.TBaseVirtualTree.DoHeaderDrawQueryElements
is called before, to update local variablePaintInfo
, as it seems. Apparently, the code was just copy-pasted selectively fromTVirtualTreeColumns.PaintHeader
. 😞The text was updated successfully, but these errors were encountered: