]>
git.saurik.com Git - wxWidgets.git/blob - src/common/msgout.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: common/msgout.cpp
3 // Purpose: wxMessageOutput implementation
4 // Author: Mattia Barbon
8 // Copyright: (c) the wxWindows team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
21 #pragma implementation "msgout.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
27 #if defined(__BORLANDC__)
32 #include "wx/string.h"
36 #include "wx/msgdlg.h"
40 #include "wx/msgout.h"
46 // ===========================================================================
48 // ===========================================================================
50 wxMessageOutput
* wxMessageOutput::ms_msgOut
= 0;
52 wxMessageOutput
* wxMessageOutput::Get()
54 if ( !ms_msgOut
&& wxTheApp
)
56 ms_msgOut
= wxTheApp
->CreateMessageOutput();
62 wxMessageOutput
* wxMessageOutput::Set(wxMessageOutput
* msgout
)
64 wxMessageOutput
* old
= ms_msgOut
;
69 // ----------------------------------------------------------------------------
70 // wxMessageOutputStderr
71 // ----------------------------------------------------------------------------
73 void wxMessageOutputStderr::Printf(const wxChar
* format
, ...)
76 va_start(args
, format
);
79 out
.PrintfV(format
, args
);
82 fprintf(stderr
, "%s", (const char*) out
.mb_str());
85 // ----------------------------------------------------------------------------
86 // wxMessageOutputMessageBox
87 // ----------------------------------------------------------------------------
91 void wxMessageOutputMessageBox::Printf(const wxChar
* format
, ...)
94 va_start(args
, format
);
97 out
.PrintfV(format
, args
);
101 out
.Replace(wxT("\t"),wxT(" "));
108 // ----------------------------------------------------------------------------
109 // wxMessageOutputLog
110 // ----------------------------------------------------------------------------
112 void wxMessageOutputLog::Printf(const wxChar
* format
, ...)
117 va_start(args
, format
);
119 out
.PrintfV(format
, args
);
122 out
.Replace(wxT("\t"),wxT(" "));
124 ::wxLogMessage(wxT("%s"), out
.c_str());