]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/propgrid.cpp
Avoid outputting the assert message twice in non-GUI code.
[wxWidgets.git] / src / propgrid / propgrid.cpp
index 4ae155754c8290e1f2461579f82dc7f046234fe4..9a9da1c396604d1edbcd85e82a3ef14df50cc025 100644 (file)
@@ -1745,9 +1745,8 @@ void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) )
 
     // FIXME: This is just a workaround for a bug that causes splitters not
     //        to paint when other windows are being dragged over the grid.
-    wxRect fullRect = GetRect();
-    r.x = fullRect.x;
-    r.width = fullRect.width;
+    r.x = 0;
+    r.width = GetClientSize().x;
 
     // Repaint this rectangle
     DrawItems( dc, r.y, r.y + r.height, &r );
@@ -3279,6 +3278,12 @@ bool wxPropertyGrid::DoEditorValidate()
 
 void wxPropertyGrid::HandleCustomEditorEvent( wxEvent &event )
 {
+    // It is possible that this handler receives event even before
+    // the control has been properly initialized. Let's skip the
+    // event handling in that case.
+    if ( !m_pState )
+        return;
+
     wxPGProperty* selected = GetSelection();
 
     // Somehow, event is handled after property has been deselected.
@@ -4181,7 +4186,9 @@ bool wxPropertyGrid::DoHideProperty( wxPGProperty* p, bool hide, int flags )
 
 void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
 {
-    if ( (m_iFlags & wxPG_FL_RECALCULATING_VIRTUAL_SIZE) || m_frozen )
+    if ( (m_iFlags & wxPG_FL_RECALCULATING_VIRTUAL_SIZE) ||
+         m_frozen ||
+         !m_pState )
         return;
 
     //