- // controls are always centered on their parent because it doesn't make
- // sense to centre them on the screen
- if ( !(direction & wxCENTRE_ON_SCREEN) || !IsTopLevel() )
- {
- // the only chance to get this is to have a not top level window
- // without parent which shouldn't happen
- wxCHECK_RET( parent, wxT("this window must have a parent") );
-
- // adjust to the parents client area origin
- wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0));
-
- xNew += posParent.x;
- yNew += posParent.y;
- }