X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6aa89a22b8e47000c98bff05c6f545f331f1c353..3c5487b14442ddbc6e43ee2f4475b5a6ba251fb1:/src/generic/progdlgg.cpp diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 4bdb7c3fea..b38e80e3a5 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "progdlgg.h" #endif @@ -144,8 +144,8 @@ wxProgressDialog::wxProgressDialog(wxString const &title, 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, @@ -266,12 +266,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, SetTimeLabel(0, m_elapsed); } - // Update the display (especially on X, GTK) - wxYield(); - -#ifdef __WXMAC__ - MacUpdateImmediately(); -#endif + Update(); } wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, @@ -284,7 +279,7 @@ 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); @@ -331,7 +326,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg) { m_msg->SetLabel(newmsg); - wxYield(); + wxYieldIfNeeded() ; } if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) ) @@ -370,7 +365,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg) m_msg->SetLabel(_("Done.")); } - wxYield(); + wxYieldIfNeeded() ; (void)ShowModal(); } @@ -386,13 +381,13 @@ wxProgressDialog::Update(int value, const wxString& newmsg) } 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; }