X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e08931c05af0aae83bbe1e2f4a5a2eab641f346b..e2cb366f612460ba70fb12560c112fef2d8389dd:/include/wx/msgdlg.h diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index 80644941ff..8645691499 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -46,6 +46,21 @@ public: { } + ButtonLabel(const char *label) + : m_label(label), m_stockId(wxID_NONE) + { + } + + ButtonLabel(const wchar_t *label) + : m_label(label), m_stockId(wxID_NONE) + { + } + + ButtonLabel(const wxCStrData& label) + : m_label(label), m_stockId(wxID_NONE) + { + } + // default copy ctor and dtor are ok // get the string label, whether it was originally specified directly @@ -122,19 +137,36 @@ public: m_extendedMessage = extendedMessage; } -protected: - // common validation of wxMessageDialog style + // 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; } +protected: long GetMessageDialogStyle() const { return m_dialogStyle; }