]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/button.cpp
fixed somebody's poorly done StreamSize-->GetSize transition
[wxWidgets.git] / src / msw / button.cpp
index daa665f297bdc0d881a1d545f60d4e278d615b94..307fad45d9478976eac17c093f3c9645958783ee 100644 (file)
@@ -31,6 +31,7 @@
     #include "wx/button.h"
     #include "wx/brush.h"
     #include "wx/panel.h"
+    #include "wx/bmpbuttn.h"
 #endif
 
 #include "wx/msw/private.h"
@@ -64,7 +65,7 @@ bool wxButton::Create(wxWindow *parent,
                       const wxValidator& validator,
                       const wxString& name)
 {
-    if ( !CreateBase(parent, id, pos, size, style, name) )
+    if ( !CreateBase(parent, id, pos, size, style, validator, name) )
         return FALSE;
 
     SetValidator(validator);
@@ -166,7 +167,9 @@ void wxButton::SetDefault()
         SendMessage(GetWinHwnd(parent), DM_SETDEFID, m_windowId, 0L);
     }
 
-    if ( btnOldDefault )
+    // this doesn't work with bitmap buttons because it also removes the
+    // "ownerdrawn" style...
+    if ( btnOldDefault && !wxDynamicCast(btnOldDefault, wxBitmapButton) )
     {
         // remove the BS_DEFPUSHBUTTON style from the other button
         long style = GetWindowLong(GetHwndOf(btnOldDefault), GWL_STYLE);