/////////////////////////////////////////////////////////////////////////////
// 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
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() ;
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() ;
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 ;