Add wxMessageDialog::GetEffectiveIcon() and use it in all ports.

Remove code duplication and inconsistencies among different ports by using a
single function in the base class for the determination of the effective icon
style to use, correctly handling both wxICON_NONE and the absence of any
wxICON_XXX styles.

Closes #11822.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-03-20 13:18:23 +00:00
parent 5eb342f9a2
commit a4578b0ced
7 changed files with 126 additions and 57 deletions

View File

@@ -73,14 +73,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;