From 4bf2a7d3dcb18b7b09cf07eeb5581caf30655b67 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Fri, 4 May 2018 23:20:03 -0500 Subject: [PATCH] Fleshed out a StartBusy() function and moved Run to be public. Also added functional as a header. --- src/GUI/ProgressStatusBar.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GUI/ProgressStatusBar.hpp b/src/GUI/ProgressStatusBar.hpp index 44e6dd60c..dfb792e8b 100644 --- a/src/GUI/ProgressStatusBar.hpp +++ b/src/GUI/ProgressStatusBar.hpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace Slic3r { namespace GUI { @@ -42,10 +43,14 @@ public: void SetRange(int range) { if (range != this->prog->GetRange() ) this->prog->SetRange(range);} + /// Start the timer. + void Run(int rate = 100) { if (this->timer->IsRunning()) this->timer->Start(rate);}; + + void StartBusy(int rate = 100) { this->busy = true; this->ShowProgress(true); if (!this->timer->IsRunning()) this->timer->Start(rate); } + private: void OnSize(wxSizeEvent& e); void OnTimer(wxTimerEvent& e); - void Run(int rate = 100) { if (this->timer->IsRunning()) this->timer->Start(rate);}; // Cancel callback function std::function cancel_cb {[](){;}};