30 const int c_numChars = 80;
32 return wxString(
L'\u2002', c_numChars );
37 int aNumPhases,
int aCanAbort,
38 bool aReserveSpaceForMessage ) :
42 : wxString( wxEmptyString ),
49 aCanAbort | wxPD_ELAPSED_TIME ),
77 if( cur < 0 || cur > 1000 )
84 std::lock_guard<std::mutex> guard(
m_mutex );
92 if( !message.empty() && message.Last() ==
'\n' )
99 wxClientDC dc(
this );
100 message = wxControl::Ellipsize( message, dc, wxELLIPSIZE_MIDDLE, maxSize.x );
104 wxWindowDisabler ed(
this );
107 bool diag = WX_PROGRESS_REPORTER_BASE::Update( cur, message );
109 if( !message.empty() )
122 wxGauge( aParent, wxID_ANY, 1000, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL,
123 wxDefaultValidator, wxGaugeNameStr )
132 if( cur < 0 || cur > 1000 )
135 wxGauge::SetValue( cur );
GAUGE_PROGRESS_REPORTER(wxWindow *aParent, int aNumPhases)
std::atomic_bool m_messageChanged
PROGRESS_REPORTER_BASE(int aNumPhases)
std::atomic_int m_numPhases
int CurrentProgress() const
std::atomic_bool m_cancelled
std::atomic_int m_progress
std::atomic_int m_maxProgress
std::atomic_bool m_lastUpdateResult
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.
static bool shouldRefresh(int aProgress, int aMaxProgress, int aPhase, int aNumPhases, THROTTLE &aThrottle)
THROTTLE m_updateThrottle
void DrainPendingEvents(long aCategories=wxEVT_CATEGORY_TIMER)
Drain pending events of the given categories from the active event loop.
static wxString getPlaceholderText()
#define WX_PROGRESS_REPORTER_BASE