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:
@@ -125,8 +125,12 @@ public:
|
|||||||
wxASSERT_MSG( !(style & wxYES) || !(style & wxOK),
|
wxASSERT_MSG( !(style & wxYES) || !(style & wxOK),
|
||||||
"wxOK and wxYES/wxNO can't be used together" );
|
"wxOK and wxYES/wxNO can't be used together" );
|
||||||
|
|
||||||
wxASSERT_MSG( (style & wxYES) || (style & wxOK),
|
// It is common to specify just the icon, without wxOK, in the existing
|
||||||
"one of wxOK and wxYES/wxNO must be used" );
|
// 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,
|
wxASSERT_MSG( (style & wxID_OK) != wxID_OK,
|
||||||
"wxMessageBox: Did you mean wxOK (and not wxID_OK)?" );
|
"wxMessageBox: Did you mean wxOK (and not wxID_OK)?" );
|
||||||
|
Reference in New Issue
Block a user