]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/msgdlg.mm
making conversion explicit silences deprecation warning
[wxWidgets.git] / src / osx / cocoa / msgdlg.mm
index 830d855ccc0c3e1fe77022ba552954fe482df520..0124d074b49bd11987a586ca87a88446f46501a5 100644 (file)
@@ -47,7 +47,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
                                  const wxString& caption,
                                  long style,
                                  const wxPoint& WXUNUSED(pos))
-               : wxMessageDialogWithCustomLabels(parent, message, caption, style)
+               : wxMessageDialogBase(parent, message, caption, style)
 {
 }
 
@@ -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;
 }