35#include <wx/textctrl.h>
36#include <wx/statusbr.h>
57 wxT(
"No wxTextCtrl object defined in WX_TEXT_CTRL_REPORTER." ) );
72 wxCHECK_MSG(
m_string !=
nullptr, *
this,
73 wxT(
"No wxString object defined in WX_STRING_REPORTER." ) );
88 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
89 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
98 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
99 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
108 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
109 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
130 static REPORTER* s_nullReporter =
nullptr;
132 if( !s_nullReporter )
135 return *s_nullReporter;
141 FILE* target = stdout;
146 if( aMsg.EndsWith( wxS(
"\n" ) ) )
147 wxFprintf( target, aMsg );
149 wxFprintf( target, aMsg + wxS(
"\n" ) );
159 return s_cliReporter;
177 std::cout << aMsg << std::endl;
185 static REPORTER* s_stdoutReporter =
nullptr;
187 if( !s_stdoutReporter )
190 return *s_stdoutReporter;
214 static REPORTER* s_wxLogReporter =
nullptr;
216 if( !s_wxLogReporter )
219 return *s_wxLogReporter;
248 m_message.reset(
new wxString( aText ) );
272 int icon = wxICON_NONE;
Reporter forwarding messages to stdout or stderr as appropriate.
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
void Finalize()
Update the infobar with the reported text.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
std::unique_ptr< wxString > m_message
virtual ~INFOBAR_REPORTER()
bool HasMessage() const override
Returns true if the reporter client is non-empty.
static REPORTER & GetInstance()
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
wxStatusBar * m_statusBar
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
REPORTER & Report(const wxString &aMsg, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static REPORTER & GetInstance()
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Places the report at the end of the list, for objects that support report ordering.
REPORTER & ReportHead(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Places the report at the beginning of the list for objects that support ordering.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
WX_HTML_REPORT_PANEL * m_panel
int Count(int severityMask)
sets the frame label
void Report(const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
Reports the string.
void QueueShowMessage(const wxString &aMessage, int aFlags=wxICON_INFORMATION)
Send the infobar an event telling it to show a message.
void QueueDismiss()
Send the infobar an event telling it to hide itself.
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
bool HasMessage() const override
Returns true if the reporter client is non-empty.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
static const wxChar traceReporter[]
Flag to enable reporter debugging output.
This file contains miscellaneous commonly used macros and functions.
wxString From_UTF8(const char *cstring)