X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb743cab53102c1d2d636acd173112233835f3f7..6cef0db28018fd2644ee4e38af715872e5242459:/src/mac/carbon/tooltip.cpp diff --git a/src/mac/carbon/tooltip.cpp b/src/mac/carbon/tooltip.cpp index 365edd5b60..957feb0491 100644 --- a/src/mac/carbon/tooltip.cpp +++ b/src/mac/carbon/tooltip.cpp @@ -27,39 +27,7 @@ // global data //----------------------------------------------------------------------------- -class wxMacToolTipTimer ; - -class wxMacToolTip -{ -public : - wxMacToolTip() ; - ~wxMacToolTip() ; - - void Setup( WindowRef window , const wxString& text , const wxPoint& localPosition ) ; - void Draw() ; - void Clear() ; - - long GetMark() - { return m_mark ; } - - bool IsShown() - { return m_shown ; } - -private : - wxString m_label ; - wxPoint m_position ; - Rect m_rect ; - WindowRef m_window ; - PicHandle m_backpict ; - bool m_shown ; - long m_mark ; - wxMacToolTipTimer* m_timer ; - -#if TARGET_CARBON - wxMacCFStringHolder m_helpTextRef ; -#endif -} ; - +#if wxUSE_TIMER class wxMacToolTipTimer : public wxTimer { public: @@ -77,6 +45,7 @@ protected: wxMacToolTip* m_tip; long m_mark ; }; +#endif // wxUSE_TIMER //----------------------------------------------------------------------------- // wxToolTip @@ -143,6 +112,14 @@ void wxToolTip::SetDelay( long msecs ) s_ToolTipDelay = msecs ; } +void wxToolTip::SetAutoPop( long WXUNUSED(msecs) ) +{ +} + +void wxToolTip::SetReshow( long WXUNUSED(msecs) ) +{ +} + void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event ) { if ( s_ShowToolTips ) @@ -181,19 +158,22 @@ void wxToolTip::RemoveToolTips() } // --- mac specific - +#if wxUSE_TIMER wxMacToolTipTimer::wxMacToolTipTimer( wxMacToolTip *tip , int msec ) { m_tip = tip; m_mark = tip->GetMark() ; Start(msec, true); } +#endif // wxUSE_TIMER wxMacToolTip::wxMacToolTip() { m_window = NULL ; m_backpict = NULL ; +#if wxUSE_TIMER m_timer = NULL ; +#endif m_mark = 0 ; m_shown = false ; } @@ -208,21 +188,23 @@ void wxMacToolTip::Setup( WindowRef win , const wxString& text , const wxPoint& m_window =win; s_ToolTipWindowRef = m_window ; m_backpict = NULL ; - +#if wxUSE_TIMER if ( m_timer ) delete m_timer ; m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ; +#endif // wxUSE_TIMER } wxMacToolTip::~wxMacToolTip() { +#if wxUSE_TIMER if ( m_timer ) { delete m_timer ; m_timer = NULL; } - +#endif // wxUSE_TIMER if ( m_backpict ) Clear() ; } @@ -246,7 +228,7 @@ void wxMacToolTip::Draw() wxMacLocalToGlobal( m_window , &p ) ; SetRect( &tag.absHotRect , p.h - 2 , p.v - 2 , p.h + 2 , p.v + 2 ); - m_helpTextRef.Assign( m_label , wxFONTENCODING_DEFAULT ) ; + m_helpTextRef = wxCFStringRef( m_label , wxFONTENCODING_DEFAULT ) ; tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ; tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ; tag.content[kHMMaximumContentIndex].contentType = kHMCFStringContent ; @@ -265,18 +247,17 @@ void wxToolTip::NotifyWindowDelete( WXHWND win ) void wxMacToolTip::Clear() { m_mark++ ; - +#if wxUSE_TIMER if ( m_timer ) { delete m_timer ; m_timer = NULL ; } - +#endif // wxUSE_TIMER if ( !m_shown ) return ; HMHideTag() ; - m_helpTextRef.Release() ; } #endif // wxUSE_TOOLTIPS