1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        src/qt/tooltip.cpp
3 // Author:      Peter Most
4 // Copyright:   (c) Peter Most
5 // Licence:     wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
7 
8 // For compilers that support precompilation, includes "wx.h".
9 #include "wx/wxprec.h"
10 
11 
12 #ifndef WX_PRECOMP
13     #include "wx/window.h"
14 #endif // WX_PRECOMP
15 
16 #include "wx/tooltip.h"
17 #include "wx/qt/private/utils.h"
18 
Enable(bool WXUNUSED (flag))19 /* static */ void wxToolTip::Enable(bool WXUNUSED(flag))
20 {
21     wxMISSING_FUNCTION();
22 }
23 
SetDelay(long WXUNUSED (milliseconds))24 /* static */ void wxToolTip::SetDelay(long WXUNUSED(milliseconds))
25 {
26     wxMISSING_FUNCTION();
27 }
28 
SetAutoPop(long WXUNUSED (milliseconds))29 /* static */ void wxToolTip::SetAutoPop(long WXUNUSED(milliseconds))
30 {
31     wxMISSING_FUNCTION();
32 }
33 
SetReshow(long WXUNUSED (milliseconds))34 /* static */ void wxToolTip::SetReshow(long WXUNUSED(milliseconds))
35 {
36     wxMISSING_FUNCTION();
37 }
38 
39 
40 
wxToolTip(const wxString & tip)41 wxToolTip::wxToolTip(const wxString &tip)
42 {
43     m_window = NULL;
44     SetTip(tip);
45 }
46 
SetTip(const wxString & tip)47 void wxToolTip::SetTip(const wxString& tip)
48 {
49     m_text = tip;
50 
51     if ( m_window )
52         m_window->QtApplyToolTip(m_text);
53 }
54 
GetTip() const55 const wxString &wxToolTip::GetTip() const
56 {
57     return m_text;
58 }
59 
60 
SetWindow(wxWindow * win)61 void wxToolTip::SetWindow(wxWindow *win)
62 {
63     wxCHECK_RET(win != NULL, "window should not be NULL");
64     m_window = win;
65     m_window->QtApplyToolTip(m_text);
66 }
67