]>
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"
45 // ===========================================================================
47 // ===========================================================================
49 wxMessageOutput
* wxMessageOutput::ms_msgOut
= 0;
51 wxMessageOutput
* wxMessageOutput::Get()
53 if ( !ms_msgOut
&& wxTheApp
)
55 ms_msgOut
= wxTheApp
->CreateMessageOutput();
61 wxMessageOutput
* wxMessageOutput::Set(wxMessageOutput
* msgout
)
63 wxMessageOutput
* old
= ms_msgOut
;
68 // ----------------------------------------------------------------------------
69 // wxMessageOutputStderr
70 // ----------------------------------------------------------------------------
72 void wxMessageOutputStderr::Printf(const wxChar
* format
, ...)
75 va_start(args
, format
);
78 out
.PrintfV(format
, args
);
81 fprintf(stderr
, "%s", (const char*) out
.mb_str());
84 // ----------------------------------------------------------------------------
85 // wxMessageOutputMessageBox
86 // ----------------------------------------------------------------------------
90 void wxMessageOutputMessageBox::Printf(const wxChar
* format
, ...)
93 va_start(args
, format
);
96 out
.PrintfV(format
, args
);
100 out
.Replace(wxT("\t"),wxT(" "));
107 // ----------------------------------------------------------------------------
108 // wxMessageOutputLog
109 // ----------------------------------------------------------------------------
111 void wxMessageOutputLog::Printf(const wxChar
* format
, ...)
116 va_start(args
, format
);
118 out
.PrintfV(format
, args
);
121 out
.Replace(wxT("\t"),wxT(" "));
123 ::wxLogMessage(wxT("%s"), out
.c_str());