]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied [ 652962 ] wxProgressDialog::Show(FALSE) bug
authorJulian Smart <julian@anthemion.co.uk>
Mon, 16 Dec 2002 10:57:48 +0000 (10:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 16 Dec 2002 10:57:48 +0000 (10:57 +0000)
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
src/generic/progdlgg.cpp

index 08411b619f3a767baee696333b7daa31f0630616..11c64d291efbedff7f37d5a61db65a647dbe4852 100644 (file)
@@ -63,6 +63,8 @@ public:
    */
    void Resume();
 
+   bool Show( bool show = TRUE );
+
 protected:
    // callback for optional abort button
    void OnCancel(wxCommandEvent& event);
index 39bb6d1ef836590aada25bf296c93e7884babc6b..c99c98dac7673c49c586784b0f6d7d44ed940218 100644 (file)
@@ -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
 // ----------------------------------------------------------------------------