]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/msgdlg.mm
Added ability to switch off more components of the size page UI
[wxWidgets.git] / src / cocoa / msgdlg.mm
index fce905f6ba4d9b5b38590d6ea234126d6bf550dd..0d6072a226f83235d412ba51577a3c029c6e5825 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
+#include "wx/testing.h"
 
 #import <AppKit/NSAlert.h>
 // ============================================================================
@@ -63,7 +64,7 @@ wxCocoaMessageDialog::wxCocoaMessageDialog(wxWindow *parent,
     m_cocoaNSView = nil;
 }
 
-void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const wxString& value)
+void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& value)
 {
     wxMessageDialogWithCustomLabels::DoSetCustomLabel(var, value);
 
@@ -72,6 +73,8 @@ void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const wxString& value
 
 int wxCocoaMessageDialog::ShowModal()
 {
+    WX_TESTING_SHOW_MODAL_HOOK();
+
     wxAutoNSAutoreleasePool thePool;
 
     NSAlert *alert = [[[NSAlert alloc] init] autorelease];
@@ -79,14 +82,17 @@ int wxCocoaMessageDialog::ShowModal()
     const long style = GetMessageDialogStyle();
 
     NSAlertStyle nsStyle = NSInformationalAlertStyle;
-    if (style & wxICON_EXCLAMATION)
-        nsStyle = NSWarningAlertStyle;
-    else if (style & wxICON_HAND)
-        nsStyle = NSCriticalAlertStyle;
-    else if (style & wxICON_INFORMATION)
-        nsStyle = NSInformationalAlertStyle;
-    else if (style & wxICON_QUESTION)
-        nsStyle = NSInformationalAlertStyle;
+
+    switch ( GetEffectiveIcon() )
+    {
+        case wxICON_ERROR:
+            nsStyle = NSCriticalAlertStyle;
+            break;
+
+        case wxICON_WARNING:
+            nsStyle = NSWarningAlertStyle;
+            break;
+    }
 
     [alert setAlertStyle:nsStyle];