OSX native tooltips
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -222,21 +222,35 @@ void wxMacToolTip::Draw()
|
|||||||
|
|
||||||
if ( m_window == s_ToolTipWindowRef )
|
if ( m_window == s_ToolTipWindowRef )
|
||||||
{
|
{
|
||||||
|
m_shown = true ;
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
/*
|
|
||||||
if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
|
if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
|
||||||
{
|
{
|
||||||
HMDisplayTag(
|
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 );
|
||||||
|
CFStringRef text = wxMacCreateCFString(m_label) ;
|
||||||
|
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
||||||
|
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
||||||
|
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
||||||
|
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
||||||
|
tag.tagSide = kHMDefaultSide;
|
||||||
|
HMDisplayTag( &tag );
|
||||||
|
CFRelease( text ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
|
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
||||||
#endif
|
#endif
|
||||||
m_shown = true ;
|
|
||||||
|
|
||||||
FontFamilyID fontId ;
|
FontFamilyID fontId ;
|
||||||
Str255 fontName ;
|
Str255 fontName ;
|
||||||
@@ -430,7 +444,9 @@ void wxMacToolTip::Clear()
|
|||||||
}
|
}
|
||||||
if ( !m_shown )
|
if ( !m_shown )
|
||||||
return ;
|
return ;
|
||||||
|
#if TARGET_CARBON
|
||||||
|
HMHideTag() ;
|
||||||
|
#else
|
||||||
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
||||||
{
|
{
|
||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ;
|
wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ;
|
||||||
@@ -443,6 +459,7 @@ void wxMacToolTip::Clear()
|
|||||||
KillPicture(m_backpict);
|
KillPicture(m_backpict);
|
||||||
m_backpict = NULL ;
|
m_backpict = NULL ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -222,21 +222,35 @@ void wxMacToolTip::Draw()
|
|||||||
|
|
||||||
if ( m_window == s_ToolTipWindowRef )
|
if ( m_window == s_ToolTipWindowRef )
|
||||||
{
|
{
|
||||||
|
m_shown = true ;
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
/*
|
|
||||||
if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
|
if ( HMDisplayTag != (void*) kUnresolvedCFragSymbolAddress )
|
||||||
{
|
{
|
||||||
HMDisplayTag(
|
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 );
|
||||||
|
CFStringRef text = wxMacCreateCFString(m_label) ;
|
||||||
|
tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
|
||||||
|
tag.content[kHMMinimumContentIndex].u.tagCFString = text ;
|
||||||
|
tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ;
|
||||||
|
tag.content[kHMMaximumContentIndex].u.tagCFString = text ;
|
||||||
|
tag.tagSide = kHMDefaultSide;
|
||||||
|
HMDisplayTag( &tag );
|
||||||
|
CFRelease( text ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*/
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
|
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( m_window ) );
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
|
||||||
#endif
|
#endif
|
||||||
m_shown = true ;
|
|
||||||
|
|
||||||
FontFamilyID fontId ;
|
FontFamilyID fontId ;
|
||||||
Str255 fontName ;
|
Str255 fontName ;
|
||||||
@@ -430,7 +444,9 @@ void wxMacToolTip::Clear()
|
|||||||
}
|
}
|
||||||
if ( !m_shown )
|
if ( !m_shown )
|
||||||
return ;
|
return ;
|
||||||
|
#if TARGET_CARBON
|
||||||
|
HMHideTag() ;
|
||||||
|
#else
|
||||||
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
if ( m_window == s_ToolTipWindowRef && m_backpict )
|
||||||
{
|
{
|
||||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ;
|
wxMacPortStateHelper help( (GrafPtr) GetWindowPort(m_window) ) ;
|
||||||
@@ -443,6 +459,7 @@ void wxMacToolTip::Clear()
|
|||||||
KillPicture(m_backpict);
|
KillPicture(m_backpict);
|
||||||
m_backpict = NULL ;
|
m_backpict = NULL ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user