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