Skip to content
Permalink
Browse files

more specific check for 3.1.2 xrc error

The `wxEXPAND` flag is necessary for the game area in wxWidgets 3.0 and
earlier, it may be necessary in 3.1.2 as well, but it throws an xrc
error, so we check for windows and at least 3.1.2 to test for the visual
studio and vcpkg environment to avoid the xrc error.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Apr 1, 2019
1 parent d9a7df6 commit 0f0d2400bc3c723457165f642d8578e8237bb3ba
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/wx/panel.cpp
@@ -1042,9 +1042,8 @@ void GameArea::OnIdle(wxIdleEvent& event)
#endif

// On windows with the vcpkg version of wxWidgets which is 3.1.2, the
// wxEXPAND flag throws an XRC error, but everything works fine without it.
// On GTK however, the flag is necessary.
#if defined(__WXMSW__)
// wxEXPAND flag throws an XRC error, but it is necessary on earlier versions of wxWidgets
#if defined(__WXMSW__) && wxCHECK_VERSION(3, 1, 2)
GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL) : wxEXPAND);
#else
GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL | wxEXPAND) : wxEXPAND);

0 comments on commit 0f0d240

Please sign in to comment.
You can’t perform that action at this time.