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
This commit is contained in:
Jaakko Salli
2009-11-11 19:49:58 +00:00
parent 58791ef890
commit 2f772c89eb
2 changed files with 7 additions and 4 deletions

View File

@@ -1745,9 +1745,8 @@ void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) )
// FIXME: This is just a workaround for a bug that causes splitters not // FIXME: This is just a workaround for a bug that causes splitters not
// to paint when other windows are being dragged over the grid. // to paint when other windows are being dragged over the grid.
wxRect fullRect = GetRect(); r.x = 0;
r.x = fullRect.x; r.width = GetClientSize().x;
r.width = fullRect.width;
// Repaint this rectangle // Repaint this rectangle
DrawItems( dc, r.y, r.y + r.height, &r ); DrawItems( dc, r.y, r.y + r.height, &r );

View File

@@ -322,7 +322,11 @@ void wxPropertyGridPageState::CalculateFontAndBitmapStuff( int WXUNUSED(vspacing
void wxPropertyGridPageState::SetVirtualWidth( int width ) 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(); wxPropertyGrid* pg = GetGrid();
int gw = pg->GetClientSize().x; int gw = pg->GetClientSize().x;
if ( width < gw ) if ( width < gw )