1/////////////////////////////////////////////////////////////////////////////
2// Name:        src/osx/cocoa/tooltip.mm
3// Purpose:     wxToolTip implementation
4// Author:      Stefan Csomor
5// Copyright:   (c) Stefan Csomor
6// Licence:     wxWindows licence
7/////////////////////////////////////////////////////////////////////////////
8
9#include "wx/wxprec.h"
10
11#if wxUSE_TOOLTIPS
12
13#include "wx/tooltip.h"
14
15#ifndef WX_PRECOMP
16    #include "wx/app.h"
17    #include "wx/window.h"
18    #include "wx/dc.h"
19    #include "wx/timer.h"
20    #include "wx/nonownedwnd.h"
21#endif // WX_PRECOMP
22
23#include "wx/geometry.h"
24#include "wx/osx/uma.h"
25
26#if wxOSX_USE_COCOA_OR_CARBON
27    #include <AppKit/AppKit.h>
28#endif
29
30// FYI a link to help with implementing: http://www.cocoadev.com/index.pl?LittleYellowBox
31
32
33//-----------------------------------------------------------------------------
34// wxToolTip
35//-----------------------------------------------------------------------------
36
37wxIMPLEMENT_ABSTRACT_CLASS(wxToolTip, wxObject);
38
39
40wxToolTip::wxToolTip( const wxString &tip )
41{
42    m_text = tip;
43    m_window = NULL;
44}
45
46wxToolTip::~wxToolTip()
47{
48}
49
50void wxToolTip::SetTip( const wxString &tip )
51{
52    m_text = tip;
53    if (m_window)
54        m_window->SetToolTip(this);
55}
56
57void wxToolTip::SetWindow( wxWindow *win )
58{
59    m_window = win ;
60}
61
62void wxToolTip::Enable( bool WXUNUSED(flag) )
63{
64}
65
66void wxToolTip::SetDelay( long msecs )
67{
68#if wxOSX_USE_COCOA_OR_CARBON
69    [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: msecs]
70                                              forKey: @"NSInitialToolTipDelay"];
71#endif
72}
73
74void wxToolTip::SetAutoPop( long WXUNUSED(msecs) )
75{
76}
77
78void wxToolTip::SetReshow( long WXUNUSED(msecs) )
79{
80}
81
82void wxToolTip::RelayEvent( wxWindow *WXUNUSED(win) , wxMouseEvent &WXUNUSED(event) )
83{
84}
85
86void wxToolTip::RemoveToolTips()
87{
88}
89
90// --- mac specific
91void wxToolTip::NotifyWindowDelete( WXHWND WXUNUSED(win) )
92{
93}
94
95#endif // wxUSE_TOOLTIPS
96