27#include <wx/evtloop.h>
33 int aNumPhases,
bool aCanAbort,
34 bool aReserveSpaceForMessage ) :
36 wxProgressDialog( aTitle, ( aReserveSpaceForMessage ? wxT(
" " ) : wxT(
"" ) ), 1, aParent,
42 ( aCanAbort ? wxPD_CAN_ABORT : 0 ) | wxPD_ELAPSED_TIME ),
43#if wxCHECK_VERSION( 3, 1, 0 )
44 m_appProgressIndicator( aParent ),
48#if wxCHECK_VERSION( 3, 1, 0 )
52 m_appProgressIndicator.Pulse();
66 if( cur < 0 || cur > 1000 )
74 std::lock_guard<std::mutex> guard(
m_mutex );
95 bool diag = wxProgressDialog::Update( cur, message );
103 wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL,
104 wxDefaultValidator, wxGaugeNameStr )
113 if( cur < 0 || cur > 1000 )
116 wxGauge::SetValue( cur );
117 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
WX_PROGRESS_REPORTER(wxWindow *aParent, const wxString &aTitle, int aNumPhases, bool aCanAbort=true, bool aReserveSpaceForMessage=true)
The PROGRESS_REPORTER will stay on top of aParent.