1. made wxDebugMsg, wxError and wxFatalError deprecated (still available

with WXWIN_COMPATIBILITY_2_2)
2. moved wxInternalErrorStr and wxFatalErrorStr to a common file
CVS: ----------------------------------------------------------------------
CVS: Enter Log.  Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: 	include/wx/app.h include/wx/chkconf.h include/wx/utils.h
CVS: 	src/common/appcmn.cpp src/common/fontmap.cpp
CVS: 	src/common/utilscmn.cpp src/gtk/data.cpp src/mac/data.cpp
CVS: 	src/mac/utils.cpp src/msw/data.cpp src/msw/utils.cpp
CVS: 	src/os2/DATA.CPP src/os2/UTILS.CPP src/unix/utilsunx.cpp
CVS: ----------------------------------------------------------------------


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-02-22 18:18:36 +00:00
parent 6962f34ea5
commit 73deed44e6
16 changed files with 51 additions and 27 deletions

View File

@@ -287,10 +287,6 @@ public:
// (such as wxMGL). This method should be called from wxApp:OnInitGui
virtual bool SetDisplayMode(const wxDisplayModeInfo& WXUNUSED(info)) { return TRUE; }
// VZ: what does this do exactly?
void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; }
bool GetWantDebugOutput() const { return m_wantDebugOutput; }
// set use of best visual flag (see below)
void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; }
bool GetUseBestVisual() const { return m_useBestVisual; }
@@ -318,6 +314,18 @@ public:
virtual void OnAssert(const wxChar *file, int line, const wxChar *msg);
#endif // __WXDEBUG__
// deprecated functions, please updae your code to not use them!
// -------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_2
// used by obsolete wxDebugMsg only
void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; }
bool GetWantDebugOutput() const { return m_wantDebugOutput; }
// TRUE if the application wants to get debug output
bool m_wantDebugOutput;
#endif // WXWIN_COMPATIBILITY_2_2
// implementation only from now on
// -------------------------------
@@ -343,9 +351,6 @@ protected:
m_appName, // app name
m_className; // class name
// TRUE if the application wants to get debug output
bool m_wantDebugOutput;
#if wxUSE_GUI
// the main top level window - may be NULL
wxWindow *m_topWindow;

View File

