diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 5067471b11..f9fff28ce6 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -275,7 +275,12 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) if (flags & wxCANCEL) { - wxButton *cancel = new wxButton(this, wxID_CANCEL); + // Avoid Cmd+C closing dialog on Mac. + wxString cancelLabel(_("&Cancel")); +#ifdef __WXMAC__ + cancelLabel.Replace("&",wxEmptyString); +#endif + wxButton *cancel = new wxButton(this, wxID_CANCEL, cancelLabel); sizer->AddButton(cancel); } diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index d877d14cf8..cb508e83d4 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -430,7 +430,12 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) #endif m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); - wxButton *btnCancel=new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, buttonStyle); + // Avoid Cmd+C closing dialog on Mac. + wxString cancelLabel(_("&Cancel")); +#ifdef __WXMAC__ + cancelLabel.Replace("&",wxEmptyString); +#endif + wxButton *btnCancel=new wxButton(this, wxID_CANCEL, cancelLabel, wxDefaultPosition, wxDefaultSize, buttonStyle); #ifndef __WXMAC__ if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle);