1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMessageOutput class. Shows a message to the user
4 // Author: Mattia Barbon
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
20 #pragma interface "msgout.h"
24 #include "wx/wxchar.h"
26 // ----------------------------------------------------------------------------
27 // wxMessageOutput is a class abstracting formatted output target, i.e.
28 // something you can printf() to
29 // ----------------------------------------------------------------------------
31 class WXDLLEXPORT wxMessageOutput
34 virtual ~wxMessageOutput() { }
36 // show a message to the user
37 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
= 0;
39 // gets the current wxMessageOutput object
40 static wxMessageOutput
* Get();
42 // sets the global wxMessageOutput instance; returns the previous one
43 static wxMessageOutput
* Set(wxMessageOutput
* msgout
);
46 static wxMessageOutput
* ms_msgOut
;
49 // ----------------------------------------------------------------------------
50 // implementation which sends output to stderr
51 // ----------------------------------------------------------------------------
53 class WXDLLEXPORT wxMessageOutputStderr
: public wxMessageOutput
56 wxMessageOutputStderr() { }
58 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;
61 // ----------------------------------------------------------------------------
62 // implementation which shows output in a message box
63 // ----------------------------------------------------------------------------
67 class WXDLLEXPORT wxMessageOutputMessageBox
: public wxMessageOutput
70 wxMessageOutputMessageBox() { }
72 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;
77 // ----------------------------------------------------------------------------
78 // implementation using wxLog (mainly for backwards compatibility)
79 // ----------------------------------------------------------------------------
81 class WXDLLEXPORT wxMessageOutputLog
: public wxMessageOutput
84 wxMessageOutputLog() { }
86 virtual void Printf(const wxChar
* format
, ...) ATTRIBUTE_PRINTF_2
;