- //
- // Move the children
- //
- wxWindowList::Node* pCurrent = GetChildren().GetFirst();
- SWP vSwp;
-
- while (pCurrent)
- {
- wxWindow* pChildWin = pCurrent->GetData();
-
- if (pChildWin->GetHWND() != NULLHANDLE)
- {
- ::WinQueryWindowPos(pChildWin->GetHWND(), &vSwp);
- ::WinQueryWindowRect(pChildWin->GetHWND(), &vRect);
- if (pChildWin->IsKindOf(CLASSINFO(wxControl)))
- {
- wxControl* pCtrl;
-
- //
- // Must deal with controls that have margins like ENTRYFIELD. The SWP
- // struct of such a control will have and origin offset from its intended
- // position by the width of the margins.
- //
- pCtrl = wxDynamicCast(pChildWin, wxControl);
- vSwp.y -= pCtrl->GetYComp();
- vSwp.x -= pCtrl->GetXComp();
- }
- ::WinSetWindowPos( pChildWin->GetHWND()
- ,HWND_BOTTOM
- ,vSwp.x + nDx
- ,vSwp.y + nDy
- ,0
- ,0
- ,SWP_MOVE
- );
- if (pChildWin->IsKindOf(CLASSINFO(wxRadioBox)))
- {
- wxRadioBox* pRadioBox;
-
- pRadioBox = wxDynamicCast(pChildWin, wxRadioBox);
- pRadioBox->AdjustButtons( (int)vSwp.x + nDx
- ,(int)vSwp.y + nDy
- ,(int)vSwp.cx
- ,(int)vSwp.cy
- ,pRadioBox->GetSizeFlags()
- );
- }
- if (pChildWin->IsKindOf(CLASSINFO(wxSlider)))
- {
- wxSlider* pSlider;
-
- pSlider = wxDynamicCast(pChildWin, wxSlider);
- pSlider->AdjustSubControls( (int)vSwp.x + nDx
- ,(int)vSwp.y + nDy
- ,(int)vSwp.cx
- ,(int)vSwp.cy
- ,pSlider->GetSizeFlags()
- );
- }
- ::WinInvalidateRect(pChildWin->GetHWND(), &vRectChild, FALSE);
- }
- pCurrent = pCurrent->GetNext();
- }
- if (GetChildren().GetCount() > 0)
- {
- //
- // Clean up child window slop
- //
- ::WinQueryWindowRect(GetHwnd(), &vRect);
- vRect.xRight -= 20;
- vRect.yBottom += 20;
- ::WinInvalidateRect(GetHwnd(), &vRect, TRUE);
- }
-
- //
- // Takes a lot to keep the scrollbars on top of everything
- //
- ::WinSetWindowPos( m_hWndScrollBarHorz
- ,HWND_TOP
- ,0
- ,0
- ,0
- ,0
- ,SWP_ZORDER
- );
- ::WinSetWindowPos( m_hWndScrollBarVert
- ,HWND_TOP
- ,0
- ,0
- ,0
- ,0
- ,SWP_ZORDER
- );
- ::WinInvalidateRect(m_hWndScrollBarHorz, &vRectHorz, FALSE);
- ::WinInvalidateRect(m_hWndScrollBarVert, &vRectVert, FALSE);