X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/289532452089421ddadbd4726a8469511a19ab76..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/dlgcmn.cpp diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 6ac7f13029..9289aa2d58 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -43,11 +43,15 @@ #include "wx/bookctrl.h" #include "wx/scrolwin.h" #include "wx/textwrapper.h" +#include "wx/testing.h" #if wxUSE_DISPLAY #include "wx/display.h" #endif +extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog"; + +wxModalDialogHook *wxModalDialogHook::ms_instance = NULL; // ---------------------------------------------------------------------------- // XTI @@ -223,13 +227,7 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message, widthMax = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25; } - // '&' is used as accel mnemonic prefix in the wxWidgets controls but in - // the static messages created by CreateTextSizer() (used by wxMessageBox, - // for example), we don't want this special meaning, so we need to quote it - wxString text(message); - text.Replace(wxT("&"), wxT("&&")); - - return wrapper.CreateSizer(text, widthMax); + return wrapper.CreateSizer(message, widthMax); } #endif // wxUSE_STATTEXT @@ -466,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() ) {