Move the hack for Cmd+C in wxOSX to a better place
"&Cancel" is an unfortunate label for wxID_CANCEL buttons on Macs,
because it makes Cmd+C a shortcut for the button, which in turn makes
any attempt to copy text from a text control instead abruptly close the
dialog.
There were partial hacks around it in some places made by 22bcdf0, but
it didn't even cover all uses within wx code itself, let alone user
code. Move the hack into wxButton to catch all uses of this and remove
the accelerator as the lesser evil.
This commit is contained in:
committed by
Václav Slavík
parent
3f2db1b027
commit
7a45b7948a
@@ -273,12 +273,7 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags )
|
||||
|
||||
if (flags & wxCANCEL)
|
||||
{
|
||||
// Avoid Cmd+C closing dialog on Mac.
|
||||
wxString cancelLabel(_("&Cancel"));
|
||||
#ifdef __WXMAC__
|
||||
cancelLabel.Replace("&",wxEmptyString);
|
||||
#endif
|
||||
wxButton *cancel = new wxButton(this, wxID_CANCEL, cancelLabel);
|
||||
wxButton *cancel = new wxButton(this, wxID_CANCEL);
|
||||
sizer->AddButton(cancel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user