From 2f772c89ebd4c95fe165353212f239726cf5d74f Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Wed, 11 Nov 2009 19:49:58 +0000 Subject: [PATCH] Fix wxPropertyGrid rendering problems when used with wxAUI. It seems we cannot rely on wxWindow::GetRect() to return wxRect with x=0 here. (fixes #11433) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 5 ++--- src/propgrid/propgridpagestate.cpp | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 4ae155754c..0fb5a5bf92 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -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 ); diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index 7c7aa7c9e0..7eb91e6ac1 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 ) -- 2.45.2