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
// Let parent draw the background
parent->EraseBackground( dc, rect );
+
+ // Restore DC logical origin
+ dc.SetLogicalOrigin( org_x, org_y );
}
else
{
#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->IsShown() && wxRegion(rectWin).Contains(win->GetRect()) != wxOutRegion)
+ win->Refresh(eraseBackground, &rectWin);
+
+ node = node->GetNext();
+ }
}
// ----------------------------------------------------------------------------