fixed border calculation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-01-09 05:50:36 +00:00
parent c50a4038e3
commit ae190e6447

View File

@@ -796,16 +796,28 @@ Rect* UMAGetControlBoundsInWindowCoords(ControlRef theControl, Rect *bounds)
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
if ( win != NULL && win->MacGetTopLevelWindow() != NULL ) if ( win != NULL && win->MacGetTopLevelWindow() != NULL )
{ {
wxWindow* parent = win->GetParent() ;
if ( parent )
{
// the parent controls 'origin' expressed in its own
// window coordinates (explanation in window.cpp)
int x , y ; int x , y ;
x = 0 ; x = 0 ;
y = 0 ; y = 0 ;
win->GetParent()->MacWindowToRootWindow( &x , & y ) ; if ( !parent->IsTopLevel() )
{
x += parent->MacGetLeftBorderSize() ;
y += parent->MacGetTopBorderSize() ;
}
parent->MacWindowToRootWindow( &x , & y ) ;
bounds->left += x ; bounds->left += x ;
bounds->right += x ; bounds->right += x ;
bounds->top += y ; bounds->top += y ;
bounds->bottom += y ; bounds->bottom += y ;
} }
}
#endif #endif
return bounds ; return bounds ;
} }