X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7205570233ce8420b71fa5df368054c8953ff0e4..88594d02eb59a55ac85d3210a49d02918124617b:/src/mac/carbon/button.cpp diff --git a/src/mac/carbon/button.cpp b/src/mac/carbon/button.cpp index 19600ac5d7..83cdba79e0 100644 --- a/src/mac/carbon/button.cpp +++ b/src/mac/carbon/button.cpp @@ -50,12 +50,11 @@ void wxButton::SetDefault() { wxWindow *parent = GetParent(); wxButton *btnOldDefault = NULL; - wxPanel *panel = wxDynamicCast(parent, wxPanel); - if ( panel ) + if ( parent ) { - btnOldDefault = wxDynamicCast(panel->GetDefaultItem(), + btnOldDefault = wxDynamicCast(parent->GetDefaultItem(), wxButton); - panel->SetDefaultItem(this); + parent->SetDefaultItem(this); } Boolean inData; @@ -108,8 +107,11 @@ void wxButton::Command (wxCommandEvent & event) void wxButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart ) { + if ( controlpart != kControlNoPart ) + { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId ); event.SetEventObject(this); ProcessCommand(event); + } }