X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e08931c05af0aae83bbe1e2f4a5a2eab641f346b..4521f6c88cbefa7f13e3733d344776b795f981e4:/src/cocoa/msgdlg.mm diff --git a/src/cocoa/msgdlg.mm b/src/cocoa/msgdlg.mm index 3dfe3f0a15..2ea22d8654 100644 --- a/src/cocoa/msgdlg.mm +++ b/src/cocoa/msgdlg.mm @@ -3,7 +3,6 @@ // Purpose: wxMessageDialog for wxCocoa // Author: Gareth Simpson // Created: 2007-10-09 -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -31,6 +30,7 @@ #include "wx/cocoa/autorelease.h" #include "wx/cocoa/string.h" +#include "wx/modalhook.h" #import // ============================================================================ @@ -72,6 +72,8 @@ void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& va int wxCocoaMessageDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + wxAutoNSAutoreleasePool thePool; NSAlert *alert = [[[NSAlert alloc] init] autorelease]; @@ -79,14 +81,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];