X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1ecc5db549ff33edbd630474e0dc0d8bee8fbc6..987263fe1974dac46a38d6d623557ccf89a25992:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index ac478978a8..daea3accf7 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -7,7 +7,7 @@ // Created: 20.09.99 (extracted from src/common/log.cpp) // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -18,7 +18,9 @@ // headers // ---------------------------------------------------------------------------- -// no #pragma implementation "log.h" because it's already in src/common/log.cpp +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) + #pragma implementation "logg.h" +#endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -27,10 +29,6 @@ #pragma hdrstop #endif -#if !wxUSE_GUI - #error "This file can't be compiled without GUI!" -#endif - #ifndef WX_PRECOMP #include "wx/app.h" #include "wx/button.h" @@ -59,6 +57,10 @@ #include "wx/msw/private.h" #endif // Windows +#ifdef __WXPM__ + #include +#endif + #if wxUSE_LOG_DIALOG #include "wx/listctrl.h" #include "wx/imaglist.h" @@ -67,6 +69,10 @@ #include "wx/msgdlg.h" #endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG +#if defined(__MWERKS__) && wxUSE_UNICODE + #include +#endif + // the suffix we add to the button to show that the dialog can be expanded #define EXPAND_SUFFIX _T(" >>") @@ -80,6 +86,10 @@ // 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)) ) { @@ -87,6 +97,7 @@ static wxString TimeStamp(const wxChar *format, time_t t) wxFAIL_MSG(_T("strftime() failed")); } return wxString(buf); +#endif } @@ -136,6 +147,7 @@ private: static wxString ms_details; DECLARE_EVENT_TABLE() + DECLARE_NO_COPY_CLASS(wxLogDialog) }; BEGIN_EVENT_TABLE(wxLogDialog, wxDialog) @@ -191,7 +203,11 @@ void wxVLogStatus(wxFrame *pFrame, const wxChar *szFormat, va_list argptr) wxASSERT( gs_pFrame == NULL ); // should be reset! gs_pFrame = pFrame; +#ifdef __WXWINCE__ + wxLog::OnLog(wxLOG_Status, msg, 0); +#else wxLog::OnLog(wxLOG_Status, msg, time(NULL)); +#endif gs_pFrame = (wxFrame *) NULL; } } @@ -425,8 +441,6 @@ public: #endif // wxUSE_FILE void OnClear(wxCommandEvent& event); - void OnIdle(wxIdleEvent&); - // accessors wxTextCtrl *TextCtrl() const { return m_pTextCtrl; } @@ -446,6 +460,7 @@ private: wxLogWindow *m_log; DECLARE_EVENT_TABLE() + DECLARE_NO_COPY_CLASS(wxLogFrame) }; BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) @@ -614,8 +629,6 @@ void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) wxLog::DoLog(level, szString, t); } } - - m_bHasMessages = TRUE; } void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) @@ -992,14 +1005,14 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) { m_btnDetails->SetLabel(ms_details + EXPAND_SUFFIX); - sizer->Remove(m_listctrl); + sizer->Detach( m_listctrl ); #if wxUSE_STATLINE - sizer->Remove(m_statline); + sizer->Detach( m_statline ); #endif // wxUSE_STATLINE #if wxUSE_FILE - sizer->Remove(m_btnSave); + sizer->Detach( m_btnSave ); #endif // wxUSE_FILE } else // show details now @@ -1142,7 +1155,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename) #endif // !(wxUSE_LOGGUI || wxUSE_LOGWINDOW) -#if wxUSE_TEXTCTRL +#if wxUSE_LOG && wxUSE_TEXTCTRL // ---------------------------------------------------------------------------- // wxLogTextCtrl implementation @@ -1158,17 +1171,9 @@ void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) wxString msg; TimeStamp(&msg); -#if defined(__WXMAC__) - // VZ: this is a bug in wxMac, it *must* accept '\n' as new line, the - // translation must be done in wxTextCtrl, not here! (FIXME) - msg << szString << wxT('\r'); -#else msg << szString << wxT('\n'); -#endif - m_pTextCtrl->AppendText(msg); } -#endif // wxUSE_TEXTCTRL +#endif // wxUSE_LOG && wxUSE_TEXTCTRL -// vi:sts=4:sw=4:et