From e12c92c2f7829e0d4666c0464e6c0d5b622768cc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 10 Apr 2003 13:08:46 +0000 Subject: [PATCH] moved wxFloat/DoubleToStringStr from src/*/data.cpp to src/common/utils.cpp; took all String <-> Numebr functions inside WXWIN_COMPATIBILITY_2_4 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/utils.h | 5 +++++ src/common/utilscmn.cpp | 11 +++++++++++ src/mac/carbon/data.cpp | 4 ---- src/mac/data.cpp | 4 ---- src/mgl/data.cpp | 4 ---- src/motif/data.cpp | 5 ----- src/msw/data.cpp | 4 ---- src/os2/data.cpp | 4 ---- src/x11/data.cpp | 5 ----- 9 files changed, 16 insertions(+), 30 deletions(-) diff --git a/include/wx/utils.h b/include/wx/utils.h index afcc70a726..d91baabc48 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -127,6 +127,9 @@ WXDLLEXPORT long wxGetCurrentId(); // Various conversions // ---------------------------------------------------------------------------- +// these functions are deprecated, use wxString methods instead! +#if WXWIN_COMPATIBILITY_2_4 + WXDLLEXPORT_DATA(extern const wxChar*) wxFloatToStringStr; WXDLLEXPORT_DATA(extern const wxChar*) wxDoubleToStringStr; @@ -139,6 +142,8 @@ WXDLLEXPORT void StringToLong(const wxChar *s, long *number); WXDLLEXPORT wxChar* IntToString(int number); WXDLLEXPORT wxChar* LongToString(long number); +#endif // WXWIN_COMPATIBILITY_2_4 + // Convert 2-digit hex number to decimal WXDLLEXPORT int wxHexToDec(const wxString& buf); diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index ae8c7e79dc..93aa19f675 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -133,6 +133,15 @@ wxRegisterId (long id) wxCurrentId = id + 1; } +// ---------------------------------------------------------------------------- +// String <-> Number conversions (deprecated) +// ---------------------------------------------------------------------------- + +#if WXWIN_COMPATIBILITY_2_4 + +WXDLLEXPORT_DATA(const wxChar *) wxFloatToStringStr = wxT("%.2f"); +WXDLLEXPORT_DATA(const wxChar *) wxDoubleToStringStr = wxT("%.2f"); + void StringToFloat (const wxChar *s, float *number) { @@ -197,6 +206,8 @@ LongToString (long number) return buf; } +#endif // WXWIN_COMPATIBILITY_2_4 + // Array used in DecToHex conversion routine. static wxChar hexArray[] = wxT("0123456789ABCDEF"); diff --git a/src/mac/carbon/data.cpp b/src/mac/carbon/data.cpp index 6b56b896dc..d0aceaf40a 100644 --- a/src/mac/carbon/data.cpp +++ b/src/mac/carbon/data.cpp @@ -126,10 +126,6 @@ const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl"); const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl"); const wxChar *wxDirDialogDefaultFolderStr = wxT("/"); -// See wx/utils.h -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - #if wxUSE_SHARED_LIBRARY ///// Event tables (also must be in one, statically-linked file for shared libraries) diff --git a/src/mac/data.cpp b/src/mac/data.cpp index 6b56b896dc..d0aceaf40a 100644 --- a/src/mac/data.cpp +++ b/src/mac/data.cpp @@ -126,10 +126,6 @@ const wxChar *wxTreeCtrlNameStr = wxT("treeCtrl"); const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl"); const wxChar *wxDirDialogDefaultFolderStr = wxT("/"); -// See wx/utils.h -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - #if wxUSE_SHARED_LIBRARY ///// Event tables (also must be in one, statically-linked file for shared libraries) diff --git a/src/mgl/data.cpp b/src/mgl/data.cpp index 931b04062e..bd9a78ccd5 100644 --- a/src/mgl/data.cpp +++ b/src/mgl/data.cpp @@ -168,10 +168,6 @@ const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl"); const wxChar *wxDirDialogDefaultFolderStr = wxT("/"); const wxChar *wxTreeCtrlNameStr = wxT("wxTreeCtrl"); -/* See wx/utils.h */ -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - /* Dafaults for wxWindow etc. */ const wxSize wxDefaultSize(-1, -1); const wxPoint wxDefaultPosition(-1, -1); diff --git a/src/motif/data.cpp b/src/motif/data.cpp index ae0b7368c6..a8d3b651b9 100644 --- a/src/motif/data.cpp +++ b/src/motif/data.cpp @@ -122,10 +122,5 @@ const wxChar *wxTreeCtrlNameStr = wxT("wxTreeCtrl"); const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl"); const wxChar *wxDirDialogDefaultFolderStr = wxT("/"); -// See wx/utils.h -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - - const wxSize wxDefaultSize(-1, -1); const wxPoint wxDefaultPosition(-1, -1); diff --git a/src/msw/data.cpp b/src/msw/data.cpp index 586b760059..94b3342d73 100644 --- a/src/msw/data.cpp +++ b/src/msw/data.cpp @@ -140,10 +140,6 @@ WXDLLEXPORT_DATA(const wxChar *) wxTreeCtrlNameStr = wxT("treeCtrl"); WXDLLEXPORT_DATA(const wxChar *) wxDirDialogNameStr = wxT("wxDirCtrl"); WXDLLEXPORT_DATA(const wxChar *) wxDirDialogDefaultFolderStr = wxT("/"); -// See wx/utils.h -WXDLLEXPORT_DATA(const wxChar *) wxFloatToStringStr = wxT("%.2f"); -WXDLLEXPORT_DATA(const wxChar *) wxDoubleToStringStr = wxT("%.2f"); - #ifdef __WXMSW__ WXDLLEXPORT_DATA(const wxChar *) wxUserResourceStr = wxT("TEXT"); #endif diff --git a/src/os2/data.cpp b/src/os2/data.cpp index 3b0395883c..df2a65f7d5 100644 --- a/src/os2/data.cpp +++ b/src/os2/data.cpp @@ -150,10 +150,6 @@ const wxChar* wxPanelClassNameNR = wxT("wxPa const wxChar* wxCanvasClassName = wxT("wxCanvasClass"); const wxChar* wxCanvasClassNameNR = wxT("wxCanvasClassNR"); -// See wx/utils.h -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - const wxChar *wxUserResourceStr = wxT("TEXT"); const wxSize wxDefaultSize(-1, -1); diff --git a/src/x11/data.cpp b/src/x11/data.cpp index ffd29c7587..35e6f643f0 100644 --- a/src/x11/data.cpp +++ b/src/x11/data.cpp @@ -122,10 +122,5 @@ const wxChar *wxDirDialogNameStr = wxT("wxDirCtrl"); const wxChar *wxDirDialogDefaultFolderStr = wxT("/"); const wxChar *wxTreeCtrlNameStr = wxT("wxTreeCtrl"); -/* See wx/utils.h */ -const wxChar *wxFloatToStringStr = wxT("%.2f"); -const wxChar *wxDoubleToStringStr = wxT("%.2f"); - - const wxSize wxDefaultSize(-1, -1); const wxPoint wxDefaultPosition(-1, -1);