X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cb7e05cd1ffcbb55fea48643fb81e284869ddad..8e190f0ed9c242e6df5fd4dd99fdaf6c9dea1cda:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 6edeb90229..abc1c6ae6f 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -81,7 +81,7 @@ // this function is a wrapper around strftime(3) // allows to exclude the usage of wxDateTime -static wxString TimeStamp(const wxChar *format, time_t t) +static wxString TimeStamp(const wxString& format, time_t t) { #if wxUSE_DATETIME wxChar buf[4096]; @@ -225,13 +225,25 @@ void wxVLogStatus(wxFrame *pFrame, const wxString& format, va_list argptr) } } -void wxDoLogStatus(wxFrame *pFrame, const wxString& format, ...) +#if !wxUSE_UTF8_LOCALE_ONLY +void wxDoLogStatusWchar(wxFrame *pFrame, const wxChar *format, ...) { va_list argptr; va_start(argptr, format); wxVLogStatus(pFrame, format, argptr); va_end(argptr); } +#endif // !wxUSE_UTF8_LOCALE_ONLY + +#if wxUSE_UNICODE_UTF8 +void wxDoLogStatusUtf8(wxFrame *pFrame, const char *format, ...) +{ + va_list argptr; + va_start(argptr, format); + wxVLogStatus(pFrame, format, argptr); + va_end(argptr); +} +#endif // wxUSE_UNICODE_UTF8 // ---------------------------------------------------------------------------- // wxLogGui implementation (FIXME MT-unsafe) @@ -351,7 +363,7 @@ void wxLogGui::Flush() } // log all kinds of messages -void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) +void wxLogGui::DoLog(wxLogLevel level, const wxString& szString, time_t t) { switch ( level ) { case wxLOG_Info: @@ -395,7 +407,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) // don't prepend debug/trace here: it goes to the // debug window anyhow str += wxT("\r\n"); - OutputDebugString(str); + OutputDebugString(str.wx_str()); #else // send them to stderr wxFprintf(stderr, wxT("[%s] %s\n"), @@ -457,7 +469,7 @@ class wxLogFrame : public wxFrame { public: // ctor & dtor - wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle); + wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle); virtual ~wxLogFrame(); // menu callbacks @@ -501,7 +513,7 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) EVT_CLOSE(wxLogFrame::OnCloseWindow) END_EVENT_TABLE() -wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle) +wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle) : wxFrame(pParent, wxID_ANY, szTitle) { m_log = log; @@ -609,7 +621,7 @@ wxLogFrame::~wxLogFrame() // ----------- wxLogWindow::wxLogWindow(wxWindow *pParent, - const wxChar *szTitle, + const wxString& szTitle, bool bShow, bool bDoPass) { @@ -626,7 +638,7 @@ void wxLogWindow::Show(bool bShow) m_pLogFrame->Show(bShow); } -void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) +void wxLogWindow::DoLog(wxLogLevel level, const wxString& szString, time_t t) { // first let the previous logger show it wxLogPassThrough::DoLog(level, szString, t); @@ -636,11 +648,11 @@ void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) case wxLOG_Status: // by default, these messages are ignored by wxLog, so process // them ourselves - if ( !wxIsEmpty(szString) ) + if ( !szString.empty() ) { wxString str; str << _("Status: ") << szString; - DoLogString(str, t); + LogString(str, t); } break; @@ -658,7 +670,7 @@ void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) } } -void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) +void wxLogWindow::DoLogString(const wxString& szString, time_t WXUNUSED(t)) { // put the text into our window wxTextCtrl *pText = m_pLogFrame->TextCtrl(); @@ -1146,7 +1158,7 @@ wxLogTextCtrl::wxLogTextCtrl(wxTextCtrl *pTextCtrl) m_pTextCtrl = pTextCtrl; } -void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) +void wxLogTextCtrl::DoLogString(const wxString& szString, time_t WXUNUSED(t)) { wxString msg; TimeStamp(&msg);