X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14fd5e968bb3c50edae5e55db4d95afd679feb8d..9b49405777342458dc1666001865eef7309b6c30:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index c1d26eac3a..175d9c9208 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -51,6 +51,7 @@ #include "wx/artprov.h" #include "wx/collpane.h" #include "wx/arrstr.h" +#include "wx/msgout.h" #if wxUSE_THREADS #include "wx/thread.h" @@ -127,7 +128,6 @@ public: #if CAN_SAVE_FILES void OnSave(wxCommandEvent& event); #endif // CAN_SAVE_FILES - void OnListSelect(wxListEvent& event); void OnListItemActivated(wxListEvent& event); private: @@ -171,7 +171,7 @@ private: static size_t ms_maxLength; DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxLogDialog) + wxDECLARE_NO_COPY_CLASS(wxLogDialog); }; BEGIN_EVENT_TABLE(wxLogDialog, wxDialog) @@ -182,7 +182,6 @@ BEGIN_EVENT_TABLE(wxLogDialog, wxDialog) #if CAN_SAVE_FILES EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave) #endif // CAN_SAVE_FILES - EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxLogDialog::OnListItemActivated) END_EVENT_TABLE() @@ -436,32 +435,6 @@ void wxLogGui::DoLog(wxLogLevel level, const wxString& szString, time_t t) #endif // wxUSE_STATUSBAR break; - case wxLOG_Trace: - case wxLOG_Debug: - #ifdef __WXDEBUG__ - { - wxString str; - TimeStamp(&str); - str += szString; - - #if defined(__WXMSW__) && !defined(__WXMICROWIN__) - // don't prepend debug/trace here: it goes to the - // debug window anyhow - str += wxT("\r\n"); - OutputDebugString(str.wx_str()); - #else - // send them to stderr - wxFprintf(stderr, wxT("[%s] %s\n"), - level == wxLOG_Trace ? wxT("Trace") - : wxT("Debug"), - str.c_str()); - fflush(stderr); - #endif - } - #endif // __WXDEBUG__ - - break; - case wxLOG_FatalError: // show this one immediately wxMessageBox(szString, _("Fatal error"), wxICON_HAND); @@ -493,6 +466,11 @@ void wxLogGui::DoLog(wxLogLevel level, const wxString& szString, time_t t) m_aTimes.Add((long)t); m_bHasMessages = true; break; + + default: + // let the base class deal with debug/trace messages as well as any + // custom levels + wxLog::DoLog(level, szString, t); } } @@ -561,7 +539,7 @@ private: DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxLogFrame) + wxDECLARE_NO_COPY_CLASS(wxLogFrame); }; BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) @@ -1053,14 +1031,6 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent) m_listctrl->SetSize(wxDefaultCoord, wxMin(height, heightMax)); } -void wxLogDialog::OnListSelect(wxListEvent& event) -{ - // we can't just disable the control because this looks ugly under Windows - // (wrong bg colour, no scrolling...), but we still want to disable - // selecting items - it makes no sense here - m_listctrl->SetItemState(event.GetIndex(), 0, wxLIST_STATE_SELECTED); -} - void wxLogDialog::OnListItemActivated(wxListEvent& event) { // show the activated item in a message box