X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93cf77c076b699e8e0b3b0049bd4f80de15997dd..befe54c6ca5d8f57be1d38f8826bdb080af29e89:/src/stubs/dialog.cpp diff --git a/src/stubs/dialog.cpp b/src/stubs/dialog.cpp index 9b72fb0f69..c278536c60 100644 --- a/src/stubs/dialog.cpp +++ b/src/stubs/dialog.cpp @@ -107,10 +107,8 @@ wxDialog::~wxDialog() // By default, pressing escape cancels the dialog void wxDialog::OnCharHook(wxKeyEvent& event) { - if (GetHWND()) + if (event.m_keyCode == WXK_ESCAPE) { - if (event.m_keyCode == WXK_ESCAPE) - { // Behaviour changed in 2.0: we'll send a Cancel message // to the dialog instead of Close. wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); @@ -118,7 +116,6 @@ void wxDialog::OnCharHook(wxKeyEvent& event) GetEventHandler()->ProcessEvent(cancelEvent); return; - } } // We didn't process this event. event.Skip();