X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/298c25c3a5b9d5d6b92310a54f860cd48627888b..e143fb636d50d5802dcc8c7c2e9e8e2944afa467:/include/wx/msgdlg.h diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 7dbffe33a3..7c4329fa39 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -140,12 +140,29 @@ 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" ); + wxASSERT_MSG( !(style & wxYES) || !(style & wxOK), + "wxOK and wxYES/wxNO can't be used together" ); + + wxASSERT_MSG( (style & wxYES) || (style & wxOK), + "one of wxOK and wxYES/wxNO must be used" ); + wxASSERT_MSG( (style & wxID_OK) != wxID_OK, "wxMessageBox: Did you mean wxOK (and not wxID_OK)?" ); + if ((style & wxNO_DEFAULT) != 0 && (style & wxNO) == 0) + wxFAIL_MSG("wxNO_DEFAULT is invalid without wxNO"); + + if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxCANCEL) == 0) + wxFAIL_MSG("wxCANCEL_DEFAULT is invalid without wxCANCEL"); + + if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxNO_DEFAULT) != 0) + wxFAIL_MSG("only one default button can be specified"); +#endif + m_dialogStyle = style; } @@ -169,7 +186,7 @@ protected: m_caption; long m_dialogStyle; - DECLARE_NO_COPY_CLASS(wxMessageDialogBase) + wxDECLARE_NO_COPY_CLASS(wxMessageDialogBase); }; // this is a helper class for native wxMessageDialog implementations which need @@ -273,7 +290,7 @@ private: m_ok, m_cancel; - DECLARE_NO_COPY_CLASS(wxMessageDialogWithCustomLabels) + wxDECLARE_NO_COPY_CLASS(wxMessageDialogWithCustomLabels); }; #endif // ports needing wxMessageDialogWithCustomLabels