]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure that the progress dialog parent is activated at the end under MSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Feb 2012 14:18:25 +0000 (14:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Feb 2012 14:18:25 +0000 (14:18 +0000)
The progress dialog parent was supposed to become the new foreground window
when the progress dialog was closed, but this didn't happen because
m_parentTop was never set when the native progress dialog implementation was
used under MSW. Fix this by explicitly calling the new SetTopParent() from its
ctor.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/progdlgg.h
src/generic/progdlgg.cpp
src/msw/progdlg.cpp

index 7646649d4f65ddc81316591ea5cf28bbb27e5f88..4e3c3e183b5e2ec28eb774882a42ab672f6f78b3 100644 (file)
@@ -121,6 +121,10 @@ protected:
     // the dialog was shown
     void ReenableOtherWindows();
 
+    // Set the top level parent we store from the parent window provided when
+    // creating the dialog.
+    void SetTopParent(wxWindow* parent);
+
     // return the top level parent window of this dialog (may be NULL)
     wxWindow *GetTopParent() const { return m_parentTop; }
 
index fad7b159f5c3bc92b88228ed685b0da5e0698eb0..7f48ba31f331e4748683bf4f9c8f07800de91f1f 100644 (file)
@@ -146,12 +146,19 @@ wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title,
     Create( title, message, maximum, parent, style );
 }
 
+void wxGenericProgressDialog::SetTopParent(wxWindow* parent)
+{
+    m_parentTop = GetParentForModalDialog(parent, GetWindowStyle());
+}
+
 bool wxGenericProgressDialog::Create( const wxString& title,
                                       const wxString& message,
                                       int maximum,
                                       wxWindow *parent,
                                       int style )
 {
+    SetTopParent(parent);
+
     m_parentTop = wxGetTopLevelParent(parent);
     m_pdStyle = style;
 
index 553c939fd2ed34d960a1d9db7d1c3c8f1824f76f..8191f6b08478b66554b1e4484b717b549981ceb8 100644 (file)
@@ -316,7 +316,7 @@ wxProgressDialog::wxProgressDialog( const wxString& title,
 #ifdef wxHAS_MSW_TASKDIALOG
     if ( HasNativeTaskDialog() )
     {
-        SetParent(GetParentForModalDialog(parent, GetWindowStyle()));
+        SetTopParent(parent);
         SetPDStyle(style);
         SetMaximum(maximum);