Relax wxMessageDialog style checks, assume wxOK by default.

Don't complain if neither wxOK nor wxYES[_NO] are specified but just assume
wxOK by default. This allows the code calling wxMessageBox() with just an icon
flag to continue to work in the same way in 2.9 as it did in 2.8.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-09-13 17:16:11 +00:00
parent b576c83a30
commit c03c654417

View File

@@ -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)?" );