+ // Initialize all our members that we always use (even when we don't
+ // create a valid window in this class).
+
+ m_pdStyle = 0;
+ m_parentTop = NULL;
+
+ m_gauge = NULL;
+ m_msg = NULL;
+ m_elapsed =
+ m_estimated =
+ m_remaining = NULL;
+
+ m_state = Uncancelable;
+ m_maximum = 0;
+
+ m_timeStart = wxGetCurrentTime();
+ m_timeStop = (unsigned long)-1;
+ m_break = 0;
+
+ m_skip = false;
+
+#if !defined(__SMARTPHONE__)
+ m_btnAbort =
+ m_btnSkip = NULL;
+#endif
+
+ m_display_estimated =
+ m_last_timeupdate =
+ m_ctdelay = 0;
+
+ m_delay = 3;
+
+ m_winDisabler = NULL;
+ m_tempEventLoop = NULL;
+}
+
+wxGenericProgressDialog::wxGenericProgressDialog()
+ : wxDialog()
+{
+ Init();
+}
+
+wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title,
+ const wxString& message,
+ int maximum,
+ wxWindow *parent,
+ int style)
+ : wxDialog()
+{
+ Init();
+
+ Create( title, message, maximum, parent, style );
+}
+
+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 )
+{
+ SetTopParent(parent);
+
+ m_parentTop = wxGetTopLevelParent(parent);
+ m_pdStyle = style;
+
+ wxWindow* const
+ realParent = GetParentForModalDialog(parent, GetWindowStyle());
+
+ if (!wxDialog::Create(realParent, wxID_ANY, title))
+ return false;