native tooltips
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,6 +50,9 @@ class wxMacToolTip
|
|||||||
bool m_shown ;
|
bool m_shown ;
|
||||||
long m_mark ;
|
long m_mark ;
|
||||||
wxMacToolTipTimer* m_timer ;
|
wxMacToolTipTimer* m_timer ;
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
CFStringRef m_helpTextRef ;
|
||||||
|
#endif
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class wxMacToolTipTimer : public wxTimer
|
class wxMacToolTipTimer : public wxTimer
|
||||||
@@ -183,6 +186,7 @@ wxMacToolTip::wxMacToolTip()
|
|||||||
m_mark = 0 ;
|
m_mark = 0 ;
|
||||||
m_shown = false ;
|
m_shown = false ;
|
||||||
m_timer = NULL ;
|
m_timer = NULL ;
|
||||||
|
m_helpTextRef = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
|
void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
|
||||||
@@ -235,14 +239,15 @@ void wxMacToolTip::Draw()
|
|||||||
LocalToGlobal( (Point *) &tag.absHotRect.top );
|
LocalToGlobal( (Point *) &tag.absHotRect.top );
|
||||||
LocalToGlobal( (Point *) &tag.absHotRect.bottom );
|
LocalToGlobal( (Point *) &tag.absHotRect.bottom );
|
||||||
SetPort( port );
|
SetPort( port );
|
||||||
CFStringRef text = wxMacCreateCFString(m_label) ;
|
if( m_helpTextRef )
|
||||||
|
CFRelease( m_helpTextRef )
|
||||||
|
m_helpTextRef = wxMacCreateCFString(m_label) ;
|
||||||
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
||||||
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
||||||
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
||||||
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
||||||
tag.tagSide = kHMDefaultSide;
|
tag.tagSide = kHMDefaultSide;
|
||||||
HMDisplayTag( &tag );
|
HMDisplayTag( &tag );
|
||||||
CFRelease( text ) ;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -446,6 +451,8 @@ void wxMacToolTip::Clear()
|
|||||||
return ;
|
return ;
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
HMHideTag() ;
|
HMHideTag() ;
|
||||||
|
if( m_helpTextRef )
|
||||||
|
CFRelease( m_helpTextRef )
|
||||||
#else
|
#else
|
||||||
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
||||||
{
|
{
|
||||||
|
@@ -50,6 +50,9 @@ class wxMacToolTip
|
|||||||
bool m_shown ;
|
bool m_shown ;
|
||||||
long m_mark ;
|
long m_mark ;
|
||||||
wxMacToolTipTimer* m_timer ;
|
wxMacToolTipTimer* m_timer ;
|
||||||
|
#ifdef TARGET_CARBON
|
||||||
|
CFStringRef m_helpTextRef ;
|
||||||
|
#endif
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
class wxMacToolTipTimer : public wxTimer
|
class wxMacToolTipTimer : public wxTimer
|
||||||
@@ -183,6 +186,7 @@ wxMacToolTip::wxMacToolTip()
|
|||||||
m_mark = 0 ;
|
m_mark = 0 ;
|
||||||
m_shown = false ;
|
m_shown = false ;
|
||||||
m_timer = NULL ;
|
m_timer = NULL ;
|
||||||
|
m_helpTextRef = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
|
void wxMacToolTip::Setup( WindowRef win , wxString text , wxPoint localPosition )
|
||||||
@@ -235,14 +239,15 @@ void wxMacToolTip::Draw()
|
|||||||
LocalToGlobal( (Point *) &tag.absHotRect.top );
|
LocalToGlobal( (Point *) &tag.absHotRect.top );
|
||||||
LocalToGlobal( (Point *) &tag.absHotRect.bottom );
|
LocalToGlobal( (Point *) &tag.absHotRect.bottom );
|
||||||
SetPort( port );
|
SetPort( port );
|
||||||
CFStringRef text = wxMacCreateCFString(m_label) ;
|
if( m_helpTextRef )
|
||||||
|
CFRelease( m_helpTextRef )
|
||||||
|
m_helpTextRef = wxMacCreateCFString(m_label) ;
|
||||||
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
||||||
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
||||||
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
||||||
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
||||||
tag.tagSide = kHMDefaultSide;
|
tag.tagSide = kHMDefaultSide;
|
||||||
HMDisplayTag( &tag );
|
HMDisplayTag( &tag );
|
||||||
CFRelease( text ) ;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -446,6 +451,8 @@ void wxMacToolTip::Clear()
|
|||||||
return ;
|
return ;
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
HMHideTag() ;
|
HMHideTag() ;
|
||||||
|
if( m_helpTextRef )
|
||||||
|
CFRelease( m_helpTextRef )
|
||||||
#else
|
#else
|
||||||
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user