X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0655ad290a99dc0d4e8ea86aec60c7833a53be53..9841339c74917270e36def49a00a0415efe3683e:/src/generic/progdlgg.cpp diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 64dd3b5f2c..2a7eb07918 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -41,6 +41,7 @@ #include "wx/intl.h" #include "wx/settings.h" #include "wx/dcclient.h" + #include "wx/timer.h" #endif #include "wx/generic/progdlgg.h" @@ -85,11 +86,12 @@ wxProgressDialog::wxProgressDialog(wxString const &title, int maximum, wxWindow *parent, int style) - : wxDialog(m_parent, -1, title) + : wxDialog(parent, -1, title) { bool hasAbortButton = (style & wxPD_CAN_ABORT) != 0; m_state = hasAbortButton ? Continue : Uncancelable; m_disableParentOnly = (style & wxPD_APP_MODAL) == 0; + m_AutoHide = (style & wxPD_AUTO_HIDE) != 0; m_parent = parent; m_maximum = maximum; @@ -98,7 +100,14 @@ wxProgressDialog::wxProgressDialog(wxString const &title, wxClientDC dc(this); dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); long widthText; - dc.GetTextExtent(message, &widthText, NULL); +#if defined(__VISAGECPP__) +// have two versions of this in wxWindowDC tp avoid function hiding +// since there are two of these in wxDCBase, and in turn in wxDC. +// VA cannot resolve this so: + dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL); +#else + dc.GetTextExtent(message, &widthText, (long*)NULL); +#endif m_msg = new wxStaticText(this, -1, message); c = new wxLayoutConstraints; @@ -134,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title, m_gauge = (wxGauge *)NULL; // create the estimated/remaining/total time zones if requested - m_elapsed = m_estimated = m_remaining = NULL; + m_elapsed = m_estimated = m_remaining = (wxStaticText*)NULL; int nTimeLabels = 0; if ( style & wxPD_ELAPSED_TIME ) @@ -215,6 +224,9 @@ wxProgressDialog::wxProgressDialog(wxString const &title, Show(TRUE); Enable(TRUE); // enable this window + + // Update the display (especially on X, GTK) + wxYield(); } wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, @@ -274,7 +286,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg) SetTimeLabel(remaining, m_remaining); } - if ( (value == m_maximum - 1) && !(GetWindowStyleFlag() & wxPD_AUTO_HIDE) ) + if ( (value == m_maximum ) && !m_AutoHide ) { if ( m_btnAbort ) {