X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0da1f1c4cc2fd8e8b6774b8e20b941bee759075f..61a69259c442653024f557707b5ca652d84919e0:/src/propgrid/propgridpagestate.cpp diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 7c7aa7c9e0..8c8d00667e 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -322,7 +322,11 @@ void wxPropertyGridPageState::CalculateFontAndBitmapStuff( int WXUNUSED(vspacing void wxPropertyGridPageState::SetVirtualWidth( int width ) { - wxASSERT( width >= 0 ); + // Sometimes width less than 0 is offered. Let's make things easy for + // everybody and deal with it here. + if ( width < 0 ) + width = 0; + wxPropertyGrid* pg = GetGrid(); int gw = pg->GetClientSize().x; if ( width < gw ) @@ -838,8 +842,7 @@ void wxPropertyGridPageState::PropagateColSizeDec( int column, void wxPropertyGridPageState::DoSetSplitterPosition( int newXPos, int splitterColumn, - bool WXUNUSED(allPages), - bool fromAutoCenter ) + int flags ) { wxPropertyGrid* pg = GetGrid(); @@ -874,7 +877,8 @@ void wxPropertyGridPageState::DoSetSplitterPosition( int newXPos, if ( splitterColumn == 0 ) m_fSplitterX = (double) newXPos; - if ( !fromAutoCenter ) + if ( !(flags & wxPG_SPLITTER_FROM_AUTO_CENTER) && + !(flags & wxPG_SPLITTER_FROM_EVENT) ) { // Don't allow initial splitter auto-positioning after this. m_isSplitterPreSet = true; @@ -1079,7 +1083,8 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange ) } } - DoSetSplitterPosition((int)splitterX, 0, false, true); + DoSetSplitterPosition((int)splitterX, 0, + wxPG_SPLITTER_FROM_AUTO_CENTER); m_fSplitterX = splitterX; // needed to retain accuracy } @@ -1090,7 +1095,8 @@ void wxPropertyGridPageState::SetColumnCount( int colCount ) wxASSERT( colCount >= 2 ); m_colWidths.SetCount( colCount, wxPG_DRAG_MARGIN ); if ( m_colWidths.size() > (unsigned int)colCount ) - m_colWidths.RemoveAt( m_colWidths.size(), m_colWidths.size() - colCount ); + m_colWidths.RemoveAt( m_colWidths.size()-1, + m_colWidths.size() - colCount ); if ( m_pPropGrid->GetState() == this ) m_pPropGrid->RecalculateVirtualSize();