X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/510fc784c0c7002488bcaad881901176554f7c32..fe51e08c278f1fa429b9f02843c771c7a9bb7e0c:/src/gtk1/spinbutt.cpp diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index 38f4d4c28a..4ac29c9c25 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -8,21 +8,23 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#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" + #include "wx/spinbutt.h" -#ifdef wxUSE_SPINBTN +#if wxUSE_SPINBTN #include "wx/utils.h" #include -#include -#include +#include "wx/gtk/private.h" //----------------------------------------------------------------------------- // idle system @@ -104,7 +106,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxSpinButton,wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent); +IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) BEGIN_EVENT_TABLE(wxSpinButton, wxControl) EVT_SIZE(wxSpinButton::OnSize) @@ -148,11 +150,7 @@ bool wxSpinButton::Create(wxWindow *parent, m_parent->DoAddChild( this ); - PostCreation(); - - SetBackgroundColour( parent->GetBackgroundColour() ); - - Show( TRUE ); + PostCreation(new_size); return TRUE; } @@ -227,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