X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94e0018723919fe2ca2f5b5f0a42804c16dbf3a1..438959cca892a7651634cc3a7aad4819ac49b23c:/include/wx/msgdlg.h diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h index c3e8d9af4f..14df02f961 100644 --- a/include/wx/msgdlg.h +++ b/include/wx/msgdlg.h @@ -125,8 +125,12 @@ public: 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" ); + // It is common to specify just the icon, without wxOK, in the existing + // code, especially one written by Windows programmers as MB_OK is 0 + // and so they're used to omitting wxOK. Don't complain about it but + // just add wxOK implicitly for compatibility. + if ( !(style & wxYES) && !(style & wxOK) ) + style |= wxOK; wxASSERT_MSG( (style & wxID_OK) != wxID_OK, "wxMessageBox: Did you mean wxOK (and not wxID_OK)?" ); @@ -205,8 +209,9 @@ public: { return m_help.empty() ? GetDefaultHelpLabel() : m_help; } // based on message dialog style, returns exactly one of: wxICON_NONE, - // wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION - long GetEffectiveIcon() const + // wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION, + // wxICON_AUTH_NEEDED + virtual long GetEffectiveIcon() const { if ( m_dialogStyle & wxICON_NONE ) return wxICON_NONE; @@ -290,8 +295,6 @@ private: #define wxMessageDialog wxGenericMessageDialog #elif defined(__WXCOCOA__) #include "wx/cocoa/msgdlg.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/msgdlg.h" #elif defined(__WXMSW__) #include "wx/msw/msgdlg.h" #elif defined(__WXMOTIF__)