]>
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()
56 wxMessageOutput
* wxMessageOutput::Set(wxMessageOutput
* msgout
)
58 wxMessageOutput
* old
= ms_msgOut
;
63 // ----------------------------------------------------------------------------
64 // wxMessageOutputStderr
65 // ----------------------------------------------------------------------------
67 void wxMessageOutputStderr::Printf(const wxChar
* format
, ...)
70 va_start(args
, format
);
73 out
.PrintfV(format
, args
);
76 fprintf(stderr
, "%s", out
.mb_str());
79 // ----------------------------------------------------------------------------
80 // wxMessageOutputMessageBox
81 // ----------------------------------------------------------------------------
85 void wxMessageOutputMessageBox::Printf(const wxChar
* format
, ...)
88 va_start(args
, format
);
91 out
.PrintfV(format
, args
);
95 out
.Replace("\t"," ");
102 // ----------------------------------------------------------------------------
103 // wxMessageOutputLog
104 // ----------------------------------------------------------------------------
106 #if wxUSE_GUI && defined(__WXMOTIF__)
108 void wxMessageOutputLog::Printf(const wxChar
* format
, ...)
111 va_start(args
, format
);
114 out
.PrintfV(format
, args
);
117 out
.Replace("\t"," ");
118 // under Motif, wxMessageDialog needs a parent window, so we use
119 // wxLog, which is better than nothing
120 ::wxLogMessage("%s", out
.c_str());