From affd4b2c131815dd35485dd20374c7d768e263cf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Apr 2014 11:28:29 +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/branches/WX_3_0_BRANCH@76421 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 3f73371484..d410ebb7ad 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -376,6 +376,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();