m_msg = new wxStaticText(this, -1, message);
c = new wxLayoutConstraints;
- c->left.SameAs(this, wxLeft, 10);
- c->top.SameAs(this, wxTop, 10);
+ c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
+ c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
c->width.AsIs();
c->height.AsIs();
m_msg->SetConstraints(c);
bool
wxProgressDialog::Update(int value, const wxString& newmsg)
{
- wxASSERT_MSG( value == -1 || m_gauge, _T("can't update non existent dialog") );
- wxASSERT_MSG( value < m_maximum, _T("invalid progress value") );
+ wxASSERT_MSG( value == -1 || m_gauge, _T("cannot update non existent dialog") );
+ wxASSERT_MSG( value <= m_maximum, _T("invalid progress value") );
if( m_gauge )
if (m_elapsed)
{
- s.Printf("%i:%02i:%02i", diff.GetHour(), diff.GetMinute(), diff.GetSecond());
+ s.Printf(_T("%i:%02i:%02i"), diff.GetHour(), diff.GetMinute(), diff.GetSecond());
if (s != m_elapsed->GetLabel()) m_elapsed->SetLabel(s);
}
if (m_estimated)
{
- s.Printf("%i:%02i:%02i", estim / (60 * 60), (estim / 60) % 60, estim % 60);
+ s.Printf(_T("%i:%02i:%02i"), estim / (60 * 60), (estim / 60) % 60, estim % 60);
if (s != m_estimated->GetLabel()) m_estimated->SetLabel(s);
}
if (m_remaining)
{
- s.Printf("%i:%02i:%02i", remai / (60 * 60), (remai / 60) % 60, remai % 60);
+ s.Printf(_T("%i:%02i:%02i"), remai / (60 * 60), (remai / 60) % 60, remai % 60);
if (s != m_remaining->GetLabel()) m_remaining->SetLabel(s);
}
}
m_btnAbort->SetLabel(_("Close"));
}
- if ( !newmsg )
+/*I think the default should be the other way round. If the
+ application wants to set a "Done." message at the end, it should
+ supply it. Any serious objections to this change? Makes the
+ application programmers' work a little easier.
+ if ( !newmsg )
{
// also provide the finishing message if the application didn't
m_msg->SetLabel(_("Done."));
}
-
+*/
m_state = Finished;
// so that we return TRUE below
m_state = Finished;
}
-
+ wxYield();
return m_state != Canceled;
}