+void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+ // Try to fix a problem whereby if you show an MDI child frame, then reposition the
+ // client area, you can end up with a non-refreshed portion in the client window
+ // (see OGL studio sample). So check if the position is changed and if so,
+ // redraw the MDI child frames.
+
+ wxPoint oldPos = GetPosition();
+
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
+
+ wxPoint newPos = GetPosition();
+
+ if ((newPos.x != oldPos.x) || (newPos.y != oldPos.y))
+ {
+ if (GetParent())
+ {
+ wxWindowList::compatibility_iterator node = GetParent()->GetChildren().GetFirst();
+ while (node)
+ {
+ wxWindow *child = node->GetData();
+ if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
+ {
+ ::RedrawWindow(GetHwndOf(child),
+ NULL,
+ NULL,
+ RDW_FRAME |
+ RDW_ALLCHILDREN |
+ RDW_INVALIDATE);
+ }
+ node = node->GetNext();
+ }
+ }
+ }
+}
+
+void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
+{
+ // MDI child frames get their WM_SIZE when they're constructed but at this
+ // moment they don't have any children yet so all child windows will be
+ // positioned incorrectly when they are added later - to fix this, we
+ // generate an artificial size event here
+ if ( m_needsResize )
+ {
+ m_needsResize = false; // avoid any possibility of recursion
+
+ SendSizeEvent();
+ }
+
+ event.Skip();
+}
+