X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/354aa1e366a57d896e2cf0943c687b24e8db688c..4c460b340f3f32621e83e6efd2f25c43005d60b0:/src/gtk1/spinctrl.cpp diff --git a/src/gtk1/spinctrl.cpp b/src/gtk1/spinctrl.cpp index 7f04c11479..6411633ad3 100644 --- a/src/gtk1/spinctrl.cpp +++ b/src/gtk1/spinctrl.cpp @@ -14,14 +14,15 @@ #include "wx/spinctrl.h" -#ifdef wxUSE_SPINBTN +#if wxUSE_SPINCTRL #include "wx/utils.h" #include "wx/spinbutt.h" + #include -#include "gdk/gdk.h" -#include "gtk/gtk.h" +#include +#include //----------------------------------------------------------------------------- // idle system @@ -67,7 +68,7 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win event.SetPosition( value ); event.SetEventObject( win ); win->GetEventHandler()->ProcessEvent( event ); - + /* always send a thumbtrack event */ if (command != wxEVT_SCROLL_THUMBTRACK) { @@ -116,7 +117,8 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_spin_button_new( m_adjust, 1, 0 ); - gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), (m_windowStyle & wxSP_WRAP) ); + gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget), + (int)(m_windowStyle & wxSP_WRAP) ); gtk_signal_connect( GTK_OBJECT (m_adjust), "value_changed", @@ -204,7 +206,7 @@ void wxSpinCtrl::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(); @@ -220,7 +222,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event ) while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) top_frame = top_frame->GetParent(); GtkWindow *window = GTK_WINDOW(top_frame->m_widget); - + if (window->default_widget) { gtk_widget_activate (window->default_widget); @@ -243,3 +245,4 @@ void wxSpinCtrl::ApplyWidgetStyle() } #endif + // wxUSE_SPINCTRL