]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/bmpbuttn.cpp
wxRichTextCtrl::ApplyStyle now applies a paragraph style at the cursor
[wxWidgets.git] / src / msw / bmpbuttn.cpp
index 2e2072d0a2dff4632a6a3b4966d260127360a20c..217b1aec6393490e1b79ef23a1991729d54cc579 100644 (file)
@@ -127,17 +127,22 @@ bool wxBitmapButton::Create(wxWindow *parent,
                             const wxBitmap& bitmap,
                             const wxPoint& pos,
                             const wxSize& size, long style,
-                            const wxValidator& wxVALIDATOR_PARAM(validator),
+                            const wxValidator& validator,
                             const wxString& name)
 {
-    if ( !wxBitmapButtonBase::Create(parent, id, "",
-                                     pos, size,
-                                     style | wxBU_NOTEXT,
+    if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style,
                                      validator, name) )
         return false;
 
     SetBitmapLabel(bitmap);
 
+    if ( !size.IsFullySpecified() )
+    {
+        // As our bitmap has just changed, our best size has changed as well so
+        // reset the initial size using the new value.
+        SetInitialSize(size);
+    }
+
     return true;
 }
 
@@ -180,6 +185,11 @@ void wxBitmapButton::DoSetBitmap(const wxBitmap& bitmap, State which)
                 // from the normal one
                 m_disabledSetByUser = true;
                 break;
+
+            default:
+                // nothing special to do but include the default clause to
+                // suppress gcc warnings
+                ;
         }
     }