]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/gtk1/tooltip.cpp
removed unneeded (and provoking warnings in DLL build) DLL export declarations
[wxWidgets.git] / src / gtk1 / tooltip.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/gtk1/tooltip.cpp
3// Purpose: wxToolTip implementation
4// Author: Robert Roebling
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10// For compilers that support precompilation, includes "wx.h".
11#include "wx/wxprec.h"
12
13#if wxUSE_TOOLTIPS
14
15#include "wx/tooltip.h"
16#include "wx/window.h"
17
18#include "wx/gtk1/private.h"
19
20//-----------------------------------------------------------------------------
21// global data
22//-----------------------------------------------------------------------------
23
24static GtkTooltips *ss_tooltips = (GtkTooltips*) NULL;
25
26//-----------------------------------------------------------------------------
27// wxToolTip
28//-----------------------------------------------------------------------------
29
30IMPLEMENT_ABSTRACT_CLASS(wxToolTip, wxObject)
31
32wxToolTip::wxToolTip( const wxString &tip )
33{
34 m_text = tip;
35 m_window = (wxWindow*) NULL;
36}
37
38void wxToolTip::SetTip( const wxString &tip )
39{
40 m_text = tip;
41 Apply( m_window );
42}
43
44void wxToolTip::Apply( wxWindow *win )
45{
46 if (!win) return;
47
48 if (!ss_tooltips)
49 {
50 ss_tooltips = gtk_tooltips_new();
51 }
52
53 m_window = win;
54
55 if (m_text.IsEmpty())
56 m_window->ApplyToolTip( ss_tooltips, (wxChar*) NULL );
57 else
58 m_window->ApplyToolTip( ss_tooltips, m_text );
59}
60
61void wxToolTip::Enable( bool flag )
62{
63 if (!ss_tooltips) return;
64
65 if (flag)
66 gtk_tooltips_enable( ss_tooltips );
67 else
68 gtk_tooltips_disable( ss_tooltips );
69}
70
71void wxToolTip::SetDelay( long msecs )
72{
73 if (!ss_tooltips)
74 return;
75
76 gtk_tooltips_set_delay( ss_tooltips, (int)msecs );
77}
78
79#endif