X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23e00c551b1d9b109a0f82ae2906dea0cd4718c2..356fd0b532205788a46365ade5ecbdb137dbc5fb:/src/osx/carbon/msgdlg.cpp diff --git a/src/osx/carbon/msgdlg.cpp b/src/osx/carbon/msgdlg.cpp index 29a23d18f1..20be0469e5 100644 --- a/src/osx/carbon/msgdlg.cpp +++ b/src/osx/carbon/msgdlg.cpp @@ -40,17 +40,26 @@ int wxMessageDialog::ShowModal() const long style = GetMessageDialogStyle(); - wxASSERT_MSG( (style & 0x3F) != wxYES, wxT("this style is not supported on Mac") ); + wxASSERT_MSG( (style & 0x3F) != wxYES, + "this style is not supported on Mac" ); AlertType alertType = kAlertPlainAlert; - if (style & wxICON_EXCLAMATION) - alertType = kAlertCautionAlert; - else if (style & wxICON_HAND) - alertType = kAlertStopAlert; - else if (style & wxICON_INFORMATION) - alertType = kAlertNoteAlert; - else if (style & wxICON_QUESTION) - alertType = kAlertNoteAlert; + + switch ( GetEffectiveIcon() ) + { + case wxICON_ERROR: + alertType = kAlertStopAlert; + break; + + case wxICON_WARNING: + alertType = kAlertCautionAlert; + break; + + case wxICON_QUESTION: + case wxICON_INFORMATION: + alertType = kAlertNoteAlert; + break; + } // work out what to display @@ -247,6 +256,8 @@ int wxMessageDialog::ShowModal() } } } + + SetReturnCode(resultbutton); return resultbutton; }