moved Esc processing from wxWindow to wxDialog where it belongs; use the -- to be implemented in 2.7 -- GetEscapeId() to decide what to do when Esc is pressed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-07-14 23:09:00 +00:00
parent 2b4f7fbc9f
commit f55fee08e9
3 changed files with 57 additions and 47 deletions

View File

@@ -1940,38 +1940,6 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
bProcess = false;
break;
case VK_ESCAPE:
{
#if wxUSE_BUTTON
wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL),wxButton);
// our own wxLogDialog should react to Esc
// without Cancel button but this is a private class
// so let's try recognize it by content
#if wxUSE_LOG_DIALOG
if ( !btn &&
wxDynamicCast(this,wxDialog) &&
FindWindow(wxID_MORE) &&
FindWindow(wxID_OK) &&
!FindWindow(wxID_CANCEL) &&
GetTitle().MakeLower().StartsWith(wxTheApp->GetAppName().c_str())
)
btn = wxDynamicCast(FindWindow(wxID_OK),wxButton);
#endif // wxUSE_LOG_DIALOG
if ( btn && btn->IsEnabled() )
{
// if we do have a cancel button, do press it
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
// we consumed the message
return true;
}
#endif // wxUSE_BUTTON
bProcess = false;
}
break;
case VK_RETURN:
{
if ( (lDlgCode & DLGC_WANTMESSAGE) && !bCtrlDown )