From: Stefan Csomor Date: Sun, 30 Jan 2011 19:01:37 +0000 (+0000) Subject: adding support for wxCANCEL_DEFAULT X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ec46fd5fce4fd1993c341d1b720db04b4521e22d adding support for wxCANCEL_DEFAULT git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index 042a302c08..0124d074b4 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -260,13 +260,25 @@ void* wxMessageDialog::ConstructNSAlert() // the MSW implementation even shows an OK button if it is not specified, we'll do the same else { - [alert addButtonWithTitle:cfOKString.AsNSString()]; - m_buttonId[ m_buttonCount++ ] = wxID_OK; - if (style & wxCANCEL) + if ( style & wxCANCEL_DEFAULT ) { [alert addButtonWithTitle:cfCancelString.AsNSString()]; m_buttonId[ m_buttonCount++ ] = wxID_CANCEL; + + [alert addButtonWithTitle:cfOKString.AsNSString()]; + m_buttonId[ m_buttonCount++ ] = wxID_OK; + } + else + { + [alert addButtonWithTitle:cfOKString.AsNSString()]; + m_buttonId[ m_buttonCount++ ] = wxID_OK; + if (style & wxCANCEL) + { + [alert addButtonWithTitle:cfCancelString.AsNSString()]; + m_buttonId[ m_buttonCount++ ] = wxID_CANCEL; + } } + } return alert; }