]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/bmpbuttn.cpp
Remove apparently erroneous -1 from DrawBitmap() in wxMSW wxGC code.
[wxWidgets.git] / src / gtk / bmpbuttn.cpp
index 5dcd0493942af50f0dba0dd31c24283343537108..55ca28b5c2ed658a095622477b37fe544f76ed64 100644 (file)
 
 #include "wx/bmpbuttn.h"
 
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
+bool wxBitmapButton::Create(wxWindow *parent,
+                            wxWindowID id,
+                            const wxBitmap& bitmap,
+                            const wxPoint& pos,
+                            const wxSize& size,
+                            long style,
+                            const wxValidator& validator,
+                            const wxString& name)
+{
+    if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style,
+                                     validator, name) )
+        return false;
 
+    if ( bitmap.IsOk() )
+    {
+        SetBitmapLabel(bitmap);
+
+        // we need to adjust the size after setting the bitmap as it may be too
+        // big for the default button size
+        SetInitialSize(size);
+    }
+
+    return true;
+}
 #endif // wxUSE_BMPBUTTON