From db1a42b8742c373d30118c3365dacee071eebe1c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 4 Jun 2002 18:08:39 +0000 Subject: [PATCH] (re)enable Cancel button in Resume() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/progdlgg.h | 2 +- src/generic/progdlgg.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index 57bcf51d4a..4ea81319df 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -61,7 +61,7 @@ public: the program decided to continue the operation (e.g., user didn't confirm it) */ - void Resume() { m_state = Continue; } + void Resume(); protected: // callback for optional abort button diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 15fb92990f..c6ca37e085 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -73,11 +73,11 @@ END_EVENT_TABLE() IMPLEMENT_CLASS(wxProgressDialog, wxDialog) // ============================================================================ -// implementation +// wxProgressDialog implementation // ============================================================================ // ---------------------------------------------------------------------------- -// wxProgressDialog +// wxProgressDialog creation // ---------------------------------------------------------------------------- wxProgressDialog::wxProgressDialog(wxString const &title, @@ -308,6 +308,10 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, return label; } +// ---------------------------------------------------------------------------- +// wxProgressDialog operations +// ---------------------------------------------------------------------------- + bool wxProgressDialog::Update(int value, const wxString& newmsg) { @@ -393,6 +397,15 @@ wxProgressDialog::Update(int value, const wxString& newmsg) return m_state != Canceled; } +void wxProgressDialog::Resume() +{ + m_state = Continue; + + // it may have been disabled by OnCancel(), so enable it back to let the + // user interrupt us again if needed + m_btnAbort->Enable(); +} + // ---------------------------------------------------------------------------- // event handlers // ---------------------------------------------------------------------------- -- 2.45.2