From 8d4d901c4d9a37c0a9d820f61a62a5df58b7e74f Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 27 Aug 2008 12:47:53 +0000 Subject: [PATCH] Patch level : 10.0 109 Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 1208 git-svn-id: svn://10.65.10.50/trunk@17107 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/oswin32.cpp | 7 +++++++ xvaga/oswin32.h | 1 + xvaga/xvaga.cpp | 21 +++++++++++++++++++++ xvaga/xvt.h | 1 + 4 files changed, 30 insertions(+) diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index 438535cc3..d6bb8bc50 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -1017,3 +1017,10 @@ void OsWin32_NumberFormat(char* str, int size) ::GetNumberFormat(LOCALE_USER_DEFAULT, 0, str, NULL, buf, sizeof(buf)); wxStrncpy(str, buf, size); } + +void OsWin32_NumberFormat(char* str, int size) +{ + char buf[80]; + ::GetNumberFormat(LOCALE_USER_DEFAULT, 0, str, NULL, buf, sizeof(buf)); + wxStrncpy(str, buf, size); +} diff --git a/xvaga/oswin32.h b/xvaga/oswin32.h index 902bc00a0..f40d74a85 100755 --- a/xvaga/oswin32.h +++ b/xvaga/oswin32.h @@ -22,6 +22,7 @@ long OsWin32_CloseChildren(unsigned int parent); void OsWin32_NumberFormat(char* str, int size); void OsWin32_UpdateWindow(unsigned int handle); +void OsWin32_NumberFormat(char* str, int size); int OsWin32_Help(WXHWND handle, const char* hlp, unsigned int cmd, const char* topic); bool OsWin32_TestNetworkVersion(); diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 946eb1f6a..6a2a8b3a5 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -3388,6 +3388,27 @@ char* xvt_str_number_format(char* str, int size) return str; } +char* xvt_str_number_format(char* str, int size) +{ +#ifdef WIN32 + OsWin32_NumberFormat(str, size); +#else + wxString txt; + for (const char* s = str; *s; s++) + { + if (isdigit(*s)) + txt << *s; + else + { + if (*s == '.') + txt << ','; + } + } + wxStrncpy(str, txt, size); +#endif + return str; +} + BOOLEAN xvt_str_match(const char* mbs, const char *pat, BOOLEAN case_sensitive) { /* diff --git a/xvaga/xvt.h b/xvaga/xvt.h index 98da3ed4e..0bf64ffb0 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -323,6 +323,7 @@ XVTDLL double xvt_str_fuzzy_compare (const char* s1, const char* s2); XVTDLL double xvt_str_fuzzy_compare_ignoring_case(const char* s1, const char* s2); XVTDLL void xvt_str_make_upper(char* str); XVTDLL void xvt_str_make_lower(char* str); +XVTDLL char* xvt_str_number_format(char* str, int size); XVTDLL BOOLEAN xvt_str_md5(const char* instr, char* outstr32); XVTDLL char* xvt_str_number_format(char* str, int size);