Conversation
freakboy3742
left a comment
There was a problem hiding this comment.
This is awesome - thanks! I've flagged a couple of minor style things; but on the whole, the implementation looks really solid (to the extent that I understand win32 stuff), and it definitely works in all my testing.
The one issue of substance that I noticed is around the style of the Tree, and the "blue line" rendering of tree nodes. One detail that isn't exercised in the tree example app is that tree nodes can have data. In the tree example app, you could give a title to each decade:
The app is currently using an empty string for each "non column 1" field. That's probably a change we should make to the example, so that it's obvious - but with that change, in the Windows rendering, as soon as a leaf becomes a node, we lose the text for the rest of the node.
You've mentioned that the row style is customisable - is that sort of change in the realm of the possible? I'm guessing that might mean we lose the blue bar - I'm not sure if that's a "dealer's choice" thing from you, or if it's idiomatic on Windows.
Welcome to the Tree widget for the Windows platform!
How it works:
The
Treewidget is based on theTablewidget, except with some extra structure:StateTreewhich is a wrapper for theTreeSource. It keeps track of which nodes are expanded/collapsed and then makes/modifies a display list which is sent to the UINotes on Styling:
The styling is based on that of ListView groups, with some modifications. Unfortunately the combination of virtual mode and groups is not supported in WinForms, and is undocumented for Win32. Also, looking at the expansion arrow in the picture on the left below, I don't think that this style is being actively updated.

The solution is to simply custom draw the row. Here is the current iteration of the Tree widget:

Notes for testing:
One of the hardest parts was to get the selection to play nicely with the state-change clicks. The interactions between the clicks-hit-tests and selection is somewhat complicated. Make note of any weirdness you observe in this area!
Changes to the Table widget
I've made some minor changes to the WinForms
Tablewidget code. This is mainly tidying things up a little, but also I've modified some methods so they can be more easily shared with theTreewidget.PR Checklist: