From c30ce554ef87d7dd003e8e5a50e97d7d2233d058 Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 23 Apr 2015 10:00:14 +0000 Subject: [PATCH] Build fix for wx2.x --- src/wx/cmdevents.cpp | 7 ++++++- src/wx/guiinit.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index f66b9c54..ceccb904 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -20,8 +20,13 @@ extern "C" { #include "../gb/gbPrinter.h" #include "../gba/agbprint.h" +#if (wxMAJOR_VERSION < 3) #define GetXRCDialog(n) \ - dynamic_cast(FindWindowByName(n)) + wxStaticCast(wxGetApp().frame->FindWindow(XRCID(n)), wxDialog) +#else +#define GetXRCDialog(n) \ + wxStaticCast(wxGetApp().frame->FindWindowByName(n), wxDialog) +#endif bool cmditem_lt(const struct cmditem &cmd1, const struct cmditem &cmd2) { diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 541949bf..9b035c21 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -43,8 +43,13 @@ static void mark_recursive(wxWindowBase *w) mark_recursive(*ch); } +#if (wxMAJOR_VERSION < 3) #define GetXRCDialog(n) \ - wxStaticCast(wxGetApp().frame->FindWindowByName(n), wxDialog) + wxStaticCast(wxGetApp().frame->FindWindow(XRCID(n)), wxDialog) +#else +#define GetXRCDialog(n) \ + wxStaticCast(wxGetApp().frame->FindWindowByName(n), wxDialog) +#endif // Event handlers must be methods of wxEvtHandler-derived objects