adding support for wxCANCEL_DEFAULT

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2011-01-30 19:01:37 +00:00
parent 85ecb1d5ca
commit ec46fd5fce

View File

@ -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;
}