summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
69c928e)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44773
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Implemented background colour in wxRichTextCtrl.
- Fixed crashes in helpview when opening a file.
- Added wxMutex::LockTimeout() (Aleksandr Napylov)
- Implemented background colour in wxRichTextCtrl.
- Fixed crashes in helpview when opening a file.
- Added wxMutex::LockTimeout() (Aleksandr Napylov)
+- Set locale to the default in all ports, not just wxGTK
// needed since this class declares virtual members
virtual ~wxAppTraitsBase() { }
// needed since this class declares virtual members
virtual ~wxAppTraitsBase() { }
- // hooks for creating the global objects, may be overridden by the user
+ // hooks for working with the global objects, may be overridden by the user
// ------------------------------------------------------------------------
#if wxUSE_LOG
// ------------------------------------------------------------------------
#if wxUSE_LOG
virtual wxStandardPathsBase& GetStandardPaths();
#endif // wxUSE_STDPATHS
virtual wxStandardPathsBase& GetStandardPaths();
#endif // wxUSE_STDPATHS
+#if wxUSE_INTL
+ // called during wxApp initialization to set the locale to correspond to
+ // the user default (i.e. system locale under Windows, LC_ALL under Unix)
+ virtual void SetLocale();
+#endif // wxUSE_INTL
+
+
// functions abstracting differences between GUI and console modes
// ------------------------------------------------------------------------
// functions abstracting differences between GUI and console modes
// ------------------------------------------------------------------------
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable() = 0;
#endif
virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable() = 0;
#endif
+
+ // functions returning port-specific information
+ // ------------------------------------------------------------------------
+
// return information about the (native) toolkit currently used and its
// runtime (not compile-time) version.
// returns wxPORT_BASE for console applications and one of the remaining
// return information about the (native) toolkit currently used and its
// runtime (not compile-time) version.
// returns wxPORT_BASE for console applications and one of the remaining
virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const;
#ifdef __WXGTK__
virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const;
#ifdef __WXGTK__
+ virtual void SetLocale();
virtual wxString GetDesktopEnvironment() const;
#endif
virtual wxString GetDesktopEnvironment() const;
#endif
bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig)
{
bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig)
{
+#if wxUSE_INTL
+ GetTraits()->SetLocale();
+#endif // wxUSE_INTL
+
// remember the command line arguments
argc = argcOrig;
argv = argvOrig;
// remember the command line arguments
argc = argcOrig;
argv = argvOrig;
// the application name is, by default, the name of its executable file
wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL);
}
// the application name is, by default, the name of its executable file
wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL);
}
// wxAppTraits
// ----------------------------------------------------------------------------
// wxAppTraits
// ----------------------------------------------------------------------------
+void wxAppTraitsBase::SetLocale()
+{
+ setlocale(LC_ALL, "");
+}
+
#ifdef __WXDEBUG__
bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal)
#ifdef __WXDEBUG__
bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal)
bool wxApp::Initialize(int& argc, wxChar **argv)
{
bool wxApp::Initialize(int& argc, wxChar **argv)
{
+ if ( !wxAppBase::Initialize(argc, argv) )
+ return false;
#if wxUSE_THREADS
if (!g_thread_supported())
#if wxUSE_THREADS
if (!g_thread_supported())
g_main_context_set_poll_func(NULL, wxapp_poll_func);
#endif // wxUSE_THREADS
g_main_context_set_poll_func(NULL, wxapp_poll_func);
#endif // wxUSE_THREADS
// We should have the wxUSE_WCHAR_T test on the _outside_
#if wxUSE_WCHAR_T
// gtk+ 2.0 supports Unicode through UTF-8 strings
// We should have the wxUSE_WCHAR_T test on the _outside_
#if wxUSE_WCHAR_T
// gtk+ 2.0 supports Unicode through UTF-8 strings
static wxConvBrokenFileNames fileconv(encName);
wxConvFileName = &fileconv;
static wxConvBrokenFileNames fileconv(encName);
wxConvFileName = &fileconv;
#if wxUSE_UNICODE
// gtk_init() wants UTF-8, not wchar_t, so convert
int i;
#if wxUSE_UNICODE
// gtk_init() wants UTF-8, not wchar_t, so convert
int i;
// we can not enter threads before gtk_init is done
gdk_threads_enter();
// we can not enter threads before gtk_init is done
gdk_threads_enter();
- if ( !wxAppBase::Initialize(argc, argv) )
- {
- gdk_threads_leave();
-
- return false;
- }
-
wxSetDetectableAutoRepeat( true );
#if wxUSE_INTL
wxSetDetectableAutoRepeat( true );
#if wxUSE_INTL
// wxGUIAppTraits
//-----------------------------------------------------------------------------
// wxGUIAppTraits
//-----------------------------------------------------------------------------
+void wxGUIAppTraits::SetLocale()
+{
+ gtk_set_locale();
+}
+
#ifdef __WXDEBUG__
#if wxUSE_STACKWALKER
#ifdef __WXDEBUG__
#if wxUSE_STACKWALKER