Fall back to default process layout direction in wxMSW.

Add helper wxApp::MSWGetDefaultLayout() static method and use it instead of
wxTheApp->GetLayoutDirection() in wxMSW code.

This serves two purposes: first, wxMessageDialog doesn't crash when it's shown
before wxTheApp is created (or after it's destroyed) any more. And second, we
use the correct layout direction if the main application has enabled it by
calling SetProcessDefaultLayout() or using two U+200E characters in the
beginning of its "FileDescription" resource field by default now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78236 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:18:25 +00:00
parent 59086bd01a
commit f1fd45892f
6 changed files with 50 additions and 8 deletions

View File

@@ -267,7 +267,7 @@ WXHWND wxToolTip::GetToolTipCtrl()
if ( !ms_hwndTT )
{
WXDWORD exflags = 0;
if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft )
if ( wxApp::MSWGetDefaultLayout() == wxLayout_RightToLeft )
{
exflags |= WS_EX_LAYOUTRTL;
}