Allow 2-step creation of wxGenericProgressDialog.
Add default ctor and Create() with the same parameters as the non-default ctor. Closes #13555. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
@@ -129,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,
|
||||
@@ -142,24 +141,25 @@ wxGenericProgressDialog::wxGenericProgressDialog(const wxString& title,
|
||||
int style)
|
||||
: wxDialog()
|
||||
{
|
||||
Init(parent, style);
|
||||
Init();
|
||||
|
||||
Create( title, message, maximum, parent, style );
|
||||
}
|
||||
|
||||
void wxGenericProgressDialog::Create( const wxString& title,
|
||||
bool wxGenericProgressDialog::Create( const wxString& title,
|
||||
const wxString& message,
|
||||
int maximum,
|
||||
wxWindow *parent,
|
||||
int style )
|
||||
{
|
||||
// Notice that GetParentForModalDialog() needs the dialog window style, not
|
||||
// our wxProgressDialog-specific style.
|
||||
m_parentTop = wxGetTopLevelParent(parent);
|
||||
m_pdStyle = style;
|
||||
|
||||
wxWindow* const
|
||||
realParent = GetParentForModalDialog(parent, GetWindowStyle());
|
||||
wxDialog::Create(realParent, wxID_ANY, title);
|
||||
|
||||
SetTitle( title );
|
||||
if (!wxDialog::Create(realParent, wxID_ANY, title))
|
||||
return false;
|
||||
|
||||
SetMaximum(maximum);
|
||||
|
||||
@@ -309,6 +309,7 @@ void wxGenericProgressDialog::Create( const wxString& title,
|
||||
}
|
||||
|
||||
Update();
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxGenericProgressDialog::UpdateTimeEstimates(int value,
|
||||
|
Reference in New Issue
Block a user