From ec46fd5fce4fd1993c341d1b720db04b4521e22d Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 30 Jan 2011 19:01:37 +0000 Subject: [PATCH] adding support for wxCANCEL_DEFAULT git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/msgdlg.mm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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; } -- 2.45.2