Don't use Cmd+C accelerator in dilogs on Mac by default.

This commit is contained in:
JulianSmart
2016-07-17 18:17:13 +01:00
parent 42b440487d
commit 22bcdf020e
2 changed files with 12 additions and 2 deletions

View File

@@ -275,7 +275,12 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags )
if (flags & wxCANCEL) 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); sizer->AddButton(cancel);
} }

View File

@@ -430,7 +430,12 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn)
#endif #endif
m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); 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__ #ifndef __WXMAC__
if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON)
btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle); btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle);