projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compilation fix
[wxWidgets.git]
/
src
/
common
/
msgout.cpp
diff --git
a/src/common/msgout.cpp
b/src/common/msgout.cpp
index e162226ed61c8a88b3b15eb5534496c2d221da16..e6a079969e17786e54a2f96e19ca64e85389f0fb 100755
(executable)
--- a/
src/common/msgout.cpp
+++ b/
src/common/msgout.cpp
@@
-32,12
+32,14
@@
#include "wx/string.h"
#include "wx/ffile.h"
#include "wx/app.h"
#include "wx/string.h"
#include "wx/ffile.h"
#include "wx/app.h"
+ #include "wx/intl.h"
#if wxUSE_GUI
#include "wx/msgdlg.h"
#endif // wxUSE_GUI
#endif
#include "wx/msgout.h"
#if wxUSE_GUI
#include "wx/msgdlg.h"
#endif // wxUSE_GUI
#endif
#include "wx/msgout.h"
+#include "wx/log.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
@@
-50,16
+52,11
@@
wxMessageOutput* wxMessageOutput::ms_msgOut = 0;
wxMessageOutput* wxMessageOutput::Get()
{
wxMessageOutput* wxMessageOutput::Get()
{
- // FIXME this is an hack
- static bool inGet = FALSE;
-
- if(!ms_msgOut && wxTheApp && !inGet)
+ if ( !ms_msgOut && wxTheApp )
{
{
- inGet = TRUE;
- wxTheApp->DoInit();
+ ms_msgOut = wxTheApp->CreateMessageOutput();
}
}
- inGet = FALSE;
return ms_msgOut;
}
return ms_msgOut;
}
@@
-101,10
+98,16
@@
void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
out.PrintfV(format, args);
va_end(args);
out.PrintfV(format, args);
va_end(args);
+ // the native MSW msg box understands the TABs, others don't
#ifndef __WXMSW__
#ifndef __WXMSW__
- out.Replace(wxT("\t"),wxT(" "));
+ out.Replace(wxT("\t"),
wxT(" "));
#endif
#endif
- ::wxMessageBox(out);
+
+ wxString title;
+ if ( wxTheApp )
+ title.Printf(_("%s message"), wxTheApp->GetAppName().c_str());
+
+ ::wxMessageBox(out, title);
}
#endif // wxUSE_GUI
}
#endif // wxUSE_GUI
@@
-115,15
+118,15
@@
void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
void wxMessageOutputLog::Printf(const wxChar* format, ...)
{
void wxMessageOutputLog::Printf(const wxChar* format, ...)
{
+ wxString out;
+
va_list args;
va_start(args, format);
va_list args;
va_start(args, format);
- wxString out;
out.PrintfV(format, args);
va_end(args);
out.PrintfV(format, args);
va_end(args);
- out.Replace(wxT("\t"),wxT(" "));
- // under Motif, wxMessageDialog needs a parent window, so we use
- // wxLog, which is better than nothing
+ out.Replace(wxT("\t"), wxT(" "));
+
::wxLogMessage(wxT("%s"), out.c_str());
}
::wxLogMessage(wxT("%s"), out.c_str());
}