]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/msgdlg.cpp
follow up parent chain to properly support modal dialog parents, see #15383
[wxWidgets.git] / src / msw / msgdlg.cpp
index d2e06d4b7914c6cf4b91c62093fb624a541afe9c..aaed9613095c8571ea6f05fe0f6f1cb9cf7baaa0 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -42,6 +41,7 @@
 #include "wx/msw/private/button.h"
 #include "wx/msw/private/metrics.h"
 #include "wx/msw/private/msgdlg.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_MSGBOX_HOOK
     #include "wx/fontutil.h"
@@ -591,6 +591,8 @@ int wxMessageDialog::ShowMessageBox()
 
 int wxMessageDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
 #ifdef wxHAS_MSW_TASKDIALOG
     if ( HasNativeTaskDialog() )
     {
@@ -626,6 +628,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 +749,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