35#include <wx/textctrl.h>
36#include <wx/statusbr.h>
48 wxT(
"No wxTextCtrl object defined in WX_TEXT_CTRL_REPORTER." ) );
63 wxCHECK_MSG(
m_string !=
nullptr, *
this,
64 wxT(
"No wxString object defined in WX_STRING_REPORTER." ) );
79 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
80 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
89 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
90 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
99 wxCHECK_MSG(
m_panel !=
nullptr, *
this,
100 wxT(
"No WX_HTML_REPORT_PANEL object defined in WX_HTML_PANEL_REPORTER." ) );
121 static REPORTER* s_nullReporter =
nullptr;
123 if( !s_nullReporter )
126 return *s_nullReporter;
132 FILE* target = stdout;
137 if( aMsg.EndsWith( wxS(
"\n" ) ) )
138 wxFprintf( target, aMsg );
140 wxFprintf( target, aMsg + wxS(
"\n" ) );
150 return s_cliReporter;
168 std::cout << aMsg << std::endl;
176 static REPORTER* s_stdoutReporter =
nullptr;
178 if( !s_stdoutReporter )
181 return *s_stdoutReporter;
205 static REPORTER* s_wxLogReporter =
nullptr;
207 if( !s_wxLogReporter )
210 return *s_wxLogReporter;
239 m_message.reset(
new wxString( aText ) );
263 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.
This file contains miscellaneous commonly used macros and functions.
wxString From_UTF8(const char *cstring)