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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user