Added wxMessageOutput as per the discussion on wx-dev.

Added wxApp::DoInit to initialize the global wxMessageOutput instance.
Changed wxCommandLineParser to use wxMessageOutput.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2002-07-24 19:29:53 +00:00
parent 53d838be50
commit 74698d3a22
8 changed files with 287 additions and 56 deletions

View File

@@ -42,6 +42,7 @@
#include "wx/confbase.h"
#include "wx/tokenzr.h"
#include "wx/utils.h"
#include "wx/msgout.h"
#if wxUSE_GUI
#include "wx/artprov.h"
@@ -188,12 +189,27 @@ int wxAppBase::FilterEvent(wxEvent& WXUNUSED(event))
return -1;
}
void wxAppBase::DoInit()
{
if(wxMessageOutput::Get()) return;
#if wxUSE_GUI
#ifdef __WXMOTIF__
wxMessageOutput::Set(new wxMessageOutputLog);
#else
wxMessageOutput::Set(new wxMessageOutputMessageBox);
#endif
#else
wxMessageOutput::Set(new wxMessageOutputStderr);
#endif
}
// ----------------------------------------------------------------------------
// cmd line parsing
// ----------------------------------------------------------------------------
bool wxAppBase::OnInit()
{
DoInit();
#if wxUSE_CMDLINE_PARSER
wxCmdLineParser parser(argc, argv);