-void wxWindowOS2::MoveChildren(
- int nDiff
-)
-{
- //
- // We want to handle top levels ourself, manually
- //
- if (!IsTopLevel() && GetAutoLayout())
- {
- Layout();
- }
- else
- {
- SWP vSwp;
-
- for (wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
- node;
- node = node->GetNext())
- {
- wxWindow* pWin = node->GetData();
-
- ::WinQueryWindowPos( GetHwndOf(pWin)
- ,&vSwp
- );
- // Actually, only move children that already are placed on the
- // frame, not ones which are still at wxDefaultCoord.
- if (vSwp.y == wxDefaultCoord)
- continue;
- if (pWin->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(pWin, wxControl);
- vSwp.y -= pCtrl->GetYComp();
- vSwp.x -= pCtrl->GetXComp();
- }
- ::WinSetWindowPos( GetHwndOf(pWin)
- ,HWND_TOP
- ,vSwp.x
- ,vSwp.y - nDiff
- ,vSwp.cx
- ,vSwp.cy
- ,SWP_MOVE
- );
- ::WinQueryWindowPos(GetHwndOf(pWin), pWin->GetSwp());
- if (pWin->IsKindOf(CLASSINFO(wxRadioBox)))
- {
- wxRadioBox* pRadioBox;
-
- pRadioBox = wxDynamicCast(pWin, wxRadioBox);
- pRadioBox->AdjustButtons( (int)vSwp.x
- ,(int)vSwp.y - nDiff
- ,(int)vSwp.cx
- ,(int)vSwp.cy
- ,pRadioBox->GetSizeFlags()
- );
- }
- if (pWin->IsKindOf(CLASSINFO(wxSlider)))
- {
- wxSlider* pSlider;
-
- pSlider = wxDynamicCast(pWin, wxSlider);
- pSlider->AdjustSubControls( (int)vSwp.x
- ,(int)vSwp.y - nDiff
- ,(int)vSwp.cx
- ,(int)vSwp.cy
- ,(int)pSlider->GetSizeFlags()
- );
- }
- }
- }
- Refresh();
-} // end of wxWindowOS2::MoveChildren
-