X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e418552365dcb44e4334c416df8f4e71c57162d3..6f026b5b63fe7ccb025e84509886f74772b9df13:/src/generic/progdlgg.cpp diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index fb454b7953..7b6fd4701b 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -4,7 +4,6 @@ // Author: Karsten Ballueder // Modified by: // Created: 09.05.1999 -// RCS-ID: $Id$ // Copyright: (c) Karsten Ballueder // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -87,7 +86,7 @@ wxIMPLEMENT_CLASS(wxProgressDialog, wxDialog) // wxGenericProgressDialog creation // ---------------------------------------------------------------------------- -void wxGenericProgressDialog::Init(wxWindow *parent, int style) +void wxGenericProgressDialog::Init() { // we may disappear at any moment, let the others know about it SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT); @@ -95,9 +94,8 @@ void wxGenericProgressDialog::Init(wxWindow *parent, int style) // Initialize all our members that we always use (even when we don't // create a valid window in this class). - m_pdStyle = style; - - m_parentTop = wxGetTopLevelParent(parent); + m_pdStyle = 0; + m_parentTop = NULL; m_gauge = NULL; m_msg = NULL; @@ -129,10 +127,10 @@ void wxGenericProgressDialog::Init(wxWindow *parent, int style) m_tempEventLoop = NULL; } -wxGenericProgressDialog::wxGenericProgressDialog(wxWindow *parent, int style) +wxGenericProgressDialog::wxGenericProgressDialog() : wxDialog() { - Init(parent, style); + Init(); } wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title, @@ -142,21 +140,32 @@ wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title, int style) : wxDialog() { - Init(parent, style); + Init(); Create( title, message, maximum, parent, style ); } -void wxGenericProgressDialog::Create( const wxString& title, +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 ) { - wxDialog::Create(GetParentForModalDialog(parent, style), wxID_ANY, title); + SetTopParent(parent); - SetParent( GetParentForModalDialog(parent, style) ); - SetTitle( title ); + m_parentTop = wxGetTopLevelParent(parent); + m_pdStyle = style; + + wxWindow* const + realParent = GetParentForModalDialog(parent, GetWindowStyle()); + + if (!wxDialog::Create(realParent, wxID_ANY, title)) + return false; SetMaximum(maximum); @@ -306,6 +315,7 @@ void wxGenericProgressDialog::Create( const wxString& title, } Update(); + return true; } void wxGenericProgressDialog::UpdateTimeEstimates(int value,