#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
+#include "wx/modalhook.h"
#import <AppKit/NSAlert.h>
// ============================================================================
int wxCocoaMessageDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
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];