]> git.saurik.com Git - wxWidgets.git/commitdiff
LocalToGlobal/GlobalToLocal Conversions with Carbon API
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 31 May 2004 14:05:05 +0000 (14:05 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 31 May 2004 14:05:05 +0000 (14:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/tooltip.cpp
src/mac/carbon/window.cpp

index f2793110dda85fc98fc1ad92b9f480e2e2c9c4e6..7e25c752d70eebfa2c53c5122fc82d40eff8e28b 100644 (file)
@@ -227,12 +227,9 @@ void wxMacToolTip::Draw()
         HMHelpContentRec tag ;
         tag.version = kMacHelpVersion;
         SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
         HMHelpContentRec tag ;
         tag.version = kMacHelpVersion;
         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 ) ;
-        LocalToGlobal( (Point *) &tag.absHotRect.top );
-        LocalToGlobal( (Point *) &tag.absHotRect.bottom );
-        if ( swapped )
-            SetPort( port );
+
+        QDLocalToGlobalRect( GetWindowPort( m_window ) , &tag.absHotRect ) ;
+
         m_helpTextRef.Assign( m_label  , wxFONTENCODING_DEFAULT ) ;
         tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
         tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
         m_helpTextRef.Assign( m_label  , wxFONTENCODING_DEFAULT ) ;
         tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
         tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;
index e827a8fb93ed5abbe1529ba7cef51c6a66ab6e66..f9549fda4d223062d271e64e51c1383f2a830297 100644 (file)
@@ -1046,11 +1046,7 @@ void wxWindowMac::MacGetPositionAndSizeFromControl(int& x, int& y,
     if ( tlw )
     {
         Point tlworigin =  { 0 , 0  } ;
     if ( tlw )
     {
         Point tlworigin =  { 0 , 0  } ;
-        GrafPtr port ;
-        bool swapped = QDSwapPort( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) , &port ) ;
-        ::LocalToGlobal( &tlworigin ) ;
-        if ( swapped )
-            ::SetPort( port ) ;
+        QDLocalToGlobalPoint( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) , &tlworigin ) ;
         x = tlworigin.h ;
         y = tlworigin.v ;    
     }
         x = tlworigin.h ;
         y = tlworigin.v ;    
     }
@@ -1145,8 +1141,7 @@ void wxWindowMac::DoScreenToClient(int *x, int *y) const
         if(x) localwhere.h = * x ;
         if(y) localwhere.v = * y ;
         
         if(x) localwhere.h = * x ;
         if(y) localwhere.v = * y ;
         
-        wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ;
-        ::GlobalToLocal( &localwhere ) ;
+        QDGlobalToLocalPoint( GetWindowPort( window ) , &localwhere ) ;
         if(x)   *x = localwhere.h ;
         if(y)   *y = localwhere.v ;
 
         if(x)   *x = localwhere.h ;
         if(y)   *y = localwhere.v ;
 
@@ -1173,9 +1168,7 @@ void wxWindowMac::DoClientToScreen(int *x, int *y) const
         Point localwhere = { 0,0 };
         if(x)   localwhere.h = * x ;
         if(y)   localwhere.v = * y ;
         Point localwhere = { 0,0 };
         if(x)   localwhere.h = * x ;
         if(y)   localwhere.v = * y ;
-
-        wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ;
-        ::LocalToGlobal( &localwhere ) ;
+        QDLocalToGlobalPoint( GetWindowPort( window ) , &localwhere ) ;
         if(x)   *x = localwhere.h ;
         if(y)   *y = localwhere.v ;
     }
         if(x)   *x = localwhere.h ;
         if(y)   *y = localwhere.v ;
     }