X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/643e9cf9f61fdbe517b15477f9247ca8ac0b3578..4a2d030adfa836f6ada1830c9057170d053bcc64:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index edff0a0f5a..e44ca16d1a 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -42,10 +41,10 @@ #include "wx/msw/private/button.h" #include "wx/msw/private/metrics.h" #include "wx/msw/private/msgdlg.h" -#include "wx/testing.h" +#include "wx/modalhook.h" +#include "wx/fontutil.h" #if wxUSE_MSGBOX_HOOK - #include "wx/fontutil.h" #include "wx/textbuf.h" #include "wx/display.h" #endif @@ -587,12 +586,14 @@ int wxMessageDialog::ShowMessageBox() // do show the dialog int msAns = MessageBox(hWnd, message.t_str(), m_caption.t_str(), msStyle); - return MSWTranslateReturnCode(msAns); + int ret = MSWTranslateReturnCode(msAns); + SetReturnCode(ret); + return ret; } int wxMessageDialog::ShowModal() { - WX_TESTING_SHOW_MODAL_HOOK(); + WX_HOOK_MODAL_DIALOG(); #ifdef wxHAS_MSW_TASKDIALOG if ( HasNativeTaskDialog() ) @@ -622,13 +623,27 @@ int wxMessageDialog::ShowModal() msAns = IDOK; } - return MSWTranslateReturnCode( msAns ); + int ret = MSWTranslateReturnCode(msAns); + SetReturnCode(ret); + return ret; } #endif // wxHAS_MSW_TASKDIALOG 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 +753,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