From dc5802746d13ea4f7012fd095a98340661e80e8f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Oct 2017 19:49:40 +0100 Subject: [PATCH] Set wxProgressDialog::m_parent too This, in addition to the previous commit, allows Centre() to work correctly as it needs to retrieve the parent window rectangle. See #17768. --- include/wx/generic/progdlgg.h | 4 ++-- src/generic/progdlgg.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index 8ff7e97aa5..310481f397 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -124,8 +124,8 @@ protected: // the dialog was shown void ReenableOtherWindows(); - // Set the top level parent we store from the parent window provided when - // creating the dialog. + // Store the parent window as wxWindow::m_parent and also set the top level + // parent reference we store in this class itself. void SetTopParent(wxWindow* parent); // return the top level parent window of this dialog (may be NULL) diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index ff6ce27983..8a3c9ede12 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -133,6 +133,7 @@ wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title, void wxGenericProgressDialog::SetTopParent(wxWindow* parent) { + m_parent = parent; m_parentTop = GetParentForModalDialog(parent, GetWindowStyle()); }