@@ -441,6 +441,8 @@ void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
// Error message functions used by wxWindows (deprecated, use wxLog)
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_2
// Format a message on the standard error (UNIX) or the debugging
// stream (Windows)
WXDLLEXPORT void wxDebugMsg(const wxChar *fmt ...);
@@ -453,6 +455,7 @@ WXDLLEXPORT void wxError(const wxString& msg, const wxString& title = wxInternal
WXDLLEXPORT_DATA(extern const wxChar*) wxFatalErrorStr;
WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
#endif // WXWIN_COMPATIBILITY_2_2
#endif
// _WX_UTILSH__

View File

@@ -80,8 +80,9 @@ wxAppBase::wxAppBase()
{
wxTheApp = (wxApp *)this;
// VZ: what's this? is it obsolete?
#if WXWIN_COMPATIBILITY_2_2
m_wantDebugOutput = FALSE;
#endif // WXWIN_COMPATIBILITY_2_2
#if wxUSE_GUI
m_topWindow = (wxWindow *)NULL;

View File

@@ -743,9 +743,9 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
// message
if ( encoding == wxFONTENCODING_SYSTEM )
{
wxFatalError(_("can't load any font, aborting"));
wxLogFatalError(_("can't load any font, aborting"));
// wxFatalError doesn't return
// wxLogFatalError doesn't return
}
wxString configEntry,

View File

@@ -90,6 +90,15 @@
#include "wx/msw/private.h"
#endif
// ----------------------------------------------------------------------------
// common data
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_2
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
#endif // WXWIN_COMPATIBILITY_2_2
// ----------------------------------------------------------------------------
// function protoypes
// ----------------------------------------------------------------------------

View File

@@ -157,8 +157,6 @@ const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
const wxChar *wxMessageBoxCaptionStr = wxT("Message");
const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*");
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar *wxDirDialogDefaultFolderStr = wxT("/");
const wxChar *wxTreeCtrlNameStr = wxT("wxTreeCtrl");

View File

@@ -157,8 +157,6 @@ const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
const wxChar *wxMessageBoxCaptionStr = wxT("Message");
const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*");
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar *wxDirDialogDefaultFolderStr = wxT("/");
const wxChar *wxTreeCtrlNameStr = wxT("wxTreeCtrl");

View File

@@ -125,8 +125,6 @@ const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
const wxChar *wxMessageBoxCaptionStr = wxT("Message");
const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*.*");
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl");
const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar *wxDirDialogDefaultFolderStr = wxT("/");

View File

@@ -164,6 +164,8 @@ void wxFlushEvents()
{
}
#if WXWIN_COMPATIBILITY_2_2
// Output a debug message, in a system dependent fashion.
void wxDebugMsg(const char *fmt ...)
{
@@ -198,6 +200,9 @@ void wxFatalError(const wxString& msg, const wxString& title)
wxMessageBox(wxBuffer);
wxExit();
}
#endif // WXWIN_COMPATIBILITY_2_2
#endif // !__DARWIN__
// Emit a beeeeeep

View File

@@ -125,8 +125,6 @@ const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
const wxChar *wxMessageBoxCaptionStr = wxT("Message");
const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*.*");
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl");
const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar *wxDirDialogDefaultFolderStr = wxT("/");

View File

@@ -164,6 +164,8 @@ void wxFlushEvents()
{
}
#if WXWIN_COMPATIBILITY_2_2
// Output a debug message, in a system dependent fashion.
void wxDebugMsg(const char *fmt ...)
{
@@ -198,6 +200,9 @@ void wxFatalError(const wxString& msg, const wxString& title)
wxMessageBox(wxBuffer);
wxExit();
}
#endif // WXWIN_COMPATIBILITY_2_2
#endif // !__DARWIN__
// Emit a beeeeeep

View File

@@ -135,8 +135,6 @@ const wxChar *wxGetTextFromUserPromptStr = wxT("Input Text");
const wxChar *wxMessageBoxCaptionStr = wxT("Message");
const wxChar *wxFileSelectorPromptStr = wxT("Select a file");
const wxChar *wxFileSelectorDefaultWildcardStr = wxT("*.*");
const wxChar *wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar *wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl");
const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar *wxDirDialogDefaultFolderStr = wxT("/");

View File

@@ -1059,7 +1059,7 @@ void wxSleep(int nSecs)
// deprecated (in favour of wxLog) log functions
// ----------------------------------------------------------------------------
#if wxUSE_GUI
#if WXWIN_COMPATIBILITY_2_2
// Output a debug mess., in a system dependent fashion.
#ifndef __WXMICROWIN__
@@ -1096,6 +1096,10 @@ void wxFatalError(const wxString& msg, const wxString& title)
}
#endif // __WXMICROWIN__
#endif // WXWIN_COMPATIBILITY_2_2
#if wxUSE_GUI
// ----------------------------------------------------------------------------
// functions to work with .INI files
// ----------------------------------------------------------------------------
@@ -1468,10 +1472,6 @@ WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
#endif // Win16/32
}
#endif // wxUSE_GUI
#if wxUSE_GUI
// ----------------------------------------------------------------------------
// Metafile helpers
// ----------------------------------------------------------------------------

View File

@@ -132,8 +132,6 @@ const wxChar* wxGetTextFromUserPromptStr = wxT("Inpu
const wxChar* wxMessageBoxCaptionStr = wxT("Message");
const wxChar* wxFileSelectorPromptStr = wxT("Select a file");
const wxChar* wxFileSelectorDefaultWildcardStr = wxT("*.*");
const wxChar* wxInternalErrorStr = wxT("wxWindows Internal Error");
const wxChar* wxFatalErrorStr = wxT("wxWindows Fatal Error");
const wxChar* wxTreeCtrlNameStr = wxT("treeCtrl");
const wxChar* wxDirDialogNameStr = wxT("wxDirCtrl");
const wxChar* wxDirDialogDefaultFolderStr = wxT("/");

View File

@@ -291,6 +291,8 @@ void wxFlushEvents()
// wxYield();
}
#if WXWIN_COMPATIBILITY_2_2
// Output a debug mess., in a system dependent fashion.
void wxDebugMsg(
const wxChar* zFmt ...
@@ -343,6 +345,8 @@ void wxFatalError(
DosExit(EXIT_PROCESS, ulRc);
}
#endif // WXWIN_COMPATIBILITY_2_2
// Emit a beeeeeep
void wxBell()
{

View File

@@ -1165,6 +1165,8 @@ bool wxHandleFatalExceptions(bool doit)
// error and debug output routines (deprecated, use wxLog)
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_2
void wxDebugMsg( const char *format, ... )
{
va_list ap;
@@ -1191,3 +1193,5 @@ void wxFatalError( const wxString &msg, const wxString &title )
exit(3); // the same exit code as for abort()
}
#endif // WXWIN_COMPATIBILITY_2_2