X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c1a331259c998fdf79ae0303a1845863de6afbb..7d8268a1d64de58aab194e4d8ae800c755990aad:/src/mac/carbon/tooltip.cpp diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 042a6f2c35..73e70849f0 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -1,9 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// // 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 ///////////////////////////////////////////////////////////////////////////// @@ -154,7 +154,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 ) ; @@ -227,13 +227,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 ; @@ -262,7 +259,7 @@ void wxMacToolTip::Draw() int width = 0 ; int thiswidth = 0 ; int laststop = 0 ; - wxCharBuffer text = wxMacStringToCString( m_label ) ; + wxCharBuffer text = m_label.mb_str( wxConvLocal) ; while( i < length ) {