From e73183743a750b2f3edda2f759fca36c672acc08 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 11 May 2019 20:21:38 +0200 Subject: [PATCH] Fix creating wxPropertyGrid header when grid is horizontally scrolled Horizontal scroll position of just created wxPGHeaderCtrl has to be the same as the scroll position of wxPropertyGrid. --- src/propgrid/manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index a831a524cc..a782141682 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1354,6 +1354,10 @@ void wxPropertyGridManager::RecalculatePositions( int width, int height ) if ( m_pHeaderCtrl && m_pHeaderCtrl->IsShown() ) { m_pHeaderCtrl->SetSize(0, propgridY, width, wxDefaultCoord); + // Sync horizontal scroll position with grid + int x; + m_pPropGrid->CalcScrolledPosition(0, 0, &x, NULL); + m_pHeaderCtrl->ScrollWindow(x, 0); propgridY += m_pHeaderCtrl->GetSize().y; } #endif