LocalToGlobal/GlobalToLocal Conversions with Carbon API

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-05-31 14:05:05 +00:00
parent 6b31faacf1
commit a9de2608ba
2 changed files with 6 additions and 16 deletions

View File

@@ -227,12 +227,9 @@ void wxMacToolTip::Draw()
HMHelpContentRec tag ; HMHelpContentRec tag ;
tag.version = kMacHelpVersion; tag.version = kMacHelpVersion;
SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ; SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
GrafPtr port ;
bool swapped = QDSwapPort( GetWindowPort( m_window ) , &port ) ; QDLocalToGlobalRect( GetWindowPort( m_window ) , &tag.absHotRect ) ;
LocalToGlobal( (Point *) &tag.absHotRect.top );
LocalToGlobal( (Point *) &tag.absHotRect.bottom );
if ( swapped )
SetPort( port );
m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ; m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ;
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;

View File

@@ -1046,11 +1046,7 @@ void wxWindowMac::MacGetPositionAndSizeFromControl(int& x, int& y,
if ( tlw ) if ( tlw )
{ {
Point tlworigin = { 0 , 0 } ; Point tlworigin = { 0 , 0 } ;
GrafPtr port ; QDLocalToGlobalPoint( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) , &tlworigin ) ;
bool swapped = QDSwapPort( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) , &port ) ;
::LocalToGlobal( &tlworigin ) ;
if ( swapped )
::SetPort( port ) ;
x = tlworigin.h ; x = tlworigin.h ;
y = tlworigin.v ; y = tlworigin.v ;
} }
@@ -1145,8 +1141,7 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const
if(x) localwhere.h = * x ; if(x) localwhere.h = * x ;
if(y) localwhere.v = * y ; if(y) localwhere.v = * y ;
wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ; QDGlobalToLocalPoint( GetWindowPort( window ) , &localwhere ) ;
::GlobalToLocal( &localwhere ) ;
if(x) *x = localwhere.h ; if(x) *x = localwhere.h ;
if(y) *y = localwhere.v ; if(y) *y = localwhere.v ;
@@ -1173,9 +1168,7 @@ void wxWindowMac::DoClientToScreen(int *x, int *y) const
Point localwhere = { 0,0 }; Point localwhere = { 0,0 };
if(x) localwhere.h = * x ; if(x) localwhere.h = * x ;
if(y) localwhere.v = * y ; if(y) localwhere.v = * y ;
QDLocalToGlobalPoint( GetWindowPort( window ) , &localwhere ) ;
wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ;
::LocalToGlobal( &localwhere ) ;
if(x) *x = localwhere.h ; if(x) *x = localwhere.h ;
if(y) *y = localwhere.v ; if(y) *y = localwhere.v ;
} }