--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: tooltip.h
+// Purpose:
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __GTKTOOLTIPH__
+#define __GTKTOOLTIPH__
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/window.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxToolTip;
+
+//-----------------------------------------------------------------------------
+// wxToolTip
+//-----------------------------------------------------------------------------
+
+class wxToolTip: public wxObject
+{
+public:
+
+ wxToolTip() {}
+
+ static void Add( wxWindow *tool, const wxString &tip );
+ static void Enable( bool flag );
+ static void SetDelay( long msecs );
+
+
+};
+
+#endif // __GTKTOOLTIPH__
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: tooltip.h
+// Purpose:
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __GTKTOOLTIPH__
+#define __GTKTOOLTIPH__
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/window.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxToolTip;
+
+//-----------------------------------------------------------------------------
+// wxToolTip
+//-----------------------------------------------------------------------------
+
+class wxToolTip: public wxObject
+{
+public:
+
+ wxToolTip() {}
+
+ static void Add( wxWindow *tool, const wxString &tip );
+ static void Enable( bool flag );
+ static void SetDelay( long msecs );
+
+
+};
+
+#endif // __GTKTOOLTIPH__
--- /dev/null
+#ifndef _WX_TOOLTIP_H_BASE_
+#define _WX_TOOLTIP_H_BASE_
+
+#if defined(__WXMSW__)
+#include "wx/msw/tooltip.h"
+#elif defined(__WXMOTIF__)
+#include "wx/motif/tooltip.h"
+#elif defined(__WXGTK__)
+#include "wx/gtk/tooltip.h"
+#elif defined(__WXQT__)
+#include "wx/qt/tooltip.h"
+#elif defined(__WXMAC__)
+#include "wx/mac/tooltip.h"
+#elif defined(__WXSTUBS__)
+#include "wx/stubs/tooltip.h"
+#endif
+
+#endif
+ // _WX_TOOLTIP_H_BASE_
#include "wx/imaglist.h"
#include "wx/spinbutt.h"
#include "wx/clipbrd.h"
+#include "wx/tooltip.h"
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#define USE_XPM
(void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
+ wxToolTip::Add( button, "Press here to set italic font" );
// button->SetForegroundColour( "red" );
m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, "Disable", wxPoint(20,130), wxSize(140,30) );
m_checkbox->SetValue(FALSE);
gtk/tbargtk.cpp \
gtk/textctrl.cpp \
gtk/timer.cpp \
+ gtk/tooltip.cpp \
gtk/utilsgtk.cpp \
gtk/utilsres.cpp \
gtk/window.cpp \
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: tooltip.cpp
+// Purpose:
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "tooltip.h"
+#endif
+
+#include "wx/tooltip.h"
+
+#include "gtk/gtk.h"
+#include "gdk/gdk.h"
+
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+GtkTooltips *gs_tooltips = (GtkTooltips*) NULL;
+GdkColor gs_tooltip_bg;
+GdkColor gs_tooltip_fg;
+
+//-----------------------------------------------------------------------------
+// wxToolTip
+//-----------------------------------------------------------------------------
+
+void wxToolTip::Add( wxWindow *tool, const wxString &tip )
+{
+ if (!gs_tooltips)
+ {
+ gs_tooltips = gtk_tooltips_new();
+
+ gs_tooltip_fg.red = 0;
+ gs_tooltip_fg.green = 0;
+ gs_tooltip_fg.blue = 0;
+ gdk_color_alloc( gtk_widget_get_colormap( tool->GetConnectWidget() ), &gs_tooltip_fg );
+
+ gs_tooltip_bg.red = 65535;
+ gs_tooltip_bg.green = 65535;
+ gs_tooltip_bg.blue = 50000;
+ gdk_color_alloc( gtk_widget_get_colormap( tool->GetConnectWidget() ), &gs_tooltip_bg );
+
+ gtk_tooltips_set_colors( gs_tooltips, &gs_tooltip_bg, &gs_tooltip_fg );
+ }
+
+ gtk_tooltips_set_tip( gs_tooltips, tool->GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+void wxToolTip::Enable( bool flag )
+{
+ if (!gs_tooltips) gs_tooltips = gtk_tooltips_new();
+
+ if (flag)
+ gtk_tooltips_enable( gs_tooltips );
+ else
+ gtk_tooltips_disable( gs_tooltips );
+}
+
+void wxToolTip::SetDelay( long msecs )
+{
+ if (!gs_tooltips) gs_tooltips = gtk_tooltips_new();
+
+ gtk_tooltips_set_delay( gs_tooltips, msecs );
+}
+
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: tooltip.cpp
+// Purpose:
+// Author: Robert Roebling
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "tooltip.h"
+#endif
+
+#include "wx/tooltip.h"
+
+#include "gtk/gtk.h"
+#include "gdk/gdk.h"
+
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+GtkTooltips *gs_tooltips = (GtkTooltips*) NULL;
+GdkColor gs_tooltip_bg;
+GdkColor gs_tooltip_fg;
+
+//-----------------------------------------------------------------------------
+// wxToolTip
+//-----------------------------------------------------------------------------
+
+void wxToolTip::Add( wxWindow *tool, const wxString &tip )
+{
+ if (!gs_tooltips)
+ {
+ gs_tooltips = gtk_tooltips_new();
+
+ gs_tooltip_fg.red = 0;
+ gs_tooltip_fg.green = 0;
+ gs_tooltip_fg.blue = 0;
+ gdk_color_alloc( gtk_widget_get_colormap( tool->GetConnectWidget() ), &gs_tooltip_fg );
+
+ gs_tooltip_bg.red = 65535;
+ gs_tooltip_bg.green = 65535;
+ gs_tooltip_bg.blue = 50000;
+ gdk_color_alloc( gtk_widget_get_colormap( tool->GetConnectWidget() ), &gs_tooltip_bg );
+
+ gtk_tooltips_set_colors( gs_tooltips, &gs_tooltip_bg, &gs_tooltip_fg );
+ }
+
+ gtk_tooltips_set_tip( gs_tooltips, tool->GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+void wxToolTip::Enable( bool flag )
+{
+ if (!gs_tooltips) gs_tooltips = gtk_tooltips_new();
+
+ if (flag)
+ gtk_tooltips_enable( gs_tooltips );
+ else
+ gtk_tooltips_disable( gs_tooltips );
+}
+
+void wxToolTip::SetDelay( long msecs )
+{
+ if (!gs_tooltips) gs_tooltips = gtk_tooltips_new();
+
+ gtk_tooltips_set_delay( gs_tooltips, msecs );
+}
+