]> git.saurik.com Git - wxWidgets.git/commitdiff
changing coordinates to client-area relative (patch 1378189)
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 8 Apr 2006 14:33:00 +0000 (14:33 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 8 Apr 2006 14:33:00 +0000 (14:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/notebmac.cpp

index 1e6e98a2393f69928b50cc976d169496ad946995..df02de6a4b2cc5f20549cfa9e574e0e5cd3f5eb1 100644 (file)
@@ -322,7 +322,13 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const
 #if TARGET_API_MAC_OSX
     const int countPages = GetPageCount();
 
-    HIPoint hipoint = { pt.x , pt.y } ;
+    // we have to convert from Client to Window relative coordinates
+    wxPoint adjustedPt = pt + GetClientAreaOrigin(); 
+    // and now to HIView native ones
+    adjustedPt.x -= MacGetLeftBorderSize() ;
+    adjustedPt.y -= MacGetTopBorderSize() ;
+    
+    HIPoint hipoint= { adjustedPt.x , adjustedPt.y } ;
     HIViewPartCode outPart = 0 ;
     OSStatus err = HIViewGetPartHit( m_peer->GetControlRef(), &hipoint, &outPart );