X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63415ba9f5331b2b96215f8a570e05623ea6ec42..b3ee9f4d2efa4a5088b4c84eb8a0ba712fa7e7fb:/src/common/dlgcmn.cpp?ds=sidebyside diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index d95dafd786..9289aa2d58 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -43,6 +43,7 @@ #include "wx/bookctrl.h" #include "wx/scrolwin.h" #include "wx/textwrapper.h" +#include "wx/testing.h" #if wxUSE_DISPLAY #include "wx/display.h" @@ -50,6 +51,8 @@ extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog"; +wxModalDialogHook *wxModalDialogHook::ms_instance = NULL; + // ---------------------------------------------------------------------------- // XTI // ---------------------------------------------------------------------------- @@ -461,14 +464,16 @@ bool wxDialogBase::SendCloseButtonClickEvent() bool wxDialogBase::IsEscapeKey(const wxKeyEvent& event) { - // for most platforms, Esc key is used to close the dialogs - return event.GetKeyCode() == WXK_ESCAPE && - event.GetModifiers() == wxMOD_NONE; + // For most platforms, Esc key is used to close the dialogs. + // + // Notice that we intentionally don't check for modifiers here, Shift-Esc, + // Alt-Esc and so on still close the dialog, typically. + return event.GetKeyCode() == WXK_ESCAPE; } void wxDialogBase::OnCharHook(wxKeyEvent& event) { - if ( event.GetKeyCode() == WXK_ESCAPE ) + if ( IsEscapeKey(event) ) { if ( SendCloseButtonClickEvent() ) {