]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msgdlg.h
support for simulating focus events since not all controls can be focused
[wxWidgets.git] / include / wx / msgdlg.h
index c3e8d9af4fe396d94baae0bbd8e279e05668bab1..4dbd2d5ac2620f0c7e949123aaa146349375d022 100644 (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)?" );
@@ -290,8 +294,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__)