From c5ee2412372675afb0d4e471e8b5baf5683aca97 Mon Sep 17 00:00:00 2001 From: cbeytas Date: Sun, 6 Jan 2019 23:33:12 -0500 Subject: [PATCH] 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. --- wx/lib/agw/hypertreelist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wx/lib/agw/hypertreelist.py b/wx/lib/agw/hypertreelist.py index 9df036e6..67bb8b9e 100644 --- a/wx/lib/agw/hypertreelist.py +++ b/wx/lib/agw/hypertreelist.py @@ -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.