From 1c79904b9e45415b54b11fd2a62605129538ae6b Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sat, 22 Dec 2001 21:20:34 +0000 Subject: [PATCH] Made wxPD_AUTO_HIDE work. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/progdlgg.cpp | 49 +++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 4b5dcd7e75..8f2fc1e404 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -342,33 +342,40 @@ wxProgressDialog::Update(int value, const wxString& newmsg) SetTimeLabel(remaining, m_remaining); } - if ( (value == m_maximum ) && !(GetWindowStyle() & wxPD_AUTO_HIDE) ) + if ( (value == m_maximum ) ) { - if ( m_btnAbort ) - { - // tell the user what he should do... - m_btnAbort->SetLabel(_("Close")); - } -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - else // enable the close button to give the user a way to close the dlg - { - EnableCloseButton(TRUE); - } -#endif // __WXMSW__ - - if ( !newmsg ) - { - // also provide the finishing message if the application didn't - m_msg->SetLabel(_("Done.")); - } - // so that we return TRUE below and that out [Cancel] handler knew what // to do m_state = Finished; + if( !(GetWindowStyle() & wxPD_AUTO_HIDE) ) + { + if ( m_btnAbort ) + { + // tell the user what he should do... + m_btnAbort->SetLabel(_("Close")); + } +#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) + else // enable the close button to give the user a way to close the dlg + { + EnableCloseButton(TRUE); + } +#endif // __WXMSW__ - wxYield(); + if ( !newmsg ) + { + // also provide the finishing message if the application didn't + m_msg->SetLabel(_("Done.")); + } - (void)ShowModal(); + wxYield(); + + (void)ShowModal(); + } + else + { + Hide(); + ReenableOtherWindows(); + } } else {