X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e63b67d367808e505402a65c079b5dc45075f43..39b5648ed2b396e7a7e67806dbb2d3b6452dafe6:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 8c20b7af42..50e1457c19 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -18,15 +18,11 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "logg.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP @@ -41,7 +37,6 @@ #include "wx/textctrl.h" #include "wx/sizer.h" #include "wx/statbmp.h" - #include "wx/button.h" #include "wx/settings.h" #endif // WX_PRECOMP @@ -53,20 +48,18 @@ #include "wx/artprov.h" #ifdef __WXMSW__ - // for OutputDebugString() - #include "wx/msw/private.h" + // for OutputDebugString() + #include "wx/msw/private.h" #endif // Windows #ifdef __WXPM__ - #include + #include #endif #if wxUSE_LOG_DIALOG #include "wx/listctrl.h" #include "wx/imaglist.h" #include "wx/image.h" -#else // !wxUSE_LOG_DIALOG - #include "wx/msgdlg.h" #endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG #if defined(__MWERKS__) && wxUSE_UNICODE @@ -88,10 +81,6 @@ // allows to exclude the usage of wxDateTime static wxString TimeStamp(const wxChar *format, time_t t) { -#ifdef __WXWINCE__ - // FIXME - return wxEmptyString; -#else wxChar buf[4096]; if ( !wxStrftime(buf, WXSIZEOF(buf), format, localtime(&t)) ) { @@ -99,7 +88,6 @@ static wxString TimeStamp(const wxChar *format, time_t t) wxFAIL_MSG(_T("strftime() failed")); } return wxString(buf); -#endif } @@ -256,6 +244,12 @@ void wxLogGui::Flush() // do it right now to block any new calls to Flush() while we're here m_bHasMessages = false; + unsigned repeatCount = 0; + if ( wxLog::GetRepetitionCounting() ) + { + repeatCount = wxLog::DoLogNumberOfRepeats(); + } + wxString appName = wxTheApp->GetAppName(); if ( !appName.empty() ) appName[0u] = (wxChar)wxToupper(appName[0u]); @@ -293,6 +287,8 @@ void wxLogGui::Flush() { #if wxUSE_LOG_DIALOG + if ( repeatCount > 0 ) + m_aMessages[nMsgCount-1] += wxString::Format(wxT(" (%s)"), m_aMessages[nMsgCount-2].c_str()); wxLogDialog dlg(NULL, m_aMessages, m_aSeverity, m_aTimes, title, style); @@ -434,6 +430,8 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) // wxLogWindow and wxLogFrame implementation // ---------------------------------------------------------------------------- +#if wxUSE_LOGWINDOW + // log frame class // --------------- class wxLogFrame : public wxFrame @@ -687,6 +685,8 @@ wxLogWindow::~wxLogWindow() delete m_pLogFrame; } +#endif // wxUSE_LOGWINDOW + // ---------------------------------------------------------------------------- // wxLogDialog // ---------------------------------------------------------------------------- @@ -776,21 +776,21 @@ wxLogDialog::wxLogDialog(wxWindow *parent, switch ( style & wxICON_MASK ) { case wxICON_ERROR: - bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); + bitmap = wxArtProvider::GetBitmap(wxART_ERROR, wxART_MESSAGE_BOX); #ifdef __WXPM__ bitmap.SetId(wxICON_SMALL_ERROR); #endif break; case wxICON_INFORMATION: - bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); + bitmap = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_MESSAGE_BOX); #ifdef __WXPM__ bitmap.SetId(wxICON_SMALL_INFO); #endif break; case wxICON_WARNING: - bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); + bitmap = wxArtProvider::GetBitmap(wxART_WARNING, wxART_MESSAGE_BOX); #ifdef __WXPM__ bitmap.SetId(wxICON_SMALL_WARNING); #endif @@ -913,7 +913,7 @@ void wxLogDialog::CreateDetailsControls() if ( !fmt ) { // default format - fmt = wxDefaultDateTimeFormat; + fmt = _T("%c"); } size_t count = m_messages.GetCount(); @@ -999,7 +999,7 @@ void wxLogDialog::OnSave(wxCommandEvent& WXUNUSED(event)) if ( !fmt ) { // default format - fmt = wxDefaultDateTimeFormat; + fmt = _T("%c"); } size_t count = m_messages.GetCount(); @@ -1122,7 +1122,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) SetSize(wxDefaultCoord, size.y); #ifdef __WXGTK__ - // VS: this is neccessary in order to force frame redraw under + // VS: this is necessary in order to force frame redraw under // WindowMaker or fvwm2 (and probably other broken WMs). // Otherwise, detailed list wouldn't be displayed. Show(); @@ -1157,7 +1157,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent) // open file // --------- - bool bOk; + bool bOk wxDUMMY_INITIALIZE(false); if ( wxFile::Exists(filename) ) { bool bAppend = false; wxString strMsg; @@ -1222,4 +1222,3 @@ void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) } #endif // wxUSE_LOG && wxUSE_TEXTCTRL -