X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abdeb9e7006488bf917d90048fcd0cbe22f44a71..edea62818b7808c11e2c536b52941809f338f2fb:/src/gtk1/spinbutt.cpp diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index f0db6cb58b..77416c0a63 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -21,9 +21,7 @@ #if wxUSE_SPINBTN #include "wx/utils.h" - -#include - +#include "wx/math.h" #include "wx/gtk/private.h" //----------------------------------------------------------------------------- @@ -45,6 +43,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(); @@ -100,6 +99,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi win->GetEventHandler()->ProcessEvent( event2 ); } } +} //----------------------------------------------------------------------------- // wxSpinButton @@ -225,15 +225,20 @@ bool wxSpinButton::IsOwnGtkWindow( GdkWindow *window ) return GTK_SPIN_BUTTON(m_widget)->panel == window; } -void wxSpinButton::ApplyWidgetStyle() +wxSize wxSpinButton::DoGetBestSize() const { - SetWidgetStyle(); - gtk_widget_set_style( m_widget, m_widgetStyle ); + wxSize best(15, 26); // FIXME + CacheBestSize(best); + return best; } -wxSize wxSpinButton::DoGetBestSize() const +// static +wxVisualAttributes +wxSpinButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { - return wxSize(15, 26); + // TODO: overload to accept functions like gtk_spin_button_new? + // Until then use a similar type + return GetDefaultAttributesFromGTKWidget(gtk_button_new); } #endif