From: Vadim Zeitlin Date: Fri, 22 Feb 2002 18:18:36 +0000 (+0000) Subject: 1. made wxDebugMsg, wxError and wxFatalError deprecated (still available X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/73deed44e63d9d8d21a2ef6182bc685edc2bb0f9?hp=6962f34ea5bf7a931bb9b636f46ad1316473a724 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 --- diff --git a/include/wx/app.h b/include/wx/app.h index 88258c10fe..96f284a7e2 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -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; diff --git a/include/wx/utils.h b/include/wx/utils.h index fd8f12f022..854711fa9a 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -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__ diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 6795eec0c4..dca1e2af50 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -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; diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 6ab97b4c2f..022d92d0e3 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -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, diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 807d65453f..a3b74371c1 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -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 // ---------------------------------------------------------------------------- diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp index ba8a0ba0e5..4979216dae 100644 --- a/src/gtk/data.cpp +++ b/src/gtk/data.cpp @@ -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"); diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp index ba8a0ba0e5..4979216dae 100644 --- a/src/gtk1/data.cpp +++ b/src/gtk1/data.cpp @@ -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"); diff --git a/src/mac/carbon/data.cpp b/src/mac/carbon/data.cpp index a504169614..a4bf881e66 100644 --- a/src/mac/carbon/data.cpp +++ b/src/mac/carbon/data.cpp @@ -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("/"); diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 2e2ffd6c4a..4cd5021df4 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -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 diff --git a/src/mac/data.cpp b/src/mac/data.cpp index a504169614..a4bf881e66 100644 --- a/src/mac/data.cpp +++ b/src/mac/data.cpp @@ -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("/"); diff --git a/src/mac/utils.cpp b/src/mac/utils.cpp index 2e2ffd6c4a..4cd5021df4 100644 --- a/src/mac/utils.cpp +++ b/src/mac/utils.cpp @@ -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 diff --git a/src/msw/data.cpp b/src/msw/data.cpp index 9657bb89ed..8642adb452 100644 --- a/src/msw/data.cpp +++ b/src/msw/data.cpp @@ -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("/"); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index e66b56d51d..0ae445411b 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -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 // ---------------------------------------------------------------------------- diff --git a/src/os2/data.cpp b/src/os2/data.cpp index be9f7d2428..3b0395883c 100644 --- a/src/os2/data.cpp +++ b/src/os2/data.cpp @@ -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("/"); diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index c42628a26d..5ac046f10a 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -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() { diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 8503131014..da7aa73531 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -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 +