X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/939fba6c17da245488a77a3f58e983180fc5de91..e795e8b56f213f97745636a017609091746894a0:/src/mac/carbon/tooltip.cpp diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 3334d6b70b..8a3f2979e6 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -1,17 +1,13 @@ ///////////////////////////////////////////////////////////////////////////// // Name: tooltip.cpp // Purpose: wxToolTip implementation -// Author: Robert Roebling +// Author: Stefan Csomor // Id: $Id$ -// Copyright: (c) 1998 Robert Roebling +// Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ - #pragma implementation "tooltip.h" -#endif - -#include "wx/defs.h" +#include "wx/wxprec.h" #if wxUSE_TOOLTIPS @@ -35,7 +31,7 @@ class wxMacToolTip wxMacToolTip( ) ; ~wxMacToolTip() ; - void Setup( WindowRef window , const wxString& text , wxPoint localPosition ) ; + void Setup( WindowRef window , const wxString& text , const wxPoint& localPosition ) ; long GetMark() { return m_mark ; } void Draw() ; void Clear() ; @@ -154,7 +150,7 @@ void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ; s_LastWindowEntered = win ; - WindowRef window = MAC_WXHWND( win->MacGetRootWindow() ) ; + WindowRef window = MAC_WXHWND( win->MacGetTopLevelWindowRef() ) ; int x = event.m_x ; int y = event.m_y ; wxPoint local( x , y ) ; @@ -188,7 +184,7 @@ wxMacToolTip::wxMacToolTip() m_timer = NULL ; } -void wxMacToolTip::Setup( WindowRef win , const wxString& text , wxPoint localPosition ) +void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& localPosition ) { m_mark++ ; Clear() ; @@ -227,13 +223,10 @@ 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 ) ; - GrafPtr port ; - GetPort( &port ) ; - SetPortWindowPort(m_window) ; - LocalToGlobal( (Point *) &tag.absHotRect.top ); - LocalToGlobal( (Point *) &tag.absHotRect.bottom ); - SetPort( port ); - m_helpTextRef = m_label ; + + 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 ; tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;