#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
+#include "wx/testing.h"
#import <AppKit/NSAlert.h>
// ============================================================================
m_cocoaNSView = nil;
}
-void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const wxString& value)
+void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& value)
{
wxMessageDialogWithCustomLabels::DoSetCustomLabel(var, value);
int wxCocoaMessageDialog::ShowModal()
{
+ WX_TESTING_SHOW_MODAL_HOOK();
+
wxAutoNSAutoreleasePool thePool;
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
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];