]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgridpagestate.cpp
Support large files with stdio on mingw.
[wxWidgets.git] / src / propgrid / propgridpagestate.cpp
index 7c7aa7c9e008fcda4cfdfc9f9f3398e20df0a0ac..8c8d00667eb400ea9e4d019ecd6127b83021b639 100644 (file)
@@ -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();