From 5c36387841c031243be77d24881801e8a8a28018 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Aug 2002 00:44:03 +0000 Subject: [PATCH] fix for the bug introduced by the last commit: don't quit the program when a standard msg box is closed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/toplevel.h | 4 ++-- src/common/toplvcmn.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 84ac5bffeb..3b33682aa6 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -140,9 +140,9 @@ protected: virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const { return FALSE; } - // check if we should exit the program after deleting another top level + // check if we should exit the program after deleting this top level // window (this is used in common dtor and wxMSW code) - static bool IsLastBeforeExit(); + bool IsLastBeforeExit() const; // send the iconize event, return TRUE if processed bool SendIconizeEvent(bool iconized = TRUE); diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 1f13c2535a..f5386f9835 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -86,12 +86,12 @@ bool wxTopLevelWindowBase::Destroy() return TRUE; } -/* static */ -bool wxTopLevelWindowBase::IsLastBeforeExit() +bool wxTopLevelWindowBase::IsLastBeforeExit() const { // we exit the application if there are no more top level windows left // normally but wxApp can prevent this from happening - return (wxTopLevelWindows.GetCount() == 1) && + return wxTopLevelWindows.GetCount() == 1 && + wxTopLevelWindows.GetFirst()->GetData() == (wxWindow *)this && wxTheApp && wxTheApp->GetExitOnFrameDelete(); } -- 2.45.2