From 07ff314c139d4d7481eeaadf746a758cd104903b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Apr 2014 11:28:35 +0000 Subject: [PATCH] Make "Close" button affirmative ID in standard dialog button sizer. This allows to use the Escape key to close a dialog with the "Close" button only. Closes #16185. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dlgcmn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 483b2307b2..48c1c18a6c 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -370,6 +370,8 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) SetAffirmativeId(wxID_OK); else if (flags & wxYES) SetAffirmativeId(wxID_YES); + else if (flags & wxCLOSE) + SetAffirmativeId(wxID_CLOSE); sizer->Realize();