making implementation independent of a wx-peer of that control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -794,30 +794,14 @@ Rect* UMAGetControlBoundsInWindowCoords(ControlRef theControl, Rect *bounds)
|
|||||||
|
|
||||||
GetControlBounds( theControl , bounds ) ;
|
GetControlBounds( theControl , bounds ) ;
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
if ( win != NULL && win->MacGetTopLevelWindow() != NULL )
|
WindowRef tlwref = GetControlOwner( theControl ) ;
|
||||||
{
|
wxTopLevelWindowMac* tlwwx = wxFindWinFromMacWindow( tlwref ) ;
|
||||||
wxWindow* parent = win->GetParent() ;
|
ControlRef rootControl = tlwwx->GetPeer()->GetControlRef() ;
|
||||||
if ( parent )
|
|
||||||
{
|
|
||||||
// the parent controls 'origin' expressed in its own
|
|
||||||
// window coordinates (explanation in window.cpp)
|
|
||||||
int x , y ;
|
|
||||||
x = 0 ;
|
|
||||||
y = 0 ;
|
|
||||||
|
|
||||||
if ( !parent->IsTopLevel() )
|
HIPoint hiPoint = CGPointMake( 0 , 0 ) ;
|
||||||
{
|
|
||||||
x += parent->MacGetLeftBorderSize() ;
|
|
||||||
y += parent->MacGetTopBorderSize() ;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent->MacWindowToRootWindow( &x , & y ) ;
|
HIViewConvertPoint( &hiPoint , HIViewGetSuperview(theControl) , rootControl ) ;
|
||||||
bounds->left += x ;
|
OffsetRect( bounds , hiPoint.x , hiPoint.y ) ;
|
||||||
bounds->right += x ;
|
|
||||||
bounds->top += y ;
|
|
||||||
bounds->bottom += y ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return bounds ;
|
return bounds ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user