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,15 +796,27 @@ 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 )
{ {
int x , y ; wxWindow* parent = win->GetParent() ;
x = 0 ; if ( parent )
y = 0 ; {
// the parent controls 'origin' expressed in its own
win->GetParent()->MacWindowToRootWindow( &x , & y ) ; // window coordinates (explanation in window.cpp)
bounds->left += x ; int x , y ;
bounds->right += x ; x = 0 ;
bounds->top += y ; y = 0 ;
bounds->bottom += y ;
if ( !parent->IsTopLevel() )
{
x += parent->MacGetLeftBorderSize() ;
y += parent->MacGetTopBorderSize() ;
}
parent->MacWindowToRootWindow( &x , & y ) ;
bounds->left += x ;
bounds->right += x ;
bounds->top += y ;
bounds->bottom += y ;
}
} }
#endif #endif
return bounds ; return bounds ;