Fix setting the parent of wxProgressDialog.

Don't call GetParentForModalDialog() with wxProgressDialog style, this doesn't
work as it expects the window style.

Do call SetParent() when using the native MSW implementation as the wx-level
parent is not used then.

Closes #13706.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-11-30 10:48:05 +00:00
parent 37bea8d229
commit 516ed23a94
2 changed files with 6 additions and 2 deletions

View File

@@ -153,9 +153,12 @@ void wxGenericProgressDialog::Create( const wxString& title,
wxWindow *parent,
int style )
{
wxDialog::Create(GetParentForModalDialog(parent, style), wxID_ANY, title);
// Notice that GetParentForModalDialog() needs the dialog window style, not
// our wxProgressDialog-specific style.
wxWindow* const
realParent = GetParentForModalDialog(parent, GetWindowStyle());
wxDialog::Create(realParent, wxID_ANY, title);
SetParent( GetParentForModalDialog(parent, style) );
SetTitle( title );
SetMaximum(maximum);