got rid of some ifdefs; added comment explaining why wxYield() is really needed and Update() is not enough

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-04-21 12:55:41 +00:00
parent 940b4f0741
commit 1d1c3a9fda

View File

@@ -266,12 +266,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
SetTimeLabel(0, m_elapsed); SetTimeLabel(0, m_elapsed);
} }
#ifdef __WXMAC__
Update(); Update();
#else
// Update the display (especially on X, GTK)
wxYield();
#endif
} }
wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
@@ -331,11 +326,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
{ {
m_msg->SetLabel(newmsg); m_msg->SetLabel(newmsg);
#ifdef __WXMAC__
wxYieldIfNeeded() ; wxYieldIfNeeded() ;
#else
wxYield();
#endif
} }
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) ) if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
@@ -374,11 +365,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
m_msg->SetLabel(_("Done.")); m_msg->SetLabel(_("Done."));
} }
#ifdef __WXMAC__
wxYieldIfNeeded() ; wxYieldIfNeeded() ;
#else
wxYield();
#endif
(void)ShowModal(); (void)ShowModal();
} }
@@ -394,17 +381,13 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
} }
else else
{ {
// update the display // we have to yield because not only we want to update the display but
#ifdef __WXMAC__ // also to process the clicks on the cancel button
wxYieldIfNeeded() ; wxYieldIfNeeded() ;
#else
wxYield();
#endif
} }
#ifdef __WXMAC__ // update the display in case yielding above didn't do it
Update(); Update();
#endif
return m_state != Canceled; return m_state != Canceled;
} }