X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b76b3d2854fae7c61c2472db88cb65aea9b7a08d..a3a8d81d487ae4f03d8b70bce20bddbfc48c5776:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index a4c79cc53a..b25e7b84e0 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -443,8 +443,7 @@ int wxMessageDialog::ShowModal() } // use the top level window as parent if none specified - if ( !m_parent ) - m_parent = GetParentForModalDialog(); + m_parent = GetParentForModalDialog(); HWND hWnd = m_parent ? GetHwndOf(m_parent) : NULL; #if wxUSE_INTL @@ -508,16 +507,24 @@ int wxMessageDialog::ShowModal() } // set the icon style - if (wxStyle & wxICON_EXCLAMATION) - msStyle |= MB_ICONEXCLAMATION; - else if (wxStyle & wxICON_HAND) - msStyle |= MB_ICONHAND; - else if (wxStyle & wxICON_INFORMATION) - msStyle |= MB_ICONINFORMATION; - else if (wxStyle & wxICON_QUESTION) - msStyle |= MB_ICONQUESTION; - else if (!(wxStyle & wxICON_NONE)) - msStyle |= wxStyle & wxYES ? MB_ICONQUESTION : MB_ICONINFORMATION; + switch ( GetEffectiveIcon() ) + { + case wxICON_ERROR: + msStyle |= MB_ICONHAND; + break; + + case wxICON_WARNING: + msStyle |= MB_ICONEXCLAMATION; + break; + + case wxICON_QUESTION: + msStyle |= MB_ICONQUESTION; + break; + + case wxICON_INFORMATION: + msStyle |= MB_ICONINFORMATION; + break; + } if ( wxStyle & wxSTAY_ON_TOP ) msStyle |= MB_TOPMOST;