diff --git a/xvaga/oswin32.cpp b/xvaga/oswin32.cpp index f188a5318..d5709f337 100755 --- a/xvaga/oswin32.cpp +++ b/xvaga/oswin32.cpp @@ -1047,12 +1047,6 @@ int OsWin32_GetSessionId() return (int)session; } -//definito il valore della variabile intera SM_REMOTESESSION -// che non esiste per WINVER < 0x500 -#ifndef SM_REMOTESESSION -#define SM_REMOTESESSION 0x1000 -#endif - bool OsWin32_IsWindowsServer() { return ::GetSystemMetrics(SM_REMOTESESSION) != 0; @@ -1060,7 +1054,10 @@ bool OsWin32_IsWindowsServer() void OsWin32_NumberFormat(char* str, int size) { - char buf[80]; - ::GetNumberFormat(LOCALE_USER_DEFAULT, 0, str, NULL, buf, sizeof(buf)); - wxStrncpy(str, buf, size); + if (str && *str) + { + char buf[80] = ""; + ::GetNumberFormat(LOCALE_USER_DEFAULT, 0, str, NULL, buf, sizeof(buf)); + wxStrncpy(str, buf, size); + } } diff --git a/xvaga/wxinc.h b/xvaga/wxinc.h index 16565bde4..686a7d701 100755 --- a/xvaga/wxinc.h +++ b/xvaga/wxinc.h @@ -7,7 +7,7 @@ #define __WXMSW__ #define __WIN95__ #define __WIN32__ -#define WINVER 0x0400 +#define WINVER 0x0500 #define STRICT #define WXUSINGDLL 1 #include diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index b8fe829ed..8a76e74d6 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -47,6 +47,7 @@ long _startup_style = 0; wxString _startup_dir; wxString _strDefaultStatbarText; wxString _appl_name; +wxLocale* _locale = NULL; static wxHashTable _nice_icons; static XVT_ERRMSG_HANDLER _error_handler = NULL; @@ -411,9 +412,9 @@ XVTDLL void xvt_app_pre_create(void) xvt_fsys_get_default_dir(&dir); // Init Startup Directory wxString strResPath = dir.path; strResPath += "/res"; - wxLocale* pLoc = new wxLocale(wxLANGUAGE_DEFAULT); // wxLANGUAGE_ITALIAN - pLoc->AddCatalogLookupPathPrefix(strResPath); - pLoc->AddCatalog("wxstd", wxLanguage(pLoc->GetLanguage()), NULL); + _locale = new wxLocale(wxLANGUAGE_DEFAULT); // wxLANGUAGE_ITALIAN + _locale->AddCatalogLookupPathPrefix(strResPath); + _locale->AddCatalog("wxstd", wxLanguage(_locale->GetLanguage()), NULL); ::wxInitAllImageHandlers(); @@ -559,6 +560,12 @@ void xvt_app_destroy(void) #ifdef SPEECH_API xvt_dm_enable_speech(0x00); #endif + + if (_locale != NULL) + { + delete _locale; + _locale = NULL; + } } DRAW_CTOOLS* xvt_app_get_default_ctools(DRAW_CTOOLS *ct) diff --git a/xvaga/xvt.h b/xvaga/xvt.h index 61e0b9533..a4562b54c 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -216,6 +216,7 @@ XVTDLL int xvt_list_add_item(WINDOW win, short icon, const char* text, int f XVTDLL BOOLEAN xvt_list_clear(WINDOW win); XVTDLL BOOLEAN xvt_list_get_sel_index(WINDOW win); XVTDLL BOOLEAN xvt_list_set_sel(WINDOW win, int index, BOOLEAN select); +XVTDLL int xvt_list_count(WINDOW win); XVTDLL DATA_PTR xvt_mem_alloc(size_t size); XVTDLL void xvt_mem_free(DATA_PTR p); diff --git a/xvaga/xvtctl.cpp b/xvaga/xvtctl.cpp index ca9cdae34..bf43c2b5a 100755 --- a/xvaga/xvtctl.cpp +++ b/xvaga/xvtctl.cpp @@ -1483,6 +1483,15 @@ BOOLEAN xvt_list_set_sel(WINDOW win, int index, BOOLEAN select) return olb != NULL; } +int xvt_list_count(WINDOW win) +{ + int n = 0; + TwxOutlookBar* olb = wxDynamicCast((wxObject*)win, TwxOutlookBar); + if (olb != NULL) + n = olb->GetItemCount(); + return n; +} + /////////////////////////////////////////////////////////// // ToolBar ///////////////////////////////////////////////////////////