LocalToGlobal/GlobalToLocal Conversions with Carbon API, cleanup, hittesting corrected for 10.2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -351,7 +351,7 @@ ControlRef wxMacFindSubControl( Point location , ControlRef superControl , Contr
|
|||||||
if ( IsControlVisible( sibling ) )
|
if ( IsControlVisible( sibling ) )
|
||||||
{
|
{
|
||||||
Rect r ;
|
Rect r ;
|
||||||
GetControlBounds( sibling , &r ) ;
|
UMAGetControlBoundsInWindowCoords( sibling , &r ) ;
|
||||||
if ( MacPtInRect( location , &r ) )
|
if ( MacPtInRect( location , &r ) )
|
||||||
{
|
{
|
||||||
ControlHandle child = wxMacFindSubControl( location , sibling , outPart ) ;
|
ControlHandle child = wxMacFindSubControl( location , sibling , outPart ) ;
|
||||||
@@ -359,7 +359,12 @@ ControlRef wxMacFindSubControl( Point location , ControlRef superControl , Contr
|
|||||||
return child ;
|
return child ;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*outPart = TestControl( sibling , location ) ;
|
Point testLocation = location ;
|
||||||
|
#if TARGET_API_MAC_OSX
|
||||||
|
testLocation.h -= r.left ;
|
||||||
|
testLocation.v -= r.top ;
|
||||||
|
#endif
|
||||||
|
*outPart = TestControl( sibling , testLocation ) ;
|
||||||
return sibling ;
|
return sibling ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,12 +402,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
|
|||||||
|
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
{
|
||||||
// calculate window relative coordinates
|
QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
|
||||||
GrafPtr port;
|
|
||||||
::GetPort( &port ) ;
|
|
||||||
::SetPort( UMAGetWindowPort(window ) ) ;
|
|
||||||
::GlobalToLocal( &windowMouseLocation ) ;
|
|
||||||
::SetPort( port ) ;
|
|
||||||
|
|
||||||
if ( wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindowRef() == (WXWindow) window && windowPart == inContent )
|
if ( wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindowRef() == (WXWindow) window && windowPart == inContent )
|
||||||
{
|
{
|
||||||
@@ -789,25 +789,6 @@ void wxTopLevelWindowMac::Maximize(bool maximize)
|
|||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
|
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
|
||||||
wxMacWindowClipper clip (this);
|
wxMacWindowClipper clip (this);
|
||||||
ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
|
ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
|
||||||
/*
|
|
||||||
Rect r ;
|
|
||||||
GDHandle device = NULL ;
|
|
||||||
verify_noerr( GetWindowGreatestAreaDevice( (WindowRef) m_macWindow , kWindowContentRgn ,
|
|
||||||
&device , NULL ) ;
|
|
||||||
verify_noerr( GetAvailableWindowPositioningBounds( GetMainDevice() , &r ) ) ;
|
|
||||||
|
|
||||||
Rect tempRect ;
|
|
||||||
GrafPtr port ;
|
|
||||||
GetPort( &port ) ;
|
|
||||||
Point pt = { 0, 0 } ;
|
|
||||||
SetPortWindowPort((WindowRef)m_macWindow) ;
|
|
||||||
LocalToGlobal( &pt ) ;
|
|
||||||
SetPort( port ) ;
|
|
||||||
|
|
||||||
GetWindowPortBounds((WindowRef)m_macWindow, &tempRect ) ;
|
|
||||||
SetSize( pt.h , pt.v , tempRect.right-tempRect.left ,
|
|
||||||
tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowMac::IsMaximized() const
|
bool wxTopLevelWindowMac::IsMaximized() const
|
||||||
@@ -1223,8 +1204,7 @@ static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
|||||||
{
|
{
|
||||||
GetWindowPortBounds(window, inRect);
|
GetWindowPortBounds(window, inRect);
|
||||||
Point pt = {inRect->left, inRect->top};
|
Point pt = {inRect->left, inRect->top};
|
||||||
SetPort((GrafPtr) GetWindowPort(window));
|
QDLocalToGlobalPoint( GetWindowPort(window) , &pt ) ;
|
||||||
LocalToGlobal(&pt);
|
|
||||||
inRect->top = pt.v;
|
inRect->top = pt.v;
|
||||||
inRect->left = pt.h;
|
inRect->left = pt.h;
|
||||||
inRect->bottom += pt.v;
|
inRect->bottom += pt.v;
|
||||||
|
@@ -636,22 +636,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
|||||||
return err ;
|
return err ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// events
|
|
||||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
|
||||||
{
|
|
||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) inWindow) ) ;
|
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
|
||||||
GetWindowUpdateRgn( inWindow , updateRgn ) ;
|
|
||||||
|
|
||||||
Point zero = { 0 , 0 } ;
|
|
||||||
LocalToGlobal( &zero ) ;
|
|
||||||
OffsetRgn( updateRgn , -zero.h , -zero.v ) ;
|
|
||||||
|
|
||||||
UpdateControls( inWindow , inRgn ) ;
|
|
||||||
InvalWindowRgn( inWindow, updateRgn) ;
|
|
||||||
DisposeRgn( updateRgn ) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UMAIsWindowFloating( WindowRef inWindow )
|
bool UMAIsWindowFloating( WindowRef inWindow )
|
||||||
{
|
{
|
||||||
WindowClass cl ;
|
WindowClass cl ;
|
||||||
|
Reference in New Issue
Block a user