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 m_appProgressIndicator( aParent ),
62 if( cur < 0 || cur > 1000 )
70 std::lock_guard<std::mutex> guard(
m_mutex );
92 bool diag = wxProgressDialog::Update( cur, message );
100 wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL,
101 wxDefaultValidator, wxGaugeNameStr )
110 if( cur < 0 || cur > 1000 )
113 wxGauge::SetValue( cur );
114 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, bool aCanAbort=true, bool aReserveSpaceForMessage=true)
The PROGRESS_REPORTER will stay on top of aParent.