X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d1d2d465d9a6ce219df35fd97c02a37aba40d03..2356708db31b737c6eae53c2316b642aa5a2e68d:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index daa665f297..307fad45d9 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -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);