X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..7960c7b4c5b44c2ea923f5acca38fd0fd269a159:/src/univ/winuniv.cpp diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index afc1a6efbd..3d4292e5c3 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -6,7 +6,7 @@ // Created: 06.08.00 // RCS-ID: $Id$ // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // =========================================================================== @@ -284,10 +284,10 @@ bool wxWindow::DoDrawBackground(wxDC& dc) AdjustForParentClientOrigin( pos.x, pos.y, 0 ); // Adjust DC logical origin - wxCoord x,y; - dc.GetLogicalOrigin( &x, &y ); - x += pos.x; - y += pos.y; + wxCoord org_x, org_y, x, y; + dc.GetLogicalOrigin( &org_x, &org_y ); + x = org_x + pos.x; + y = org_y + pos.y; dc.SetLogicalOrigin( x, y ); // Adjust draw rect @@ -296,6 +296,9 @@ bool wxWindow::DoDrawBackground(wxDC& dc) // Let parent draw the background parent->EraseBackground( dc, rect ); + + // Restore DC logical origin + dc.SetLogicalOrigin( org_x, org_y ); } else { @@ -388,6 +391,19 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rectClient) #endif // WXDEBUG_REFRESH wxWindowNative::Refresh(eraseBackground, &rectWin); + + // Refresh all sub controls if any. + wxWindowList::Node *node = GetChildren().GetFirst(); + while ( node ) + { + wxWindow *win = node->GetData(); + // Only refresh sub controls when it is visible + // and when it is in the update region. + if(!win->IsKindOf(CLASSINFO(wxTopLevelWindow)) && win->IsShown() && wxRegion(rectWin).Contains(win->GetRect()) != wxOutRegion) + win->Refresh(eraseBackground, &rectWin); + + node = node->GetNext(); + } } // ----------------------------------------------------------------------------