X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2de77c6a543caf44069b275dd154d4fc692ad29d..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/generic/progdlgg.cpp?ds=inline diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index b1bb1c6e3e..7f48ba31f3 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -87,7 +87,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 +95,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; @@ -114,6 +113,11 @@ void wxGenericProgressDialog::Init(wxWindow *parent, int style) m_skip = false; +#if !defined(__SMARTPHONE__) + m_btnAbort = + m_btnSkip = NULL; +#endif + m_display_estimated = m_last_timeupdate = m_ctdelay = 0; @@ -124,10 +128,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, @@ -137,21 +141,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); + + m_parentTop = wxGetTopLevelParent(parent); + m_pdStyle = style; + + wxWindow* const + realParent = GetParentForModalDialog(parent, GetWindowStyle()); - SetParent( GetParentForModalDialog(parent, style) ); - SetTitle( title ); + if (!wxDialog::Create(realParent, wxID_ANY, title)) + return false; SetMaximum(maximum); @@ -256,7 +271,7 @@ void wxGenericProgressDialog::Create( const wxString& title, // Windows dialogs usually have buttons in the lower right corner const int sizerFlags = -#if defined(__WXMSW__) || defined(__WXPM__) +#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXOSX__) wxALIGN_RIGHT | wxALL #else // !MSW wxALIGN_CENTER_HORIZONTAL | wxBOTTOM | wxTOP @@ -301,6 +316,7 @@ void wxGenericProgressDialog::Create( const wxString& title, } Update(); + return true; } void wxGenericProgressDialog::UpdateTimeEstimates(int value,