]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/msgout.cpp
added wxSpinCtrl::SetSelection()
[wxWidgets.git] / src / common / msgout.cpp
index c677a6bef1a0689cde93f51fc93df1d3dfc61f37..fa0667ab21b4c3ed2d7e9e89e6ffaaa4b430d8a0 100755 (executable)
@@ -50,6 +50,11 @@ wxMessageOutput* wxMessageOutput::ms_msgOut = 0;
 
 wxMessageOutput* wxMessageOutput::Get()
 {
+    if ( !ms_msgOut && wxTheApp )
+    {
+        ms_msgOut = wxTheApp->CreateMessageOutput();
+    }
+
     return ms_msgOut;
 }
 
@@ -73,7 +78,7 @@ void wxMessageOutputStderr::Printf(const wxChar* format, ...)
     out.PrintfV(format, args);
     va_end(args);
 
-    fprintf(stderr, "%s", out.mb_str());
+    fprintf(stderr, "%s", (const char*) out.mb_str());
 }
 
 // ----------------------------------------------------------------------------
@@ -92,7 +97,7 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
     va_end(args);
 
 #ifndef __WXMSW__
-    out.Replace("\t","        ");
+    out.Replace(wxT("\t"),wxT("        "));
 #endif
     ::wxMessageBox(out);
 }
@@ -103,21 +108,17 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
 // wxMessageOutputLog
 // ----------------------------------------------------------------------------
 
-#if wxUSE_GUI && defined(__WXMOTIF__)
-
 void wxMessageOutputLog::Printf(const wxChar* format, ...)
 {
+    wxString out;
+
     va_list args;
     va_start(args, format);
-    wxString out;
 
     out.PrintfV(format, args);
     va_end(args);
 
-    out.Replace("\t","        ");
-    // under Motif, wxMessageDialog needs a parent window, so we use
-    // wxLog, which is better than nothing
-    ::wxLogMessage("%s", out.c_str());
-}
+    out.Replace(wxT("\t"),wxT("        "));
 
-#endif // wxUSE_GUI
+    ::wxLogMessage(wxT("%s"), out.c_str());
+}