From: Dimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Date: Sat, 29 May 2004 15:45:24 +0000 (+0000)
Subject: applied valid part of patch #940683: "wxMessageBox autocompletion"
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/53a6ac21b84c24bbfc2f03500f7edab73f8feff8?ds=inline

applied valid part of patch #940683: "wxMessageBox autocompletion"


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp
index 8abc0215ac..2fd1c86901 100644
--- a/src/common/utilscmn.cpp
+++ b/src/common/utilscmn.cpp
@@ -747,7 +747,14 @@ wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt)
 int wxMessageBox(const wxString& message, const wxString& caption, long style,
                  wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) )
 {
-    wxMessageDialog dialog(parent, message, caption, style);
+    long decorated_style = style;
+
+    if ( ( style & ( wxICON_EXCLAMATION | wxICON_HAND | wxICON_INFORMATION | wxICON_QUESTION ) ) == 0 )
+    {
+        decorated_style |= ( style & wxYES ) ? wxICON_QUESTION : wxICON_INFORMATION ;
+    }
+
+    wxMessageDialog dialog(parent, message, caption, decorated_style);
 
     int ans = dialog.ShowModal();
     switch ( ans )