X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..9894cc01c98b0d6fa960d57e9a6155bbb07ed67b:/src/gtk/spinctrl.cpp diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 7ce9bb3807..f4c9e8d27c 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -5,7 +5,7 @@ // Modified by: // RCS-ID: $Id$ // Copyright: (c) Robert Roebling -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -22,9 +22,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 +44,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 +64,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 +86,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 +300,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