#include <stdarg.h>
#include <stdio.h>
-#if defined(__WXMSW__) && !defined(__WXPALMOS__)
+#if defined(__WXMSW__)
#include "wx/msw/private.h"
#endif
#ifdef __WXMAC__
return old;
}
+// ----------------------------------------------------------------------------
+// wxMessageOutputBest
+// ----------------------------------------------------------------------------
+
+void wxMessageOutputBest::Printf(const wxChar* format, ...)
+{
+ va_list args;
+ va_start(args, format);
+ wxString out;
+
+ out.PrintfV(format, args);
+ va_end(args);
+
+#ifdef __WINDOWS__
+ // check if we're running in a console
+ HANDLE hStdErr = ::GetStdHandle(STD_ERROR_HANDLE);
+ if ( !hStdErr || hStdErr == INVALID_HANDLE_VALUE )
+ {
+ ::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK);
+ }
+ else
+#endif // __WINDOWS__/!__WINDOWS__
+ {
+ fprintf(stderr, "%s", (const char*) out.mb_str());
+ }
+}
+
// ----------------------------------------------------------------------------
// wxMessageOutputStderr
// ----------------------------------------------------------------------------
out.PrintfV(format, args);
va_end(args);
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__) && !defined(__WXPALMOS__)
+#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
out.Replace(wxT("\t"), wxT(" "));
out.Replace(wxT("\n"), wxT("\r\n"));
::OutputDebugString(out);