Use the same logic for closing dialogs as for handling Escape key.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Sep 2010 20:53:26 +0000 (20:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 9 Sep 2010 20:53:26 +0000 (20:53 +0000)
commit83a7613b7186bb2597a393b6bcb14166f1e0641d
tree5f017a7276c92828767207eb8c7192026993e9c4
parent0b94182cdc4b226c26179caaa28222473262cb04
Use the same logic for closing dialogs as for handling Escape key.

Pressing "Esc" key closed the dialog with only wxID_OK button (but no
wxID_CANCEL one) by default but pressing the "close window" button only closed
it if wxID_CANCEL was present.

Fix this by using the same code in OnCloseWindow() as in OnCharHook(), after
extracting it into the new SendCloseButtonClickEvent() method.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/dialog.h
src/common/dlgcmn.cpp