]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/spinbutt.cpp
Fixes and source cleaning for WinCE.
[wxWidgets.git] / src / gtk / spinbutt.cpp
index 26886024737c550f31b9876122c2318ddab6f1a1..4ac29c9c25293162939e072286cef309c8dc3e65 100644 (file)
@@ -8,11 +8,14 @@
 // 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"
 
 #if wxUSE_SPINBTN
@@ -147,11 +150,7 @@ bool wxSpinButton::Create(wxWindow *parent,
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-
-    SetBackgroundColour( parent->GetBackgroundColour() );
-
-    Show( TRUE );
+    PostCreation(new_size);
 
     return TRUE;
 }
@@ -226,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