X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/463c4d7193481ac27626b282ccf0ac178f029abd..c00fed0ef4d70c9b45d9b8405f636d30eadb7ea6:/src/gtk1/spinbutt.cpp?ds=sidebyside diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index c11142163f..0af1e68f5d 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -8,11 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "spinbutt.h" - #pragma implementation "spinbutbase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -22,7 +17,7 @@ #include "wx/utils.h" #include "wx/math.h" -#include "wx/gtk/private.h" +#include "wx/gtk1/private.h" //----------------------------------------------------------------------------- // idle system @@ -43,6 +38,7 @@ static const float sensitivity = 0.02; // "value_changed" //----------------------------------------------------------------------------- +extern "C" { static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -72,22 +68,22 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi { /* program has vetoed */ win->m_adjust->value = win->m_oldPos; - + gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust), - (GtkSignalFunc) gtk_spinbutt_callback, - (gpointer) win ); - + (GtkSignalFunc) gtk_spinbutt_callback, + (gpointer) win ); + gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" ); gtk_signal_connect( GTK_OBJECT (win->m_adjust), - "value_changed", - (GtkSignalFunc) gtk_spinbutt_callback, - (gpointer) win ); + "value_changed", + (GtkSignalFunc) gtk_spinbutt_callback, + (gpointer) win ); return; } - + win->m_oldPos = win->m_adjust->value; - + /* always send a thumbtrack event */ if (command != wxEVT_SCROLL_THUMBTRACK) { @@ -98,6 +94,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi win->GetEventHandler()->ProcessEvent( event2 ); } } +} //----------------------------------------------------------------------------- // wxSpinButton @@ -129,7 +126,7 @@ bool wxSpinButton::Create(wxWindow *parent, !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name )) { wxFAIL_MSG( wxT("wxXX creation failed") ); - return FALSE; + return FALSE; } m_oldPos = 0.0; @@ -204,7 +201,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) m_adjust->upper = fmax; gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); - + // these two calls are required due to some bug in GTK Refresh(); SetFocus();