X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..81f6ea4a29eb815dbed0adea369efdc8fece0269:/src/gtk/spinctrl.cpp diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 80d5007a43..91d83bb213 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -8,10 +8,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "spinctrl.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -22,9 +18,7 @@ #include "wx/utils.h" #include "wx/textctrl.h" // for wxEVT_COMMAND_TEXT_UPDATED - -#include - +#include "wx/math.h" #include "wx/gtk/private.h" //----------------------------------------------------------------------------- @@ -46,6 +40,7 @@ extern bool g_blockEventsOnDrag; // "value_changed" //----------------------------------------------------------------------------- +extern "C" { static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -65,11 +60,13 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win event.SetInt( (int)ceil(win->m_adjust->value) ); win->GetEventHandler()->ProcessEvent( event ); } +} //----------------------------------------------------------------------------- // "changed" //----------------------------------------------------------------------------- +extern "C" { static void gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win ) { @@ -85,6 +82,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win event.SetInt( (int)ceil(win->m_adjust->value) ); win->GetEventHandler()->ProcessEvent( event ); } +} //----------------------------------------------------------------------------- // wxSpinCtrl @@ -298,16 +296,12 @@ bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window ) return FALSE; } -void wxSpinCtrl::ApplyWidgetStyle() -{ - SetWidgetStyle(); - gtk_widget_set_style( m_widget, m_widgetStyle ); -} - wxSize wxSpinCtrl::DoGetBestSize() const { wxSize ret( wxControl::DoGetBestSize() ); - return wxSize(95, ret.y); + wxSize best(95, ret.y); + CacheBestSize(best); + return best; } // static