Add support for wxICON_AUTH_NEEDED to wxMessageDialog.

Allow showing the standard "Authentication needed" dialog in the message boxes
under MSW.

Closes #15121.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-04-29 12:54:08 +00:00
parent add6e9193d
commit 67315c8bf9
8 changed files with 40 additions and 4 deletions

View File

@@ -629,6 +629,18 @@ int wxMessageDialog::ShowModal()
return ShowMessageBox();
}
long wxMessageDialog::GetEffectiveIcon() const
{
// only use the auth needed icon if available, otherwise fallback to the default logic
if ( (m_dialogStyle & wxICON_AUTH_NEEDED) &&
wxMSWMessageDialog::HasNativeTaskDialog() )
{
return wxICON_AUTH_NEEDED;
}
return wxMessageDialogBase::GetEffectiveIcon();
}
void wxMessageDialog::DoCentre(int dir)
{
#ifdef wxHAS_MSW_TASKDIALOG
@@ -738,6 +750,10 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc)
case wxICON_INFORMATION:
tdc.pszMainIcon = TD_INFORMATION_ICON;
break;
case wxICON_AUTH_NEEDED:
tdc.pszMainIcon = TD_SHIELD_ICON;
break;
}
// custom label button array that can hold all buttons in use