]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/log.cpp
A few weeks of Unicode fixes (my old win95 laptop compiles sloowly,
[wxWidgets.git] / src / common / log.cpp
index 0a3e9bdd92fa117bf4ac3a6e9dd62a6f6a3248c0..2f8b2c0a0ab1747e00b6bb70f23da8ad2fc5022a 100644 (file)
 
 // wxWindows
 #ifndef WX_PRECOMP
-  #include  <wx/event.h>
-  #include  <wx/app.h>
-  #include  <wx/string.h>
-  #include  <wx/intl.h>
-  #include  <wx/menu.h>
-  #include  <wx/frame.h>
-  #include  <wx/msgdlg.h>
-  #include  <wx/filedlg.h>
-  #include  <wx/textctrl.h>
+  #include "wx/window.h"
+#ifdef __WXMSW__
+  #include "wx/msw/private.h"
+#endif
+  #include  "wx/event.h"
+  #include  "wx/app.h"
+  #include  "wx/string.h"
+  #include  "wx/intl.h"
+  #include  "wx/menu.h"
+  #include  "wx/frame.h"
+  #include  "wx/msgdlg.h"
+  #include  "wx/filedlg.h"
+  #include  "wx/textctrl.h"
 #endif //WX_PRECOMP
 
-#include  <wx/file.h>
-#include  <wx/textfile.h>
-#include  <wx/utils.h>
-#include  <wx/log.h>
+#include  "wx/file.h"
+#include  "wx/textfile.h"
+#include  "wx/utils.h"
+#include  "wx/log.h"
 
 // other standard headers
 #include  <errno.h>
@@ -349,7 +353,7 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
     }
 }
 
-void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t t)
+void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t))
 {
     wxFAIL_MSG(_T("DoLogString must be overriden if it's called."));
 }
@@ -371,7 +375,7 @@ wxLogStderr::wxLogStderr(FILE *fp)
         m_fp = fp;
 }
 
-void wxLogStderr::DoLogString(const wxChar *szString, time_t t)
+void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
 {
     wxString str(szString);
     str << _T('\n');
@@ -399,9 +403,9 @@ wxLogStream::wxLogStream(ostream *ostr)
         m_ostr = ostr;
 }
 
-void wxLogStream::DoLogString(const wxChar *szString, time_t t)
+void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
 {
-    (*m_ostr) << szString << endl << flush;
+    (*m_ostr) << wxConv_libc.cWX2MB(szString) << endl << flush;
 }
 #endif // wxUSE_STD_IOSTREAM
 
@@ -505,6 +509,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
                 break;
 
         case wxLOG_Status:
+#if wxUSE_STATUSBAR
                 {
                     // find the top window and set it's status text if it has any
                     wxFrame *pFrame = gs_pFrame;
@@ -518,6 +523,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
                     if ( pFrame != NULL )
                         pFrame->SetStatusText(szString);
                 }
+#endif // wxUSE_STATUSBAR
                 break;
 
         case wxLOG_Trace:
@@ -584,7 +590,9 @@ public:
     // menu callbacks
     void OnClose(wxCommandEvent& event);
     void OnCloseWindow(wxCloseEvent& event);
+#if wxUSE_FILE
     void OnSave (wxCommandEvent& event);
+#endif // wxUSE_FILE
     void OnClear(wxCommandEvent& event);
 
     void OnIdle(wxIdleEvent&);
@@ -612,7 +620,9 @@ private:
 BEGIN_EVENT_TABLE(wxLogFrame, wxFrame)
     // wxLogWindow menu events
     EVT_MENU(Menu_Close, wxLogFrame::OnClose)
+#if wxUSE_FILE
     EVT_MENU(Menu_Save,  wxLogFrame::OnSave)
+#endif // wxUSE_FILE
     EVT_MENU(Menu_Clear, wxLogFrame::OnClear)
 
     EVT_CLOSE(wxLogFrame::OnCloseWindow)
@@ -632,15 +642,19 @@ wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle
     // create menu
     wxMenuBar *pMenuBar = new wxMenuBar;
     wxMenu *pMenu = new wxMenu;
+#if wxUSE_FILE
     pMenu->Append(Menu_Save,  _("&Save..."), _("Save log contents to file"));
+#endif // wxUSE_FILE
     pMenu->Append(Menu_Clear, _("C&lear"), _("Clear the log contents"));
     pMenu->AppendSeparator();
     pMenu->Append(Menu_Close, _("&Close"), _("Close this window"));
     pMenuBar->Append(pMenu, _("&Log"));
     SetMenuBar(pMenuBar);
 
+#if wxUSE_STATUSBAR
     // status bar for menu prompts
     CreateStatusBar();
+#endif // wxUSE_STATUSBAR
 
     m_log->OnFrameCreate(this);
 }
@@ -655,6 +669,7 @@ void wxLogFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
     DoClose();
 }
 
+#if wxUSE_FILE
 void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
 {
     // get the file name
@@ -725,6 +740,7 @@ void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event))
         wxLogStatus(this, _("Log saved to the file '%s'."), szFileName);
     }
 }
+#endif // wxUSE_FILE
 
 void wxLogFrame::OnClear(wxCommandEvent& WXUNUSED(event))
 {
@@ -739,9 +755,9 @@ wxLogFrame::~wxLogFrame()
 // wxLogWindow
 // -----------
 wxLogWindow::wxLogWindow(wxFrame *pParent,
-        const wxChar *szTitle,
-        bool bShow,
-        bool bDoPass)
+                         const wxChar *szTitle,
+                         bool bShow,
+                         bool bDoPass)
 {
     m_bPassMessages = bDoPass;
 
@@ -805,7 +821,7 @@ void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
     m_bHasMessages = TRUE;
 }
 
-void wxLogWindow::DoLogString(const wxChar *szString, time_t t)
+void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
 {
     // put the text into our window
     wxTextCtrl *pText = m_pLogFrame->TextCtrl();