]> git.saurik.com Git - wxWidgets.git/commitdiff
Use an appropriate icon automatically in wxMSW wxMessageDialog.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Mar 2010 14:15:49 +0000 (14:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 14 Mar 2010 14:15:49 +0000 (14:15 +0000)
wxMessageBox() functions uses wxICON_QUESTION or wxICON_INFORMATION
automatically if no other icon style (including wxICON_NONE) is specified but
wxMessageDialog under MSW didn't do this, unlike under e.g. wxGTK.

Fix this by also determining the appropriate icon automatically in
wxMessageDialog itself in wxMSW.

Ideally we'd do this in all ports wxMessageDialog implementations and remove
the code doing it from wxMessageBox() but right now it's still needed for the
platforms other than wxMSW and wxGTK.

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

src/msw/msgdlg.cpp

index 43ed4e1c6eca9b07eab039b215a3e65d6f050aa6..a4c79cc53aa47b0849fc187eb177c115a9910ba0 100644 (file)
@@ -507,6 +507,7 @@ int wxMessageDialog::ShowModal()
         }
     }
 
+    // set the icon style
     if (wxStyle & wxICON_EXCLAMATION)
         msStyle |= MB_ICONEXCLAMATION;
     else if (wxStyle & wxICON_HAND)
@@ -515,6 +516,8 @@ int wxMessageDialog::ShowModal()
         msStyle |= MB_ICONINFORMATION;
     else if (wxStyle & wxICON_QUESTION)
         msStyle |= MB_ICONQUESTION;
+    else if (!(wxStyle & wxICON_NONE))
+        msStyle |= wxStyle & wxYES ? MB_ICONQUESTION : MB_ICONINFORMATION;
 
     if ( wxStyle & wxSTAY_ON_TOP )
         msStyle |= MB_TOPMOST;