+ m_parentTop = wxGetTopLevelParent(parent);
+
+
+ // Initialize our own members.
+ m_state = Uncancelable;
+ m_maximum = maximum;
+
+#if defined(__WXMSW__) || defined(__WXPM__)
+ // we can't have values > 65,536 in the progress control under Windows, so
+ // scale everything down
+ m_factor = m_maximum / 65536 + 1;
+ m_maximum /= m_factor;
+#endif // __WXMSW__
+
+
+ m_timeStart = wxGetCurrentTime();
+ m_timeStop = (unsigned long)-1;
+ m_break = 0;
+
+ m_skip = false;
+
+ m_display_estimated =
+ m_last_timeupdate =
+ m_ctdelay = 0;
+
+ m_delay = 3;
+
+ m_hasAbortButton =
+ m_hasSkipButton = false;
+
+ m_winDisabler = NULL;
+ m_tempEventLoop = NULL;
+}
+
+wxGenericProgressDialog::wxGenericProgressDialog(wxWindow *parent,
+ int maximum,
+ int style)
+ : wxDialog()
+{
+ Init(parent, maximum, style);
+}
+
+wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title,
+ const wxString& message,
+ int maximum,
+ wxWindow *parent,
+ int style)
+ : wxDialog()
+{
+ Init(parent, maximum, style);
+
+ Create( title, message, maximum, parent, style );
+}
+
+void wxGenericProgressDialog::Create( const wxString& title,
+ const wxString& message,
+ int maximum,
+ wxWindow *parent,
+ int style )
+{
+ wxDialog::Create(GetParentForModalDialog(parent, style), wxID_ANY, title);
+
+ SetParent( GetParentForModalDialog(parent, style) );
+ SetTitle( title );
+
+ // We need a running event loop in order to update the dialog and be able
+ // to process clicks on its buttons, so ensure that there is one running
+ // even if this means we have to start it ourselves (this happens most
+ // commonly during the program initialization, e.g. for the progress
+ // dialogs shown from overridden wxApp::OnInit()).
+ if ( !wxEventLoopBase::GetActive() )
+ {
+ m_tempEventLoop = new wxEventLoop;
+ wxEventLoop::SetActive(m_tempEventLoop);
+ }
+