X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e08931c05af0aae83bbe1e2f4a5a2eab641f346b..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/cocoa/msgdlg.mm diff --git a/src/cocoa/msgdlg.mm b/src/cocoa/msgdlg.mm index 3dfe3f0a15..772ec2489d 100644 --- a/src/cocoa/msgdlg.mm +++ b/src/cocoa/msgdlg.mm @@ -79,14 +79,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];