From 7d1dcec23aac41ae49f26c846467b4aec67ae775 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 16 Dec 2002 10:57:48 +0000 Subject: [PATCH] Applied [ 652962 ] wxProgressDialog::Show(FALSE) bug This fixes the problem where the application windows were not being enabled prior to the progress dialog being hidden in the situation where wxPD_AUTO_HIDE was not used or was used but the end count was never reached. This causes random applications to be activated and brought to the front on Windows. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/progdlgg.h | 2 ++ src/generic/progdlgg.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index 08411b619f..11c64d291e 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -63,6 +63,8 @@ public: */ void Resume(); + bool Show( bool show = TRUE ); + protected: // callback for optional abort button void OnCancel(wxCommandEvent& event); diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 39bb6d1ef8..c99c98dac7 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -406,6 +406,17 @@ void wxProgressDialog::Resume() m_btnAbort->Enable(); } +bool wxProgressDialog::Show( bool show ) +{ + // reenable other windows before hiding this one because otherwise + // Windows wouldn't give the focus back to the window which had + // been previously focused because it would still be disabled + if(!show) + ReenableOtherWindows(); + + return wxDialog::Show(show); +} + // ---------------------------------------------------------------------------- // event handlers // ----------------------------------------------------------------------------