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.
This commit is contained in:
Artur Wieczorek
2019-05-11 20:21:38 +02:00
parent 560a81b913
commit e73183743a

View File

@@ -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