+
+ // Refresh all sub controls if any.
+ wxWindowList::compatibility_iterator 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();
+ }