// 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:
wxMacToolTip* m_tip;
long m_mark ;
};
+#endif // wxUSE_TIMER
//-----------------------------------------------------------------------------
// wxToolTip
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 )
}
// --- 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 ;
}
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() ;
}
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 ;
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