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

@@ -508,16 +508,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;