]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/msgdlg.mm
fixing searchctrl on osx_cocoa, changing type for peer to wxSearchCtrl
[wxWidgets.git] / src / osx / cocoa / msgdlg.mm
index 042a302c0805dd89b45740a02d73dbaa78fdde2b..0124d074b49bd11987a586ca87a88446f46501a5 100644 (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;
 }