Fix calculation of column width after changing number of wxPropertyGrid columns

Because changing the number of columns may change their total width from value greater than current client size to the value less than this size or vice versa we need to know this total width prior to determining wxProperyGrid scrolled view in order to account this actual width in the calculations.
This commit is contained in:
Artur Wieczorek
2019-05-20 18:58:58 +02:00
parent 549acf6e80
commit a07c14a31d

View File

@@ -1029,6 +1029,8 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
// Then mode-based requirement
if ( !pg->HasVirtualWidth() )
{
m_width = clientWidth;
int widthHigher = m_width - colsWidth;
// Adapt colsWidth to width
@@ -1167,10 +1169,9 @@ void wxPropertyGridPageState::SetColumnCount( int colCount )
m_colWidths.resize(colCount, wxPG_DRAG_MARGIN);
m_columnProportions.resize(colCount, 1);
CheckColumnWidths();
if ( IsDisplayed() )
m_pPropGrid->RecalculateVirtualSize();
else
CheckColumnWidths();
}
void wxPropertyGridPageState::DoSetColumnProportion( unsigned int column,