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

@@ -74,6 +74,17 @@ public:
// in the previous GetRegisteredClassName() calls
static bool IsRegisteredClassName(const wxString& name);
// Return the layout direction to use for a window by default.
//
// If the parent is specified, use the same layout direction as it uses.
// Otherwise use the default global layout, either from wxTheApp, if it
// exists, or Windows itself.
//
// Notice that this normally should not be used for the child windows as
// they already inherit, just dialogs such as wxMessageDialog may want to
// use it.
static wxLayoutDirection MSWGetDefaultLayout(wxWindow* parent = NULL);
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT