]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/bmpbuttn.cpp
Fix for the undocumented holes in spiner sizes.
[wxWidgets.git] / src / gtk1 / bmpbuttn.cpp
index 55c431e1351c96e66f9a9c15d41d394caf81fc97..795f5c5eb924de6116c1a7dd602b9988bd3cee04 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
@@ -137,10 +137,7 @@ bool wxBitmapButton::Create( wxWindow *parent,
         return FALSE;
     }
 
-    m_bmpNormal   =
-    m_bmpDisabled =
-    m_bmpFocus    =
-    m_bmpSelected = bitmap;
+    m_bmpNormal = bitmap;
 
     m_widget = gtk_button_new();
 
@@ -193,18 +190,20 @@ wxString wxBitmapButton::GetLabel() const
     return wxControl::GetLabel();
 }
 
-void wxBitmapButton::ApplyWidgetStyle()
+void wxBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style)
 {
     if ( !BUTTON_CHILD(m_widget) )
         return;
 
-    wxButton::ApplyWidgetStyle();
+    wxButton::DoApplyWidgetStyle(style);
 }
 
 void wxBitmapButton::OnSetBitmap()
 {
     wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") );
 
+    InvalidateBestSize();
+    
     wxBitmap the_one;
     if (!m_isEnabled)
         the_one = m_bmpDisabled;
@@ -258,6 +257,7 @@ wxSize wxBitmapButton::DoGetBestSize() const
         best.x = m_bmpNormal.GetWidth()+border;
         best.y = m_bmpNormal.GetHeight()+border;
     }
+    CacheBestSize(best);
     return best;
 }