This method always returns some valid traits, even if we don't have wxTheApp
(which is possible in the console applications) or if its GetTraits() was
overridden to return NULL (which shouldn't be, but still guard against this).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This undoes the changes of r44773 because calling setlocale() resulted in C
locale being set differently from C++ locale which was confusing and led to
huge slowdowns in any code using std::stream with at least MinGW. And setting
the C++ locale to be the same, as r72719 tried to do, doesn't seem to be
practical as it results in immediate crashes under OS X and MinGW when used
under XP.
Do provide wxApp::SetCLocale() helper to explicitly do what was previously
done implicitly, even though currently it is a trivial wrapper for setlocale()
and we don't even need to call gtk_set_locale() as it has never done anything
else and is deprecated since GTK+ 2.24.
Closes#14780.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This avoids a needless conversion from (originally Unicode) command line to
ANSI by the CRT and conversion back by wxWidgets and, especially, ensures that
there is no data loss if the Unicode command line arguments can't be converted
into the current charset.
See #14580.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There is no need for a separate declaration inside wxIMPLEMENT_APP() as
wxGetApp() is defined by it and redeclaring it immediately after definition
results in a warning with some compilers/environments (Eclipse CDT).
The move of wxGetApp() to the beginning of the macro is only to ensure that a
semicolon is still required after wxIMPLEMENT_APP_NO_MAIN() and the other
macros terminating with it, such as wxIMPLEMENT_APP() itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The company behind MGL toolkit (SciTech) doesn't exist since several years and
this port is not used by anybody, so remove it to ease maintenance burden.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The platform targeted by this port doesn't exist any more and the port never
achieved really working state so remove the code to avoid having to maintain
it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow defining event filters to globally pre-process all application events
without having to override wxApp::FilterEvent().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Avoid using Cygwin sockets as our code assumes that we use WinSock API under
Windows currently (this might change in the future) by defining
__USE_W32_SOCKETS.
Use new, safer and more efficient cygwin_conv_path() function.
Use t_str() instead of fn_str() with Windows API taking file names, under
Cygwin they are different and using fn_str() is incorrect.
A few other minor fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By default include assertions and debug logging in both debug and release
builds but disable them in application release builds (when NDEBUG is
defined).
Also update (more accurately, replace) debugging overview.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't capitalize the app name if it had been explicitly set with SetAppName()
as this can result in unexpectedly wrong value. Do capitalize the program name
which is used as app name by default and don't store the program name in
m_appName to be able to distinguish between the two cases.
Closes#11165.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Old code called wxApp::ProcessIdle() from wxEventLoopManualRun::Run() which called wxEventLoop::ProcessIdle() which called wxApp methods from it. In the new version wxEventLoopManualRun::Run() calls wxEventLoopManualRun::ProcessIdle() which calls wxApp::ProcessIdle() which calls other wxApp methods which seems to make more sense and also allows overriding ProcessIdle() in either wxEventLoopManual or wxApp-derived classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix wxAppConsoleBase::Suspend/ResumeProcessingOfPendingEvents: locking the mutex does not prevent wxAppConsoleBase::ProcessPendingEvents from running if the mutex was locked from the main thread!
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
- implements YieldFor() with event filtering for wxMSW and wxGTK,
adds TODO markers in other ports;
- replaces wxYield() in GTK's clipboard code with a wxTheApp->YieldFor() call, thus fixing possible reentrancies
(and modifies clipboard sample to test synchronous IsSupported calls)
- replaces wxYieldIfNeeded() calls in wxProgressDialog with wxTheApp->YieldFor() calls, so that it processes only
UI/user-input events, thus fixing the race condition visible in the "thread" sample
- documents the new functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ODR and hence results in many problems in practice; instead use wxEventLoopBase
whenever possible and #define wxEventLoop differently in console applications
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775