X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f45d6ade08b5b19979f62d0b641f5b86c3a37e6e..058f225a44d83d42ba9d773efc705badbf0e5e3c:/include/wx/msgdlg.h diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 0b9de3f1f7..8645691499 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -140,6 +140,7 @@ public: // change the dialog style flag void SetMessageDialogStyle(long style) { +#ifdef __WXDEBUG__ wxASSERT_MSG( ((style & wxYES_NO) == wxYES_NO) || !(style & wxYES_NO), "wxYES and wxNO may only be used together" ); @@ -152,14 +153,15 @@ public: wxASSERT_MSG( (style & wxID_OK) != wxID_OK, "wxMessageBox: Did you mean wxOK (and not wxID_OK)?" ); - wxASSERT_MSG( !(style & wxNO_DEFAULT) || (style & wxNO), - "wxNO_DEFAULT is invalid without wxNO" ); + if ((style & wxNO_DEFAULT) != 0 && (style & wxNO) == 0) + wxFAIL_MSG("wxNO_DEFAULT is invalid without wxNO"); - wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || (style & wxCANCEL), - "wxCANCEL_DEFAULT is invalid without wxCANCEL" ); + if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxCANCEL) == 0) + wxFAIL_MSG("wxCANCEL_DEFAULT is invalid without wxCANCEL"); - wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || !(style & wxNO_DEFAULT), - "only one default button can be specified" ); + if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxNO_DEFAULT) != 0) + wxFAIL_MSG("only one default button can be specified"); +#endif m_dialogStyle = style; }