if ( maximum > 0 )
{
- // note that we can't use wxGA_SMOOTH because it happens to also mean
- // wxDIALOG_MODAL and will cause the dialog to be modal. Have an extra
+ // note that we can't use wxGA_SMOOTH because it happens to
+ // cause the dialog to be modal. Have an extra
// style argument to wxProgressDialog, perhaps.
m_gauge = new wxGauge(this, -1, m_maximum,
wxDefaultPosition, wxDefaultSize,
SetTimeLabel(0, m_elapsed);
}
- // Update the display (especially on X, GTK)
- wxYield();
-
-#ifdef __WXMAC__
- MacUpdateImmediately();
-#endif
+ Update();
}
wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
// VZ: I like the labels be centered - if the others don't mind, you may
// remove "#ifdef __WXMSW__" and use it for all ports
-#if defined(__WXMSW__) || defined(__WXPM__)
+#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__)
c->left.SameAs(this, wxCentreX, LAYOUT_X_MARGIN);
#else // !MSW
c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
{
m_msg->SetLabel(newmsg);
- wxYield();
+ wxYieldIfNeeded() ;
}
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
m_msg->SetLabel(_("Done."));
}
- wxYield();
+ wxYieldIfNeeded() ;
(void)ShowModal();
}
}
else
{
- // update the display
- wxYield();
+ // we have to yield because not only we want to update the display but
+ // also to process the clicks on the cancel button
+ wxYieldIfNeeded() ;
}
-#ifdef __WXMAC__
- MacUpdateImmediately();
-#endif
+ // update the display in case yielding above didn't do it
+ Update();
return m_state != Canceled;
}