X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/017dc06b502c041c112a3948e6c5f65000a86d94..43c42c18d36c703a88b1b7b697bac27fe5608eca:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index d2e06d4b79..e9b25735a9 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -42,6 +42,7 @@ #include "wx/msw/private/button.h" #include "wx/msw/private/metrics.h" #include "wx/msw/private/msgdlg.h" +#include "wx/testing.h" #if wxUSE_MSGBOX_HOOK #include "wx/fontutil.h" @@ -591,6 +592,8 @@ int wxMessageDialog::ShowMessageBox() int wxMessageDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + #ifdef wxHAS_MSW_TASKDIALOG if ( HasNativeTaskDialog() ) { @@ -626,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 @@ -735,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