Fix HyperTreeList headers if child window selected

If a child window is only partially displayed, and it is clicked on,
the window will scroll to the right so that it is fully visible. This
doesn't send an EVT_SCROLLWIN event which means the column headers
don't get updated. As a workaround we manually refresh the headers
whenever a child window gets focus.

Problem can be seen in the demo by expanding out "item 0-a", enabling
it, then clicking on the embedded TreeCtrl. The window will scroll to
reveal the entire TreeCtrl, but the column headers won't scroll and
will no longer be aligned with the columns of the tree.
This commit is contained in:
cbeytas
2019-01-06 23:33:12 -05:00
parent 70464181c9
commit c5ee241237

View File

@@ -1695,6 +1695,8 @@ class TreeListItem(GenericTreeItem):
treectrl = self._owner
select = treectrl.GetSelection()
# Refresh header window since child focus could have moved scrollbars.
treectrl.GetParent().GetHeaderWindow().Refresh()
# If the window is associated to an item that currently is selected
# (has focus) we don't kill the focus. Otherwise we do it.