27#include <wx/evtloop.h>
33 int aNumPhases,
int aCanAbort,
34 bool aReserveSpaceForMessage ) :
37 ( aReserveSpaceForMessage ? wxT(
" " ) : wxT(
"" ) ),
44 aCanAbort | wxPD_ELAPSED_TIME ),
45 m_appProgressIndicator( aParent ),
64 if( cur < 0 || cur > 1000 )
72 std::lock_guard<std::mutex> guard(
m_mutex );
96 bool diag = WX_PROGRESS_REPORTER_BASE::Update( cur, message );
104 wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL,
105 wxDefaultValidator, wxGaugeNameStr )
114 if( cur < 0 || cur > 1000 )
117 wxGauge::SetValue( cur );
118 wxEventLoopBase::GetActive()->YieldFor( wxEVT_CATEGORY_UI );
GAUGE_PROGRESS_REPORTER(wxWindow *aParent, int aNumPhases)
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
std::atomic_bool m_messageChanged
int CurrentProgress() const
wxAppProgressIndicator m_appProgressIndicator
WX_PROGRESS_REPORTER(wxWindow *aParent, const wxString &aTitle, int aNumPhases, int aCanAbort, bool aReserveSpaceForMessage=true)
The PROGRESS_REPORTER will stay on top of aParent.
#define WX_PROGRESS_REPORTER_BASE