]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/msgdlg.cpp
avoid deprecated functions with GTK3
[wxWidgets.git] / src / os2 / msgdlg.cpp
index 4504fd97c7006f4ddebec42919f77367c2d8ae4b..81dc82639f44554b22047a6465c9b4edead0dd10 100644 (file)
@@ -22,6 +22,7 @@
     #include "wx/math.h"
 #endif
 
+#include "wx/testing.h"
 #include "wx/os2/private.h"
 
 #include <stdlib.h>
@@ -34,6 +35,8 @@ IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 
 int wxMessageDialog::ShowModal()
 {
+    WX_TESTING_SHOW_MODAL_HOOK();
+
     HWND                            hWnd = 0;
     ULONG                           ulStyle = MB_OK;
     int                             nAns = wxOK;
@@ -73,14 +76,25 @@ int wxMessageDialog::ShowModal()
         else
             ulStyle = MB_OK;
     }
-    if (lStyle & wxICON_EXCLAMATION)
-        ulStyle |= MB_ICONEXCLAMATION;
-    else if (lStyle & wxICON_HAND)
-        ulStyle |= MB_ICONHAND;
-    else if (lStyle & wxICON_INFORMATION)
-        ulStyle |= MB_ICONEXCLAMATION;
-    else if (lStyle & wxICON_QUESTION)
-        ulStyle |= MB_ICONQUESTION;
+
+    switch ( GetEffectiveIcon() )
+    {
+        case wxICON_ERROR:
+            ulStyle |= MB_ERROR;
+            break;
+
+        case wxICON_WARNING:
+            ulStyle |= MB_WARNING;
+            break;
+
+        case wxICON_QUESTION:
+            ulStyle |= MB_QUERY;
+            break;
+
+        case wxICON_INFORMATION:
+            ulStyle |= MB_INFORMATION;
+            break;
+    }
 
     if (hWnd != HWND_DESKTOP)
         ulStyle |= MB_APPLMODAL;